Skip to content

wan: vae: Fix light/color issue#13101

Merged
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
rattus128:prs/wan-vae-lighting-issue
Mar 21, 2026
Merged

wan: vae: Fix light/color issue#13101
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
rattus128:prs/wan-vae-lighting-issue

Conversation

@rattus128
Copy link
Copy Markdown
Contributor

#13090

There was an issue where the resample split was too early and dropped one of the rolling convolutions a frame early. This is most noticable as a lighting/color change between pixel frames 5->6 (latent 2->3), or as a lighting change between the first and last frame in an FLF wan flow.

Example test case:

WAN2.2 FLF 640x640x81f
Same image F&L

image

Before:

Screencast.from.2026-03-22.08-25-24.webm

After:

Screencast.from.2026-03-22.08-30-19.webm

VRAM consumption checked as still lower than 17.x ✅

Regression Tests:
WAN 2.2 I2V ✅
WAN 2.2 T2V ✅

There was an issue where the resample split was too early and dropped one
of the rolling convolutions a frame early. This is most noticable as a
lighting/color change between pixel frames 5->6 (latent 2->3), or as a
lighting change between the first and last frame in an FLF wan flow.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7607fef4-7795-43b9-a95b-a10c8b20de4a

📥 Commits

Reviewing files that changed from the base of the PR and between 11c15d8 and 182e0ba.

📒 Files selected for processing (1)
  • comfy/ldm/wan/vae.py

📝 Walkthrough

Walkthrough

The Decoder3d.run_up method in the VAE module was refactored to change the handling of Resample layers with mode == 'upsample3d'. The layer is now applied to the input before branching on the upsample3d condition. The threshold for triggering upsample3d processing changed from x.shape[2] > 1 to x.shape[2] > 2, and the slicing strategy shifted from per-frame chunks of length 1 to chunks of length 2. Additionally, the recursive call now increments layer_idx instead of preserving it.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'wan: vae: Fix light/color issue' is directly related to the changeset, which fixes a lighting/color issue in the WAN VAE decoder by adjusting the resample split timing.
Description check ✅ Passed The description clearly explains the issue (resample split too early, dropping rolling convolutions prematurely) and provides concrete test cases with before/after evidence and regression test results.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@comfyanonymous comfyanonymous merged commit 25b6d1d into Comfy-Org:master Mar 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants