mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 05:22:34 +08:00
Bugfix for the HunyuanVideo15 SR model
This commit is contained in:
parent
87256acf20
commit
d8858cb58b
@ -1613,10 +1613,10 @@ class HunyuanVideo15_SR_Distilled(HunyuanVideo15):
|
|||||||
image = utils.common_upscale(image.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center")
|
image = utils.common_upscale(image.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center")
|
||||||
#image = self.process_latent_in(image) # scaling wasn't applied in reference code
|
#image = self.process_latent_in(image) # scaling wasn't applied in reference code
|
||||||
image = utils.resize_to_batch_size(image, noise.shape[0])
|
image = utils.resize_to_batch_size(image, noise.shape[0])
|
||||||
|
lq_image_slice = slice(noise.shape[1] + 1, 2 * noise.shape[1] + 1)
|
||||||
if noise_augmentation > 0:
|
if noise_augmentation > 0:
|
||||||
generator = torch.Generator(device="cpu")
|
generator = torch.Generator(device="cpu")
|
||||||
generator.manual_seed(kwargs.get("seed", 0) - 10)
|
generator.manual_seed(kwargs.get("seed", 0) - 10)
|
||||||
lq_image_slice = slice(noise.shape[1] + 1, 2 * noise.shape[1] + 1)
|
|
||||||
noise = torch.randn(image[:, lq_image_slice].shape, generator=generator, dtype=image.dtype, device="cpu").to(image.device)
|
noise = torch.randn(image[:, lq_image_slice].shape, generator=generator, dtype=image.dtype, device="cpu").to(image.device)
|
||||||
image[:, lq_image_slice] = noise_augmentation * noise + min(1.0 - noise_augmentation, 0.75) * image[:, lq_image_slice]
|
image[:, lq_image_slice] = noise_augmentation * noise + min(1.0 - noise_augmentation, 0.75) * image[:, lq_image_slice]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user