mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-10 01:02:56 +08:00
Merge 0388ac4309 into 65045730a6
This commit is contained in:
commit
6ef92f9d90
@ -1006,8 +1006,19 @@ class CFGGuider:
|
|||||||
return latent_image
|
return latent_image
|
||||||
|
|
||||||
if latent_image.is_nested:
|
if latent_image.is_nested:
|
||||||
latent_image, latent_shapes = comfy.utils.pack_latents(latent_image.unbind())
|
li_tensors = latent_image.unbind()
|
||||||
noise, _ = comfy.utils.pack_latents(noise.unbind())
|
if noise.is_nested:
|
||||||
|
# Truncate extra noise components, pad missing ones with zeros
|
||||||
|
n_tensors = list(noise.unbind()[:len(li_tensors)])
|
||||||
|
for i in range(len(n_tensors), len(li_tensors)):
|
||||||
|
n_tensors.append(torch.zeros_like(li_tensors[i]))
|
||||||
|
else:
|
||||||
|
# Noise only covers video -- pad remaining components (audio) with zeros
|
||||||
|
n_tensors = [noise]
|
||||||
|
for i in range(1, len(li_tensors)):
|
||||||
|
n_tensors.append(torch.zeros_like(li_tensors[i]))
|
||||||
|
latent_image, latent_shapes = comfy.utils.pack_latents(li_tensors)
|
||||||
|
noise, _ = comfy.utils.pack_latents(n_tensors)
|
||||||
else:
|
else:
|
||||||
latent_shapes = [latent_image.shape]
|
latent_shapes = [latent_image.shape]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user