mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-09 05:40:49 +08:00
Allow Wan21_HuMo extra_conds to pass concat_latent_image through if present
This commit is contained in:
parent
178bdc5e14
commit
d56d374c96
@ -1248,11 +1248,13 @@ class WAN21_HuMo(WAN21):
|
|||||||
if audio_embed is not None:
|
if audio_embed is not None:
|
||||||
out['audio_embed'] = comfy.conds.CONDRegular(audio_embed)
|
out['audio_embed'] = comfy.conds.CONDRegular(audio_embed)
|
||||||
|
|
||||||
if "c_concat" not in out: # 1.7B model
|
|
||||||
reference_latents = kwargs.get("reference_latents", None)
|
reference_latents = kwargs.get("reference_latents", None)
|
||||||
if reference_latents is not None:
|
|
||||||
|
if "c_concat" not in out and reference_latents is not None and reference_latents[0].shape[1] == 16: # 1.7B model
|
||||||
out['reference_latent'] = comfy.conds.CONDRegular(self.process_latent_in(reference_latents[-1]))
|
out['reference_latent'] = comfy.conds.CONDRegular(self.process_latent_in(reference_latents[-1]))
|
||||||
else:
|
else:
|
||||||
|
concat_latent_image = kwargs.get("concat_latent_image", None)
|
||||||
|
if concat_latent_image is None:
|
||||||
noise_shape = list(noise.shape)
|
noise_shape = list(noise.shape)
|
||||||
noise_shape[1] += 4
|
noise_shape[1] += 4
|
||||||
concat_latent = torch.zeros(noise_shape, device=noise.device, dtype=noise.dtype)
|
concat_latent = torch.zeros(noise_shape, device=noise.device, dtype=noise.dtype)
|
||||||
@ -1263,7 +1265,6 @@ class WAN21_HuMo(WAN21):
|
|||||||
concat_latent[:, 4:, :1] = zero_vae_values_first
|
concat_latent[:, 4:, :1] = zero_vae_values_first
|
||||||
concat_latent[:, 4:, 1:2] = zero_vae_values_second
|
concat_latent[:, 4:, 1:2] = zero_vae_values_second
|
||||||
out['c_concat'] = comfy.conds.CONDNoiseShape(concat_latent)
|
out['c_concat'] = comfy.conds.CONDNoiseShape(concat_latent)
|
||||||
reference_latents = kwargs.get("reference_latents", None)
|
|
||||||
if reference_latents is not None:
|
if reference_latents is not None:
|
||||||
ref_latent = self.process_latent_in(reference_latents[-1])
|
ref_latent = self.process_latent_in(reference_latents[-1])
|
||||||
ref_latent_shape = list(ref_latent.shape)
|
ref_latent_shape = list(ref_latent.shape)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user