Skip to content

Commit ed58810

Browse files
authored
[modular] clean up unused intermediate_inputs (#14278)
upp
1 parent 9f492ca commit ed58810

3 files changed

Lines changed: 0 additions & 67 deletions

File tree

src/diffusers/modular_pipelines/flux/denoise.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,6 @@ def description(self) -> str:
214214
"object (e.g. `FluxDenoiseLoopWrapper`)"
215215
)
216216

217-
@property
218-
def inputs(self) -> list[tuple[str, Any]]:
219-
return []
220-
221-
@property
222-
def intermediate_inputs(self) -> list[str]:
223-
return [InputParam("generator")]
224-
225217
@property
226218
def intermediate_outputs(self) -> list[OutputParam]:
227219
return [OutputParam("latents", type_hint=torch.Tensor, description="The denoised latents")]

src/diffusers/modular_pipelines/flux2/denoise.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,6 @@ def description(self) -> str:
374374
"object (e.g. `Flux2DenoiseLoopWrapper`)"
375375
)
376376

377-
@property
378-
def inputs(self) -> list[tuple[str, Any]]:
379-
return []
380-
381-
@property
382-
def intermediate_inputs(self) -> list[str]:
383-
return [InputParam("generator")]
384-
385377
@property
386378
def intermediate_outputs(self) -> list[OutputParam]:
387379
return [OutputParam("latents", type_hint=torch.Tensor, description="The denoised latents")]

src/diffusers/modular_pipelines/modular_pipeline_utils.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -649,56 +649,6 @@ def format_inputs_short(inputs):
649649
return inputs_str
650650

651651

652-
def format_intermediates_short(intermediate_inputs, required_intermediate_inputs, intermediate_outputs):
653-
"""
654-
Formats intermediate inputs and outputs of a block into a string representation.
655-
656-
Args:
657-
intermediate_inputs: list of intermediate input parameters
658-
required_intermediate_inputs: list of required intermediate input names
659-
intermediate_outputs: list of intermediate output parameters
660-
661-
Returns:
662-
str: Formatted string like:
663-
Intermediates:
664-
- inputs: Required(latents), dtype
665-
- modified: latents # variables that appear in both inputs and outputs
666-
- outputs: images # new outputs only
667-
"""
668-
# Handle inputs
669-
input_parts = []
670-
for inp in intermediate_inputs:
671-
if inp.name in required_intermediate_inputs:
672-
input_parts.append(f"Required({inp.name})")
673-
else:
674-
if inp.name is None and inp.kwargs_type is not None:
675-
inp_name = "*_" + inp.kwargs_type
676-
else:
677-
inp_name = inp.name
678-
input_parts.append(inp_name)
679-
680-
# Handle modified variables (appear in both inputs and outputs)
681-
inputs_set = {inp.name for inp in intermediate_inputs}
682-
modified_parts = []
683-
new_output_parts = []
684-
685-
for out in intermediate_outputs:
686-
if out.name in inputs_set:
687-
modified_parts.append(out.name)
688-
else:
689-
new_output_parts.append(out.name)
690-
691-
result = []
692-
if input_parts:
693-
result.append(f" - inputs: {', '.join(input_parts)}")
694-
if modified_parts:
695-
result.append(f" - modified: {', '.join(modified_parts)}")
696-
if new_output_parts:
697-
result.append(f" - outputs: {', '.join(new_output_parts)}")
698-
699-
return "\n".join(result) if result else " (none)"
700-
701-
702652
def format_params(params, header="Args", indent_level=4, max_line_length=115):
703653
"""Format a list of InputParam or OutputParam objects into a readable string representation.
704654
@@ -977,7 +927,6 @@ def make_doc_string(
977927
978928
Args:
979929
inputs: list of input parameters
980-
intermediate_inputs: list of intermediate input parameters
981930
outputs: list of output parameters
982931
description (str, *optional*): Description of the block
983932
class_name (str, *optional*): Name of the class to include in the documentation

0 commit comments

Comments
 (0)