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 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-06-11 08:16:02 +00:00
committed by QualiaRain
parent df568f9d4b
commit e7d7e699e1
+1 -1
View File
@@ -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