Skip to content

fix(comfyui): T2V workflow pairs 14B models with the 5B VAE, breaking every run at VAEDecode#312

Merged
calesthio merged 1 commit into
calesthio:mainfrom
mandaar17:fix/wan22-t2v-vae-mismatch
Jul 6, 2026
Merged

fix(comfyui): T2V workflow pairs 14B models with the 5B VAE, breaking every run at VAEDecode#312
calesthio merged 1 commit into
calesthio:mainfrom
mandaar17:fix/wan22-t2v-vae-mismatch

Conversation

@mandaar17

Copy link
Copy Markdown
Contributor

Problem

The bundled T2V workflow tools/_comfyui/workflows/wan22-t2v-4step.json pairs the WAN 2.2 14B FP8 diffusion models (wan2.2_t2v_high_noise_14B_fp8_scaled.safetensors / wan2.2_t2v_low_noise_14B_fp8_scaled.safetensors) with the wrong VAE: its VAELoader references wan2.2_vae.safetensors, which is the WAN 2.2 5B model's VAE and expects 48-channel latents. The 14B models produce 16-channel latents, so every text-to-video run through this workflow fails at the VAEDecode node.

Repro

  1. Install the models listed in _REQUIRED_MODELS_T2V (tools/video/comfyui_video.py).
  2. Run any T2V generation through comfyui_video (or queue wan22-t2v-4step.json directly in ComfyUI).
  3. Sampling completes, then VAEDecode fails with:
Expected tensor to have size 48 at dimension 1, but got size 16

Fix

  • wan22-t2v-4step.json: vae_namewan_2.1_vae.safetensors, the VAE the WAN 2.2 14B models require. This matches the sibling wan22-i2v-4step.json, which already uses it with the same 14B FP8 model family.
  • tools/video/comfyui_video.py: update _REQUIRED_MODELS_T2V to list wan_2.1_vae.safetensors so the preflight/required-models check matches the VAE the workflow actually loads (previously it would demand a model the workflow no longer uses, and not check for the one it does).

Verified locally: with the corrected VAE, the same workflow decodes and renders T2V output successfully on a RTX 4090.

🤖 Generated with Claude Code

The bundled wan22-t2v-4step.json workflow loads the 14B FP8 diffusion
pair (wan2.2_t2v_high/low_noise_14B_fp8_scaled.safetensors), which
produce 16-channel latents, but its VAELoader referenced
wan2.2_vae.safetensors — the WAN 2.2 5B model's VAE, which expects
48-channel latents. Every T2V run therefore failed at VAEDecode with:

  Expected tensor to have size 48 at dimension 1, but got size 16

Switch the workflow to wan_2.1_vae.safetensors, matching the 14B
models and the sibling wan22-i2v-4step.json, and update the T2V
required-models list in tools/video/comfyui_video.py to match so
preflight checks for the VAE that is actually used.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mandaar17 mandaar17 requested a review from calesthio as a code owner July 6, 2026 17:21

@calesthio calesthio left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix. I reviewed this against docs/PR_REVIEW_GUIDE.md and checked the PR description, changed files, and current review/comment state. The scope is tight: the bundled WAN 2.2 T2V workflow and the required-model preflight list now both reference wan_2.1_vae.safetensors, matching the 14B FP8 model family and the sibling I2V workflow.\n\nValidation run locally on the PR head:\n- python -m py_compile tools/video/comfyui_video.py -> passed\n- JSON/workflow consistency check -> VAELoader node 4 uses wan_2.1_vae.safetensors\n- Required-model consistency check -> tools/video/comfyui_video.py requires wan_2.1_vae.safetensors and no longer requires wan2.2_vae.safetensors\n\nI did not find unrelated scope, dependency, security, or provider-discovery risk in this diff. The live ComfyUI decode path still depends on having the WAN models installed, but the PR author's RTX 4090 verification plus the workflow/preflight alignment are enough for this narrow fix.

@calesthio calesthio merged commit a2652b4 into calesthio:main Jul 6, 2026
1 check 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