Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/diffusers/pipelines/kandinsky5/pipeline_kandinsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,13 @@ def __call__(
)

if negative_prompt_embeds_qwen is None:
negative_prompt_embeds_qwen, negative_prompt_embeds_clip, negative_cu_seqlens = self.encode_prompt(
prompt=negative_prompt,
max_sequence_length=max_sequence_length,
device=device,
dtype=dtype,
negative_prompt_embeds_qwen, negative_prompt_embeds_clip, negative_prompt_cu_seqlens = (
self.encode_prompt(
prompt=negative_prompt,
max_sequence_length=max_sequence_length,
device=device,
dtype=dtype,
)
)

# 4. Prepare timesteps
Expand Down Expand Up @@ -780,8 +782,8 @@ def __call__(
text_rope_pos = torch.arange(prompt_cu_seqlens.diff().max().item(), device=device)

negative_text_rope_pos = (
torch.arange(negative_cu_seqlens.diff().max().item(), device=device)
if negative_cu_seqlens is not None
torch.arange(negative_prompt_cu_seqlens.diff().max().item(), device=device)
if negative_prompt_cu_seqlens is not None
else None
)

Expand Down
Loading