Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Don't try to use clip_fea on t2v model.

comfyanonymous4bca7367f324
diff --git a/comfy/ldm/wan/model.py b/comfy/ldm/wan/model.py
index e88a1834b..c67a65b24 100644
--- a/comfy/ldm/wan/model.py
+++ b/comfy/ldm/wan/model.py
@@ -378,6 +378,8 @@ class WanModel(torch.nn.Module):
if model_type == 'i2v':
self.img_emb = MLPProj(1280, dim, operation_settings=operation_settings)
+ else:
+ self.img_emb = None
def forward_orig(
self,
@@ -421,7 +423,7 @@ class WanModel(torch.nn.Module):
# context
context = self.text_embedding(torch.cat([context, context.new_zeros(context.size(0), self.text_len - context.size(1), context.size(2))], dim=1))
- if clip_fea is not None:
+ if clip_fea is not None and self.img_emb is not None:
context_clip = self.img_emb(clip_fea) # bs x 257 x dim
context = torch.concat([context_clip, context], dim=1)