From 4ab62e87c36003c2e9d145bf59af5fd441aa8e7e Mon Sep 17 00:00:00 2001 From: Sreekant Baheti <60787859+Sreekant13@users.noreply.github.com> Date: Fri, 24 Jul 2026 16:27:18 -0700 Subject: [PATCH] Fix duplicated words and a misspelling in messages and docstrings Remove accidental repeated words in eight "must have have batch size" error messages raised by the modular pipelines, and in two docstrings ("Dimension to to encode", "image batch to be be inpainted"). Also fix "arbitary" to "arbitrary" in the LTX2 pipeline docstring. Text only, no behavior change. --- src/diffusers/models/unets/unet_spatio_temporal_condition.py | 2 +- src/diffusers/modular_pipelines/anima/before_denoise.py | 4 +--- src/diffusers/modular_pipelines/flux/before_denoise.py | 2 +- src/diffusers/modular_pipelines/helios/before_denoise.py | 4 +--- src/diffusers/modular_pipelines/qwenimage/before_denoise.py | 2 +- src/diffusers/modular_pipelines/qwenimage/inputs.py | 4 +--- src/diffusers/modular_pipelines/stable_diffusion_3/inputs.py | 4 +--- src/diffusers/modular_pipelines/wan/before_denoise.py | 4 +--- src/diffusers/modular_pipelines/z_image/before_denoise.py | 4 +--- src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py | 2 +- src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py | 2 +- 11 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/diffusers/models/unets/unet_spatio_temporal_condition.py b/src/diffusers/models/unets/unet_spatio_temporal_condition.py index d38be0b0675f..7d6b861df82b 100644 --- a/src/diffusers/models/unets/unet_spatio_temporal_condition.py +++ b/src/diffusers/models/unets/unet_spatio_temporal_condition.py @@ -50,7 +50,7 @@ class UNetSpatioTemporalConditionModel(ModelMixin, AttentionMixin, ConfigMixin, block_out_channels (`tuple[int]`, *optional*, defaults to `(320, 640, 1280, 1280)`): The tuple of output channels for each block. addition_time_embed_dim: (`int`, defaults to 256): - Dimension to to encode the additional time ids. + Dimension to encode the additional time ids. projection_class_embeddings_input_dim (`int`, defaults to 768): The dimension of the projection of encoded `added_time_ids`. layers_per_block (`int`, *optional*, defaults to 2): The number of layers per block. diff --git a/src/diffusers/modular_pipelines/anima/before_denoise.py b/src/diffusers/modular_pipelines/anima/before_denoise.py index dbfe82d7f35d..ede832c9d80b 100644 --- a/src/diffusers/modular_pipelines/anima/before_denoise.py +++ b/src/diffusers/modular_pipelines/anima/before_denoise.py @@ -108,9 +108,7 @@ def repeat_tensor_to_batch_size( elif input_tensor.shape[0] == batch_size: repeat_by = num_images_per_prompt else: - raise ValueError( - f"`{input_name}` must have have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}" - ) + raise ValueError(f"`{input_name}` must have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}") # expand the tensor to match the batch_size * num_images_per_prompt input_tensor = input_tensor.repeat_interleave(repeat_by, dim=0) diff --git a/src/diffusers/modular_pipelines/flux/before_denoise.py b/src/diffusers/modular_pipelines/flux/before_denoise.py index 2d41cd76cd93..243f9e927d74 100644 --- a/src/diffusers/modular_pipelines/flux/before_denoise.py +++ b/src/diffusers/modular_pipelines/flux/before_denoise.py @@ -470,7 +470,7 @@ def intermediate_outputs(self) -> list[OutputParam]: def check_inputs(image_latents, latents): if image_latents.shape[0] != latents.shape[0]: raise ValueError( - f"`image_latents` must have have same batch size as `latents`, but got {image_latents.shape[0]} and {latents.shape[0]}" + f"`image_latents` must have same batch size as `latents`, but got {image_latents.shape[0]} and {latents.shape[0]}" ) if image_latents.ndim != 3: diff --git a/src/diffusers/modular_pipelines/helios/before_denoise.py b/src/diffusers/modular_pipelines/helios/before_denoise.py index 64407db63cca..593843d48272 100644 --- a/src/diffusers/modular_pipelines/helios/before_denoise.py +++ b/src/diffusers/modular_pipelines/helios/before_denoise.py @@ -167,9 +167,7 @@ def repeat_tensor_to_batch_size( elif input_tensor.shape[0] == batch_size: repeat_by = num_videos_per_prompt else: - raise ValueError( - f"`{input_name}` must have have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}" - ) + raise ValueError(f"`{input_name}` must have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}") # expand the tensor to match the batch_size * num_videos_per_prompt input_tensor = input_tensor.repeat_interleave(repeat_by, dim=0) diff --git a/src/diffusers/modular_pipelines/qwenimage/before_denoise.py b/src/diffusers/modular_pipelines/qwenimage/before_denoise.py index 51b5c6ac8c3d..b928bf7fce9e 100644 --- a/src/diffusers/modular_pipelines/qwenimage/before_denoise.py +++ b/src/diffusers/modular_pipelines/qwenimage/before_denoise.py @@ -426,7 +426,7 @@ def intermediate_outputs(self) -> list[OutputParam]: def check_inputs(image_latents, latents): if image_latents.shape[0] != latents.shape[0]: raise ValueError( - f"`image_latents` must have have same batch size as `latents`, but got {image_latents.shape[0]} and {latents.shape[0]}" + f"`image_latents` must have same batch size as `latents`, but got {image_latents.shape[0]} and {latents.shape[0]}" ) if image_latents.ndim != 3: diff --git a/src/diffusers/modular_pipelines/qwenimage/inputs.py b/src/diffusers/modular_pipelines/qwenimage/inputs.py index faec7db245df..38a49e07345f 100644 --- a/src/diffusers/modular_pipelines/qwenimage/inputs.py +++ b/src/diffusers/modular_pipelines/qwenimage/inputs.py @@ -67,9 +67,7 @@ def repeat_tensor_to_batch_size( elif input_tensor.shape[0] == batch_size: repeat_by = num_images_per_prompt else: - raise ValueError( - f"`{input_name}` must have have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}" - ) + raise ValueError(f"`{input_name}` must have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}") # expand the tensor to match the batch_size * num_images_per_prompt input_tensor = input_tensor.repeat_interleave(repeat_by, dim=0) diff --git a/src/diffusers/modular_pipelines/stable_diffusion_3/inputs.py b/src/diffusers/modular_pipelines/stable_diffusion_3/inputs.py index 401ff2db5c61..d7e88b571612 100644 --- a/src/diffusers/modular_pipelines/stable_diffusion_3/inputs.py +++ b/src/diffusers/modular_pipelines/stable_diffusion_3/inputs.py @@ -70,9 +70,7 @@ def repeat_tensor_to_batch_size( elif input_tensor.shape[0] == batch_size: repeat_by = num_images_per_prompt else: - raise ValueError( - f"`{input_name}` must have have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}" - ) + raise ValueError(f"`{input_name}` must have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}") # expand the tensor to match the batch_size * num_images_per_prompt input_tensor = input_tensor.repeat_interleave(repeat_by, dim=0) diff --git a/src/diffusers/modular_pipelines/wan/before_denoise.py b/src/diffusers/modular_pipelines/wan/before_denoise.py index 6b0874037b0d..a737f9811cda 100644 --- a/src/diffusers/modular_pipelines/wan/before_denoise.py +++ b/src/diffusers/modular_pipelines/wan/before_denoise.py @@ -80,9 +80,7 @@ def repeat_tensor_to_batch_size( elif input_tensor.shape[0] == batch_size: repeat_by = num_videos_per_prompt else: - raise ValueError( - f"`{input_name}` must have have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}" - ) + raise ValueError(f"`{input_name}` must have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}") # expand the tensor to match the batch_size * num_videos_per_prompt input_tensor = input_tensor.repeat_interleave(repeat_by, dim=0) diff --git a/src/diffusers/modular_pipelines/z_image/before_denoise.py b/src/diffusers/modular_pipelines/z_image/before_denoise.py index 9b6c1976a1bf..aa32debb2306 100644 --- a/src/diffusers/modular_pipelines/z_image/before_denoise.py +++ b/src/diffusers/modular_pipelines/z_image/before_denoise.py @@ -80,9 +80,7 @@ def repeat_tensor_to_batch_size( elif input_tensor.shape[0] == batch_size: repeat_by = num_images_per_prompt else: - raise ValueError( - f"`{input_name}` must have have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}" - ) + raise ValueError(f"`{input_name}` must have batch size 1 or {batch_size}, but got {input_tensor.shape[0]}") # expand the tensor to match the batch_size * num_images_per_prompt input_tensor = input_tensor.repeat_interleave(repeat_by, dim=0) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py index 9a79aafd8760..a77c60e6dbc5 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py @@ -923,7 +923,7 @@ def __call__( Args: image (`torch.Tensor`, `PIL.Image.Image`, `np.ndarray`, `list[torch.Tensor]`, `list[PIL.Image.Image]`, or `list[np.ndarray]`): - `Image`, numpy array or tensor representing an image batch to be be inpainted (which parts of the image + `Image`, numpy array or tensor representing an image batch to be inpainted (which parts of the image to be masked out with `mask_image` and repainted according to `prompt` and `image_reference`). For both numpy array and pytorch tensor, the expected value range is between `[0, 1]` If it's a tensor or a list or tensors, the expected shape should be `(B, C, H, W)` or `(C, H, W)`. If it is a numpy array or a diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py index 2947ad9cbabe..bd2ee3ec6708 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py @@ -262,7 +262,7 @@ def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0): class LTX2ConditionPipeline(DiffusionPipeline, FromSingleFileMixin, LTX2LoraLoaderMixin): r""" - Pipeline for video generation which allows image conditions to be inserted at arbitary parts of the video. + Pipeline for video generation which allows image conditions to be inserted at arbitrary parts of the video. Reference: https://github.com/Lightricks/LTX-Video