From d8858cb58b0181972961fe693446a2ae14d8cc14 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Thu, 20 Nov 2025 23:30:47 +0200 Subject: [PATCH] Bugfix for the HunyuanVideo15 SR model --- comfy/model_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_base.py b/comfy/model_base.py index 60dded117..e14b552c5 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -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 = self.process_latent_in(image) # scaling wasn't applied in reference code 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: generator = torch.Generator(device="cpu") 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) image[:, lq_image_slice] = noise_augmentation * noise + min(1.0 - noise_augmentation, 0.75) * image[:, lq_image_slice] else: