Skip to content

Commit d6c63bb

Browse files
authored
[modular] add a check (#12628)
* add * fix
1 parent 2f44d63 commit d6c63bb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/diffusers/modular_pipelines/modular_pipeline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,10 @@ def __init__(self):
861861
else:
862862
sub_blocks[block_name] = block
863863
self.sub_blocks = sub_blocks
864+
if not len(self.block_names) == len(self.block_classes):
865+
raise ValueError(
866+
f"In {self.__class__.__name__}, the number of block_names and block_classes must be the same."
867+
)
864868

865869
def _get_inputs(self):
866870
inputs = []

src/diffusers/modular_pipelines/qwenimage/modular_blocks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ class QwenImageCoreDenoiseStep(SequentialPipelineBlocks):
523523
QwenImageOptionalControlNetBeforeDenoiseStep,
524524
QwenImageAutoDenoiseStep,
525525
]
526-
block_names = ["input", "controlnet_input", "before_denoise", "controlnet_before_denoise", "denoise", "decode"]
526+
block_names = ["input", "controlnet_input", "before_denoise", "controlnet_before_denoise", "denoise"]
527527

528528
@property
529529
def description(self):
@@ -534,7 +534,6 @@ def description(self):
534534
+ " - `QwenImageAutoBeforeDenoiseStep` (before_denoise) prepares the inputs for the denoising step.\n"
535535
+ " - `QwenImageOptionalControlNetBeforeDenoiseStep` (controlnet_before_denoise) prepares the controlnet input for the denoising step.\n"
536536
+ " - `QwenImageAutoDenoiseStep` (denoise) iteratively denoises the latents.\n"
537-
+ " - `QwenImageAutoDecodeStep` (decode) decodes the latents into images.\n\n"
538537
+ "This step support text-to-image, image-to-image, inpainting, and controlnet tasks for QwenImage:\n"
539538
+ " - for image-to-image generation, you need to provide `image_latents`\n"
540539
+ " - for inpainting, you need to provide `processed_mask_image` and `image_latents`\n"

0 commit comments

Comments
 (0)