Skip to content

Conversation

@cesaryuan
Copy link

What does this PR do?

Many classes exhibit the issues present in #4806, but these have not been fixed or reported. This PR attempts to resolve a batch of similar issues.

Fixes all issues like #4806

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@yiyixuxu yiyixuxu requested a review from Copilot October 28, 2025 02:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes type hint inconsistencies across multiple files by updating Tuple type annotations to use variable-length syntax (Tuple[type, ...]) where parameters accept tuples of arbitrary length. This addresses issues similar to #4806 where fixed-length tuple annotations were incorrectly used for parameters that should accept variable-length tuples.

Key changes:

  • Updated type hints from Tuple[str] to Tuple[str, ...] for block type parameters
  • Updated type hints from Tuple[int] to Tuple[int, ...] for channel configuration parameters
  • Fixed one incorrect annotation from Tuple[str] to str for a non-tuple parameter

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/diffusers/pipelines/shap_e/renderer.py Updated tuple type hints for param_names, param_shapes, and background parameters
src/diffusers/pipelines/deprecated/versatile_diffusion/modeling_text_unet.py Fixed type hints for down_block_types, up_block_types, and block_out_channels
src/diffusers/pipelines/audioldm2/modeling_audioldm2.py Updated block type and channel configuration tuple hints
src/diffusers/models/vae_flax.py Fixed type hints across Encoder, Decoder, and AutoencoderKL classes
src/diffusers/models/unets/unet_stable_cascade.py Updated tuple hints for block channels, attention heads, and layer configuration
src/diffusers/models/unets/unet_spatio_temporal_condition.py Fixed block type and configuration parameter type hints
src/diffusers/models/unets/unet_kandinsky3.py Updated block_out_channels type hint
src/diffusers/models/unets/unet_2d_condition.py Fixed type hints in both init and _check_config methods
src/diffusers/models/unets/unet_1d.py Updated block type and channel hints, corrected mid_block_type from Tuple to str
src/diffusers/models/transformers/transformer_wan_vace.py Fixed patch_size type hint
src/diffusers/models/transformers/transformer_wan.py Fixed patch_size type hint
src/diffusers/models/transformers/transformer_skyreels_v2.py Fixed patch_size type hint
src/diffusers/models/transformers/transformer_hunyuanimage.py Updated rope_axes_dim type hint
src/diffusers/models/transformers/transformer_hunyuan_video_framepack.py Updated rope_axes_dim type hint
src/diffusers/models/transformers/transformer_hunyuan_video.py Updated rope_axes_dim type hint
src/diffusers/models/controlnets/controlnet_xs.py Fixed multiple tuple type hints for conditioning and block parameters
src/diffusers/models/autoencoders/autoencoder_kl_wan.py Updated dim_mult type hint and changed default from list to tuple
src/diffusers/models/autoencoders/autoencoder_kl_temporal_decoder.py Fixed block configuration type hints
src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py Updated dim_mult type hint and changed default from list to tuple
src/diffusers/models/autoencoders/autoencoder_kl_mochi.py Fixed encoder and decoder block channel type hints
src/diffusers/models/autoencoders/autoencoder_kl_hunyuanimage_refiner.py Updated block_out_channels type hint
src/diffusers/models/autoencoders/autoencoder_kl_hunyuan_video.py Fixed block_out_channels type hint
src/diffusers/models/autoencoders/autoencoder_kl_cogvideox.py Updated block type and channel configuration hints
src/diffusers/models/autoencoders/autoencoder_kl.py Fixed encoder and decoder block type hints
src/diffusers/models/autoencoders/autoencoder_dc.py Updated multiple tuple hints including qkv_mutliscales, block_out_channels, and layers_per_block
examples/community/pipeline_faithdiff_stable_diffusion_xl.py Fixed block type and channel configuration type hints
examples/community/matryoshka.py Updated type hints in both init and _check_config methods
examples/community/img2img_inpainting.py Fixed paste_offset type hint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yiyixuxu
Copy link
Collaborator

@bot /style

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

Style bot fixed some files and pushed the changes.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants