From e7d7e699e149ed2c14788ae32d4b8f9fc19580db Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 08:16:02 +0000 Subject: [PATCH] Fix latent concatenation running inside the loop in resize_hires torch.cat was indented into the per-item loop, so with two or more latents the first iteration replaced the list with a tensor and the next iteration concatenated its dim-0 slices, destroying the batch dimension. Concatenate once after the loop. https: //claude.ai/code/session_014QWKWgKvMevcuvfCnsYoT2 Co-Authored-By: Claude --- modules/processing_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/processing_helpers.py b/modules/processing_helpers.py index 1d81bbd56..7fca8c704 100644 --- a/modules/processing_helpers.py +++ b/modules/processing_helpers.py @@ -427,7 +427,7 @@ def resize_hires(p, latents): # input=latents output=pil if not latent_upscaler if not torch.is_tensor(latents[i]): log.warning(f'Hires: input[{i}]={type(latents[i])} not tensor') latents[i] = processing_vae.vae_encode(image=latents[i], model=shared.sd_model, vae_type=p.vae_type) - latents = torch.cat(latents, dim=0) + latents = torch.cat(latents, dim=0) except Exception as e: log.error(f'Hires: prepare latents: {e}') resized = latents