mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user