Skip to content

Commit 9dbed17

Browse files
committed
make flux ready for mellon
1 parent 9ae5b62 commit 9dbed17

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/diffusers/modular_pipelines/flux/encoders.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def inputs(self) -> List[InputParam]:
181181
return [
182182
InputParam("prompt"),
183183
InputParam("prompt_2"),
184+
InputParam("max_sequence_length", type_hint=int, default=512, required=False),
184185
InputParam("joint_attention_kwargs"),
185186
]
186187

@@ -404,6 +405,7 @@ def __call__(self, components: FluxModularPipeline, state: PipelineState) -> Pip
404405
pooled_prompt_embeds=None,
405406
device=block_state.device,
406407
num_images_per_prompt=1, # TODO: hardcoded for now.
408+
max_sequence_length=block_state.max_sequence_length,
407409
lora_scale=block_state.text_encoder_lora_scale,
408410
)
409411

src/diffusers/modular_pipelines/flux/modular_blocks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def description(self):
8484

8585
# before_denoise: all task (text2img, img2img)
8686
class FluxAutoBeforeDenoiseStep(AutoPipelineBlocks):
87-
block_classes = [FluxBeforeDenoiseStep, FluxImg2ImgBeforeDenoiseStep]
88-
block_names = ["text2image", "img2img"]
89-
block_trigger_inputs = [None, "image_latents"]
87+
block_classes = [FluxImg2ImgBeforeDenoiseStep, FluxBeforeDenoiseStep]
88+
block_names = ["img2img", "text2image"]
89+
block_trigger_inputs = ["image_latents", None]
9090

9191
@property
9292
def description(self):

0 commit comments

Comments
 (0)