Skip to content

Commit 01f0a52

Browse files
authored
Quick fix for negative_prompt_embeds is None (#159)
* Fix unique_id comp order * Fix LTX2 link * Fix param size * Fix param size * [docs] reorder supported algorithms by arXiv date and add paper links Improve README discoverability by sorting trainer entries by first arXiv upload time and adding direct paper references for each algorithm. Made-with: Cursor * [docs] add separate Flow-GRPO and Dance-GRPO paper links Clarify the GRPO row in the Supported Algorithms table by linking Flow-GRPO and Dance-GRPO to their respective papers. Made-with: Cursor * [chore] update diffusers submodule to latest upstream commit (#142) Made-with: Cursor * Quick fix for negative_prompt_embeds is None
1 parent f526802 commit 01f0a52

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/flow_factory/models/wan/wan2_v2v.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ def inference(
322322
negative_prompt_embeds = encoded.get("negative_prompt_embeds", None)
323323
else:
324324
prompt_embeds = prompt_embeds.to(device)
325-
negative_prompt_embeds = negative_prompt_embeds.to(device)
325+
if negative_prompt_embeds is not None:
326+
negative_prompt_embeds = negative_prompt_embeds.to(device)
326327

327328
batch_size = prompt_embeds.shape[0]
328329

src/flow_factory/models/z_image/z_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def inference(
240240
negative_prompt_embeds = encoded['negative_prompt_embeds'] if do_classifier_free_guidance else None
241241
else:
242242
prompt_embeds = [pe.to(device) for pe in prompt_embeds]
243-
negative_prompt_embeds = [npe.to(device) for npe in negative_prompt_embeds]
243+
if negative_prompt_embeds is not None:
244+
negative_prompt_embeds = [npe.to(device) for npe in negative_prompt_embeds]
244245

245246
batch_size = len(prompt_embeds)
246247
num_channels_latents = self.pipeline.transformer.in_channels

0 commit comments

Comments
 (0)