bug fixes

This commit is contained in:
kijai
2025-03-03 01:35:36 +02:00
parent 8e0a90f1a4
commit 24fb1b42fe
2 changed files with 8 additions and 8 deletions
+5 -4
View File
@@ -1266,6 +1266,7 @@ class WanVideoSampler:
positive_prompt = text_embeds["prompt_embeds"][prompt_index]
img_emb = image_embeds.get("image_embeds", None)
partial_img_emb = None
if img_emb is not None:
print("img_emb shape", img_emb.shape)
partial_img_emb = img_emb[:, c, :, :]
@@ -1275,7 +1276,7 @@ class WanVideoSampler:
# Model inference - returns [frames, channels, height, width]
noise_pred_cond = transformer(
partial_latent_model_input,
y=[partial_img_emb],
y=partial_img_emb,
t=timestep,
current_step=i,
is_uncond=False,
@@ -1285,7 +1286,7 @@ class WanVideoSampler:
if cfg[i] != 1.0:
noise_pred_uncond = transformer(
partial_latent_model_input,
y=[partial_img_emb],
y=partial_img_emb,
t=timestep,
current_step=i,
is_uncond=True,
@@ -1322,14 +1323,14 @@ class WanVideoSampler:
t=timestep,
current_step=i,
is_uncond=False,
y=[image_embeds.get("image_embeds", None)],
y=image_embeds.get("image_embeds", None),
context = [text_embeds["prompt_embeds"][0]],
**args
)[0].to(intermediate_device)
if cfg[i] != 1.0:
noise_pred_uncond = transformer(
latent_model_input,
y=[image_embeds.get("image_embeds", None)],
y=image_embeds.get("image_embeds", None),
t=timestep,
current_step=i,
is_uncond=True,
+3 -4
View File
@@ -609,13 +609,12 @@ class WanModel(ModelMixin, ConfigMixin):
"""
if self.model_type == 'i2v':
assert clip_fea is not None and y is not None
# params
#device = self.patch_embedding.weight.device
if freqs.device != device:
freqs = freqs.to(device)
if y is not None:
x = [torch.cat([u, v], dim=0) for u, v in zip(x, y)]
x = torch.cat([x, y], dim=0)
# embeddings
x = [self.patch_embedding(u.unsqueeze(0)) for u in x]