ComfyUI/comfy/ldm/lumina
bigjimmy f5bf7ed4d3 fix: pad reference latents to patch size in embed_all
When a reference image is passed via TextEncodeZImageOmni, its VAE-encoded
latent may have odd height or width (e.g. from auto_resize rounding to
multiples of 8 pixels). The embed_all() function in the Lumina model tries
to reshape the latent as view(B, C, H//2, 2, W//2, 2) for patch embedding,
which fails when H or W is not divisible by the patch size (2).

Add pad_to_patch_size() before the reshape, matching what the main forward
pass already does for the primary latent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 22:44:47 +08:00
..
controlnet.py Basic implementation of z image fun control union 2.0 (#11304) 2025-12-13 01:39:11 -05:00
model.py fix: pad reference latents to patch size in embed_all 2026-03-01 22:44:47 +08:00