Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/diffusers/pipelines/lumina2/pipeline_lumina2.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,12 @@ def __call__(

# 5. Prepare timesteps
sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps) if sigmas is None else sigmas
image_seq_len = latents.shape[1]
# `image_seq_len` is the number of patch tokens the transformer will see, not the
# number of latent channels. Lumina2's latents are unpacked `(B, C, H, W)`, so
# `latents.shape[1]` gives the channel count (typically 16) instead of the post-patch
# sequence length. The transformer patchifies with `config.patch_size` (default 2).
patch_size = self.transformer.config.patch_size
image_seq_len = (latents.shape[-2] // patch_size) * (latents.shape[-1] // patch_size)
mu = calculate_shift(
image_seq_len,
self.scheduler.config.get("base_image_seq_len", 256),
Expand Down
Loading