diff --git a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage.py b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage.py index 63e9f5a283..ebe0bbbd75 100644 --- a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage.py +++ b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage.py @@ -12,9 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import List + +import PIL.Image +import torch + from ...utils import logging from ..modular_pipeline import AutoPipelineBlocks, ConditionalPipelineBlocks, SequentialPipelineBlocks -from ..modular_pipeline_utils import InsertableDict +from ..modular_pipeline_utils import InsertableDict, OutputParam from .before_denoise import ( QwenImageControlNetBeforeDenoiserStep, QwenImageCreateMaskLatentsStep, @@ -394,6 +399,14 @@ class QwenImageAutoCoreDenoiseStep(ConditionalPipelineBlocks): + " - for text-to-image generation, all you need to provide is prompt embeddings" ) + @property + def outputs(self): + return [ + OutputParam( + name="latents", type_hint=torch.Tensor, description="The latents generated by the denoising step" + ), + ] + # ==================== # 3. DECODE @@ -467,3 +480,9 @@ class QwenImageAutoBlocks(SequentialPipelineBlocks): + "- to run the controlnet workflow, you need to provide `control_image`\n" + "- for text-to-image generation, all you need to provide is `prompt`" ) + + @property + def outputs(self): + return [ + OutputParam(name="images", type_hint=List[List[PIL.Image.Image]]), + ] diff --git a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit.py b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit.py index 99a349994c..2683e64080 100644 --- a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit.py +++ b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit.py @@ -12,11 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Optional +from typing import List, Optional + +import PIL.Image +import torch from ...utils import logging from ..modular_pipeline import AutoPipelineBlocks, ConditionalPipelineBlocks, SequentialPipelineBlocks -from ..modular_pipeline_utils import InsertableDict +from ..modular_pipeline_utils import InsertableDict, OutputParam from .before_denoise import ( QwenImageCreateMaskLatentsStep, QwenImageEditRoPEInputsStep, @@ -307,6 +310,14 @@ class QwenImageEditAutoDecodeStep(AutoPipelineBlocks): " - `QwenImageEditDecodeStep` (edit) is used when `mask` is not provided.\n" ) + @property + def outputs(self): + return [ + OutputParam( + name="latents", type_hint=torch.Tensor, description="The latents generated by the denoising step" + ), + ] + # ==================== # 5. AUTO BLOCKS & PRESETS @@ -334,3 +345,9 @@ class QwenImageEditAutoBlocks(SequentialPipelineBlocks): "- for edit (img2img) generation, you need to provide `image`\n" "- for edit inpainting, you need to provide `mask_image` and `image`, optionally you can provide `padding_mask_crop`\n" ) + + @property + def outputs(self): + return [ + OutputParam(name="images", type_hint=List[List[PIL.Image.Image]], description="The generated images"), + ] diff --git a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit_plus.py b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit_plus.py index 275e4288eb..99c5b109bf 100644 --- a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit_plus.py +++ b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_edit_plus.py @@ -12,9 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import List + +import PIL.Image +import torch + from ...utils import logging from ..modular_pipeline import SequentialPipelineBlocks -from ..modular_pipeline_utils import InsertableDict +from ..modular_pipeline_utils import InsertableDict, OutputParam from .before_denoise import ( QwenImageEditPlusRoPEInputsStep, QwenImagePrepareLatentsStep, @@ -136,6 +141,14 @@ class QwenImageEditPlusCoreDenoiseStep(SequentialPipelineBlocks): def description(self): return "Core denoising workflow for QwenImage-Edit Plus edit (img2img) task." + @property + def outputs(self): + return [ + OutputParam( + name="latents", type_hint=torch.Tensor, description="The latents generated by the denoising step" + ), + ] + # ==================== # 4. DECODE @@ -179,3 +192,9 @@ class QwenImageEditPlusAutoBlocks(SequentialPipelineBlocks): "- Each image is resized independently based on its own aspect ratio.\n" "- VL encoder uses 384x384 target area, VAE encoder uses 1024x1024 target area." ) + + @property + def outputs(self): + return [ + OutputParam(name="images", type_hint=List[List[PIL.Image.Image]], description="The generated images"), + ] diff --git a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_layered.py b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_layered.py index fe6f756789..63ee36df51 100644 --- a/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_layered.py +++ b/src/diffusers/modular_pipelines/qwenimage/modular_blocks_qwenimage_layered.py @@ -13,9 +13,14 @@ # limitations under the License. +from typing import List + +import PIL.Image +import torch + from ...utils import logging from ..modular_pipeline import SequentialPipelineBlocks -from ..modular_pipeline_utils import InsertableDict +from ..modular_pipeline_utils import InsertableDict, OutputParam from .before_denoise import ( QwenImageLayeredPrepareLatentsStep, QwenImageLayeredRoPEInputsStep, @@ -134,6 +139,14 @@ class QwenImageLayeredCoreDenoiseStep(SequentialPipelineBlocks): def description(self): return "Core denoising workflow for QwenImage-Layered img2img task." + @property + def outputs(self): + return [ + OutputParam( + name="latents", type_hint=torch.Tensor, description="The latents generated by the denoising step" + ), + ] + # ==================== # 4. AUTO BLOCKS & PRESETS @@ -157,3 +170,9 @@ class QwenImageLayeredAutoBlocks(SequentialPipelineBlocks): @property def description(self): return "Auto Modular pipeline for layered denoising tasks using QwenImage-Layered." + + @property + def outputs(self): + return [ + OutputParam(name="images", type_hint=List[List[PIL.Image.Image]], description="The generated images"), + ]