Skip to content

Conversation

@yiyixuxu
Copy link
Collaborator

@yiyixuxu yiyixuxu commented Jan 9, 2026

No description provided.

)

@property
def outputs(self):
Copy link
Collaborator Author

@yiyixuxu yiyixuxu Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the outputs property is only used for auto docstring rendering,
by default outputs is same as intermediate_outputs https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/modular_pipeline.py#L298
we can override here for better docstring

for example, if we want to print out the doc string for the denoise block for qwen layer model

from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained("Qwen/Qwen-Image-Layered")
print(pipe.blocks.sub_blocks["denoise"].doc)

on main it shows

class QwenImageLayeredCoreDenoiseStep

  Core denoising workflow for QwenImage-Layered img2img task.

  Components:

      pachifier (`QwenImageLayeredPachifier`) [subfolder=]

      scheduler (`FlowMatchEulerDiscreteScheduler`) [subfolder=]

      guider (`ClassifierFreeGuidance`) [subfolder=]

      transformer (`QwenImageTransformer2DModel`) [subfolder=]

  Inputs:

      num_images_per_prompt (`None`, *optional*, defaults to 1):

      prompt_embeds (`None`):

      prompt_embeds_mask (`None`):

      negative_prompt_embeds (`None`, *optional*):

      negative_prompt_embeds_mask (`None`, *optional*):

      image_latents (`None`, *optional*):

      latents (`None`, *optional*):

      layers (`None`, *optional*, defaults to 4):

      generator (`None`, *optional*):

      num_inference_steps (`int`, *optional*, defaults to 50):

      sigmas (`List`, *optional*):

      attention_kwargs (`None`, *optional*):

      **denoiser_input_fields (`None`, *optional*):
          conditional model inputs for the denoiser: e.g. prompt_embeds, negative_prompt_embeds, etc.

  Outputs:

      batch_size (`int`):
          Number of prompts, the final batch size of model inputs should be batch_size * num_images_per_prompt

      dtype (`dtype`):
          Data type of model tensor inputs (determined by `prompt_embeds`)

      image_height (`int`):
          The image height calculated from the image latents dimension

      image_width (`int`):
          The image width calculated from the image latents dimension

      height (`int`):
          The height of the image output

      width (`int`):
          The width of the image output

      latents (`Tensor`):
          The initial latents to use for the denoising process

      timesteps (`Tensor`):

      img_shapes (`List`):
          The shapes of the image latents, used for RoPE calculation

      txt_seq_lens (`List`):
          The sequence lengths of the prompt embeds, used for RoPE calculation

      negative_txt_seq_lens (`List`):
          The sequence lengths of the negative prompt embeds, used for RoPE calculation

      additional_t_cond (`Tensor`):
          The additional t cond, used for RoPE calculation

with this change, in this PR branch

class QwenImageLayeredCoreDenoiseStep

  Core denoising workflow for QwenImage-Layered img2img task.

  Components:

      pachifier (`QwenImageLayeredPachifier`) [subfolder=]

      scheduler (`FlowMatchEulerDiscreteScheduler`) [subfolder=]

      guider (`ClassifierFreeGuidance`) [subfolder=]

      transformer (`QwenImageTransformer2DModel`) [subfolder=]

  Inputs:

      num_images_per_prompt (`None`, *optional*, defaults to 1):

      prompt_embeds (`None`):

      prompt_embeds_mask (`None`):

      negative_prompt_embeds (`None`, *optional*):

      negative_prompt_embeds_mask (`None`, *optional*):

      image_latents (`None`, *optional*):

      latents (`None`, *optional*):

      layers (`None`, *optional*, defaults to 4):

      generator (`None`, *optional*):

      num_inference_steps (`int`, *optional*, defaults to 50):

      sigmas (`List`, *optional*):

      attention_kwargs (`None`, *optional*):

      **denoiser_input_fields (`None`, *optional*):
          conditional model inputs for the denoiser: e.g. prompt_embeds, negative_prompt_embeds, etc.

  Outputs:

      latents (`Tensor`):
          The latents generated by the denoising step

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yiyixuxu yiyixuxu requested review from DN6 and sayakpaul January 9, 2026 10:38
@yiyixuxu yiyixuxu merged commit 418313b into main Jan 10, 2026
13 of 15 checks passed
@yiyixuxu yiyixuxu deleted the modular-qwen-add-outputs branch January 10, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants