From 01efd78ec7bfa17ec778e0df0940a8a0a493cd6c Mon Sep 17 00:00:00 2001 From: iridescentWen Date: Tue, 8 Sep 2026 11:14:05 +0800 Subject: [PATCH 1/2] docs: fix two docstrings that reference names the code does not have - transformer_ltx2.py:1449 says `peturbation_mask`; the parameter is `perturbation_mask`, spelled correctly at :253, :273, :314, :316, :623. - pipeline_stable_diffusion_diffedit.py:885,:888 point at `source_image`, but generate_mask's image argument is `image`. Fixes #14732 Co-Authored-By: Claude Opus 5 (1M context) --- src/diffusers/models/transformers/transformer_ltx2.py | 2 +- .../pipeline_stable_diffusion_diffedit.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diffusers/models/transformers/transformer_ltx2.py b/src/diffusers/models/transformers/transformer_ltx2.py index 755080198a7f..e5462e4b047a 100644 --- a/src/diffusers/models/transformers/transformer_ltx2.py +++ b/src/diffusers/models/transformers/transformer_ltx2.py @@ -1446,7 +1446,7 @@ def forward( (SDPA) operation. If `None` or empty, STG will not be applied to any block. perturbation_mask (`torch.Tensor`, *optional*): Perturbation mask for STG of shape `(batch_size,)` or `(batch_size, 1, 1)`. Should be 0 at batch - elements where STG should be applied and 1 elsewhere. If STG is being used but `peturbation_mask` is + elements where STG should be applied and 1 elsewhere. If STG is being used but `perturbation_mask` is not supplied, will default to applying STG (perturbing) all batch elements. use_cross_timestep (`bool` *optional*, defaults to `False`): Whether to use the cross modality (audio is the cross modality of video, and vice versa) sigma when diff --git a/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py b/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py index ee8675678f2d..bd76de9464e1 100644 --- a/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py +++ b/src/diffusers/pipelines/deprecated/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py @@ -882,10 +882,10 @@ def generate_mask( not provided, `negative_prompt_embeds` are generated from the `negative_prompt` input argument. source_prompt (`str` or `list[str]`, *optional*): The prompt or prompts to guide semantic mask generation using DiffEdit. If not defined, you need to - pass `source_prompt_embeds` or `source_image` instead. + pass `source_prompt_embeds` or `image` instead. source_negative_prompt (`str` or `list[str]`, *optional*): The prompt or prompts to guide semantic mask generation away from using DiffEdit. If not defined, you - need to pass `source_negative_prompt_embeds` or `source_image` instead. + need to pass `source_negative_prompt_embeds` or `image` instead. source_prompt_embeds (`torch.Tensor`, *optional*): Pre-generated text embeddings to guide the semantic mask generation. Can be used to easily tweak text inputs (prompt weighting). If not provided, text embeddings are generated from `source_prompt` input From 68c7626fab55a304e5fc75efa96bad678a58b2ac Mon Sep 17 00:00:00 2001 From: iridescentWen Date: Mon, 14 Sep 2026 10:35:12 +0800 Subject: [PATCH 2/2] docs: fix three renamed parameters left stale in docstrings Each documents a name the signature no longer has: - optimization.py:161 num_periods -> num_cycles - autoencoder_kl_ltx2.py:43 dim -> channel_dim - z_image/before_denoise.py:100 vae_scale_factor -> vae_scale_factor_spatial Co-Authored-By: Claude Opus 5 (1M context) --- src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py | 2 +- src/diffusers/modular_pipelines/z_image/before_denoise.py | 2 +- src/diffusers/optimization.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py b/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py index 959a9fdb9e11..e64a9347f63d 100644 --- a/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py +++ b/src/diffusers/models/autoencoders/autoencoder_kl_ltx2.py @@ -40,7 +40,7 @@ class PerChannelRMSNorm(nn.Module): def __init__(self, channel_dim: int = 1, eps: float = 1e-8) -> None: """ Args: - dim: Dimension along which to compute the RMS (typically channels). + channel_dim: Dimension along which to compute the RMS (typically channels). eps: Small constant added for numerical stability. """ super().__init__() diff --git a/src/diffusers/modular_pipelines/z_image/before_denoise.py b/src/diffusers/modular_pipelines/z_image/before_denoise.py index aa32debb2306..5216529d460f 100644 --- a/src/diffusers/modular_pipelines/z_image/before_denoise.py +++ b/src/diffusers/modular_pipelines/z_image/before_denoise.py @@ -97,7 +97,7 @@ def calculate_dimension_from_latents(latents: torch.Tensor, vae_scale_factor_spa Args: latents (torch.Tensor): The latent tensor. Must have 4 dimensions. Expected shapes: [batch, channels, height, width] - vae_scale_factor (int): The scale factor used by the VAE to compress image spatial dimension. + vae_scale_factor_spatial (int): The scale factor used by the VAE to compress image spatial dimension. By default, it is 16 Returns: tuple[int, int]: The calculated image dimensions as (height, width) diff --git a/src/diffusers/optimization.py b/src/diffusers/optimization.py index a4b03bf469e4..2e3ce9639bbb 100644 --- a/src/diffusers/optimization.py +++ b/src/diffusers/optimization.py @@ -173,7 +173,7 @@ def get_cosine_schedule_with_warmup( The number of steps for the warmup phase. num_training_steps (`int`): The total number of training steps. - num_periods (`float`, *optional*, defaults to 0.5): + num_cycles (`float`, *optional*, defaults to 0.5): The number of periods of the cosine function in a schedule (the default is to just decrease from the max value to 0 following a half-cosine). last_epoch (`int`, *optional*, defaults to -1):