Skip to content

Commit 3d15ca5

Browse files
committed
Address guider is not None comment
1 parent 63e7713 commit 3d15ca5

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

src/diffusers/pipelines/motif_video/pipeline_motif_video.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,7 @@ def __call__(
609609

610610
# 3. Prepare text embeddings
611611
# Ensure negative prompt is provided for multi-condition guiders
612-
if (
613-
self.guider is not None
614-
and self.guider.num_conditions > 1
615-
and negative_prompt_embeds is None
616-
and negative_prompt is None
617-
):
612+
if self.guider.num_conditions > 1 and negative_prompt_embeds is None and negative_prompt is None:
618613
negative_prompt = ""
619614

620615
prompt_embeds, negative_prompt_embeds, prompt_attention_mask, negative_prompt_attention_mask = (
@@ -711,7 +706,7 @@ def __call__(
711706
timestep = t.expand(latents.shape[0])
712707

713708
# Guider: collect model inputs
714-
if self.guider is not None and self.guider.num_conditions == 1:
709+
if self.guider.num_conditions == 1:
715710
guider_inputs = {
716711
"encoder_hidden_states": (prompt_embeds,),
717712
"encoder_attention_mask": (prompt_attention_mask,),

src/diffusers/pipelines/motif_video/pipeline_motif_video_image2video.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,7 @@ def __call__(
758758

759759
# 5. Prepare text embeddings
760760
# Ensure negative prompt is provided for multi-condition guiders
761-
if (
762-
self.guider is not None
763-
and self.guider.num_conditions > 1
764-
and negative_prompt_embeds is None
765-
and negative_prompt is None
766-
):
761+
if self.guider.num_conditions > 1 and negative_prompt_embeds is None and negative_prompt is None:
767762
negative_prompt = ""
768763

769764
prompt_embeds, negative_prompt_embeds, prompt_attention_mask, negative_prompt_attention_mask = (
@@ -838,7 +833,7 @@ def __call__(
838833

839834
timestep = t.expand(latents.shape[0])
840835

841-
if self.guider is not None and self.guider.num_conditions == 1:
836+
if self.guider.num_conditions == 1:
842837
guider_inputs = {
843838
"encoder_hidden_states": (prompt_embeds,),
844839
"encoder_attention_mask": (prompt_attention_mask,),

0 commit comments

Comments
 (0)