From f41f10a4eebf28a62c95142cea27cf7fffa98259 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Sun, 2 Mar 2025 17:16:29 +0200 Subject: [PATCH] fix text embed casting --- nodes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes.py b/nodes.py index a47a0a9..b5671ac 100644 --- a/nodes.py +++ b/nodes.py @@ -756,10 +756,10 @@ class WanVideoTextEmbedBridge: DESCRIPTION = "Bridge between ComfyUI native text embedding and WanVideoWrapper text embedding" def process(self, positive, negative): - + device=mm.get_torch_device() prompt_embeds_dict = { - "prompt_embeds": positive[0][0], - "negative_prompt_embeds": negative[0][0], + "prompt_embeds": positive[0][0].to(device), + "negative_prompt_embeds": negative[0][0].to(device), } return (prompt_embeds_dict,) @@ -1140,9 +1140,9 @@ class WanVideoSampler: }) arg_c = base_args.copy() - arg_c.update({'context': [text_embeds["prompt_embeds"][0].to(device)]}) + arg_c.update({'context': [text_embeds["prompt_embeds"][0]]}) arg_null = base_args.copy() - arg_null.update({'context': text_embeds["negative_prompt_embeds"].to(device)}) + arg_null.update({'context': text_embeds["negative_prompt_embeds"]}) pbar = ProgressBar(steps)