From 567f2bde30479340286511863a412ae5453950f8 Mon Sep 17 00:00:00 2001 From: April-Sonnet <2569381344@qq.com> Date: Mon, 22 Jun 2026 12:12:37 +0800 Subject: [PATCH] Fix typos in comments and docstrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - concating → concatenating - corrct → correct - arbitary → arbitrary - whe → when Signed-off-by: April-Sonnet --- src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py | 2 +- .../pipelines/controlnet/pipeline_controlnet_inpaint.py | 2 +- .../pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py | 2 +- .../controlnet/pipeline_controlnet_union_inpaint_sd_xl.py | 2 +- .../deprecated/paint_by_example/pipeline_paint_by_example.py | 2 +- .../pipelines/easyanimate/pipeline_easyanimate_inpaint.py | 2 +- src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py | 2 +- .../pipelines/flux/pipeline_flux_controlnet_inpainting.py | 2 +- src/diffusers/pipelines/flux/pipeline_flux_inpaint.py | 2 +- src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py | 2 +- src/diffusers/pipelines/ltx2/pipeline_ltx2.py | 2 +- src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py | 2 +- src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py | 2 +- .../pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py | 2 +- src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py | 2 +- src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py | 2 +- .../pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py | 2 +- src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py | 2 +- .../stable_diffusion/pipeline_stable_diffusion_inpaint.py | 2 +- .../stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py | 2 +- .../stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py | 2 +- .../pipelines/visualcloze/pipeline_visualcloze_combined.py | 2 +- .../pipelines/visualcloze/pipeline_visualcloze_generation.py | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py b/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py index b8d41a948207..aa7fa7428572 100644 --- a/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py +++ b/src/diffusers/pipelines/chroma/pipeline_chroma_inpainting.py @@ -703,7 +703,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( masked_image_latents, diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py index d34278d0086b..68e9c8c8dc8f 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py @@ -945,7 +945,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py index f27fcd8aa26f..4ce4f40dc5fa 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py @@ -1035,7 +1035,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py index 511611f036b4..778ba56e22d3 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_union_inpaint_sd_xl.py @@ -1015,7 +1015,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py b/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py index 32529266787f..7861d460b50f 100644 --- a/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py +++ b/src/diffusers/pipelines/deprecated/paint_by_example/pipeline_paint_by_example.py @@ -350,7 +350,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py index 69bb332944d6..3085e63ee6c0 100755 --- a/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py +++ b/src/diffusers/pipelines/easyanimate/pipeline_easyanimate_inpaint.py @@ -681,7 +681,7 @@ def prepare_mask_latents( masked_image_latents = torch.cat(new_mask_pixel_values, dim=0) masked_image_latents = masked_image_latents * self.vae.config.scaling_factor - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) else: masked_image_latents = None diff --git a/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py index cd4ee9fe7611..3ebff683ecbf 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_control_inpaint.py @@ -766,7 +766,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( masked_image_latents, diff --git a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py index eed671152bc9..1c9bf4822426 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py @@ -666,7 +666,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( masked_image_latents, diff --git a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py index 4c35ffefe088..c8c9d03a1c8e 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_inpaint.py @@ -737,7 +737,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( masked_image_latents, diff --git a/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py b/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py index c85299eedcd3..7726b9f8dde0 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py @@ -898,7 +898,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( masked_image_latents, diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2.py index 493db96e48a7..6705ce15b247 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2.py @@ -244,7 +244,7 @@ def __init__( self.vae_temporal_compression_ratio = ( self.vae.temporal_compression_ratio if getattr(self, "vae", None) is not None else 8 ) - # TODO: check whether the MEL compression ratio logic here is corrct + # TODO: check whether the MEL compression ratio logic here is correct self.audio_vae_mel_compression_ratio = ( self.audio_vae.mel_compression_ratio if getattr(self, "audio_vae", None) is not None else 4 ) diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py index ecc89ae79a30..79aa527d856a 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_condition.py @@ -235,7 +235,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 diff --git a/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py b/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py index 1f721bf54364..73a87e7216de 100644 --- a/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py +++ b/src/diffusers/pipelines/ltx2/pipeline_ltx2_image2video.py @@ -247,7 +247,7 @@ def __init__( self.vae_temporal_compression_ratio = ( self.vae.temporal_compression_ratio if getattr(self, "vae", None) is not None else 8 ) - # TODO: check whether the MEL compression ratio logic here is corrct + # TODO: check whether the MEL compression ratio logic here is correct self.audio_vae_mel_compression_ratio = ( self.audio_vae.mel_compression_ratio if getattr(self, "audio_vae", None) is not None else 4 ) diff --git a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py index ebc2e882868c..6c4fb7a209ef 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_controlnet_sd_inpaint.py @@ -896,7 +896,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py index a61b8ec14f08..a555e159d93e 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_inpaint.py @@ -829,7 +829,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py index 7dadbc495a28..5d0c8555811d 100644 --- a/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py +++ b/src/diffusers/pipelines/pag/pipeline_pag_sd_xl_inpaint.py @@ -899,7 +899,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py index 423d0b02219f..20c791d3b000 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_inpaint.py @@ -648,7 +648,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( diff --git a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py index 8045466af2d6..28a496d4bd93 100644 --- a/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py +++ b/src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py @@ -603,7 +603,7 @@ def prepare_mask_latents( ) masked_image_latents = masked_image_latents.repeat(batch_size // masked_image_latents.shape[0], 1, 1, 1, 1) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) masked_image_latents = self._pack_latents( diff --git a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py index 8cc0c2bbea70..17f857b71bfc 100644 --- a/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py @@ -803,7 +803,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py index 321e9f8dd80e..adc5733a9977 100644 --- a/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3_inpaint.py @@ -809,7 +809,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py index 7382d597102c..8f53335ba1ec 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py @@ -899,7 +899,7 @@ def prepare_mask_latents( torch.cat([masked_image_latents] * 2) if do_classifier_free_guidance else masked_image_latents ) - # aligning device to prevent device errors when concating it with the latent model input + # aligning device to prevent device errors when concatenating it with the latent model input masked_image_latents = masked_image_latents.to(device=device, dtype=dtype) return mask, masked_image_latents diff --git a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py index f640fddc2bc5..ec7a85f46673 100644 --- a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py +++ b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_combined.py @@ -223,7 +223,7 @@ def check_inputs( f"got {type(task_prompt)} and {type(content_prompt)}" ) if len(content_prompt) != len(task_prompt): - raise ValueError("`task_prompt` and `content_prompt` must have the same length whe they are lists.") + raise ValueError("`task_prompt` and `content_prompt` must have the same length when they are lists.") for sample in image: if not isinstance(sample, list) or not isinstance(sample[0], list): diff --git a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py index dd5d0603d6d0..bd84adcf6425 100644 --- a/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py +++ b/src/diffusers/pipelines/visualcloze/pipeline_visualcloze_generation.py @@ -443,7 +443,7 @@ def check_inputs( f"got {type(task_prompt)} and {type(content_prompt)}" ) if len(content_prompt) != len(task_prompt): - raise ValueError("`task_prompt` and `content_prompt` must have the same length whe they are lists.") + raise ValueError("`task_prompt` and `content_prompt` must have the same length when they are lists.") for sample in image: if not isinstance(sample, list) or not isinstance(sample[0], list):