fix(wan-vace): size the noise latent for reference images - #59
Merged
Merged
Conversation
ladipobaruwa-fn
force-pushed
the
fix/vace-reference-image-latent-frames
branch
4 times, most recently
from
September 14, 2026 13:07
304eeec to
e51cf37
Compare
ladipobaruwa-fn
marked this pull request as ready for review
September 14, 2026 13:10
ladipobaruwa-fn
force-pushed
the
fix/vace-reference-image-latent-frames
branch
from
September 14, 2026 13:12
e51cf37 to
87424ed
Compare
ladipobaruwa-fn
requested review from
FN-DiogoTeixeira,
alexfoundry and
omkar-foundry
and
a lite review from Copilot
September 15, 2026 09:08
There was a problem hiding this comment.
🟡 Changes recommended
The generator handoff and WAN VACE reference-image documentation updates remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request fixes WAN VACE reference-image latent sizing by aligning noise and control frames, then trimming prepended frames from outputs.
Changes:
- Adds reference-frame noise handling, trimming, and validation.
- Renames the latent preparation hook across drivers and helpers.
- Adds focused tests and updates contributor guidance.
File summaries
| File | Summary |
|---|---|
tests/test_wan_vace_reference_latents.py |
Tests reference latent and conditioning behavior. |
modular_diffusion_nodes_library/parameters/generate_latent_parameters.py |
Updates latent preparation helper naming. |
modular_diffusion_nodes_library/latent_pipeline_drivers/wan_vace.py |
Implements reference latent handling and limits. Moderate (3 votes): reuse the consumed generator for denoising. Nit (3 votes): update WAN VACE reference-image node documentation. |
modular_diffusion_nodes_library/latent_pipeline_drivers/qwen.py |
Updates the preparation hook override. |
modular_diffusion_nodes_library/latent_pipeline_drivers/ltx2.py |
Updates the preparation hook override. |
modular_diffusion_nodes_library/latent_pipeline_drivers/ltx.py |
Updates hook documentation. |
modular_diffusion_nodes_library/latent_pipeline_drivers/flux.py |
Updates the preparation hook override. |
modular_diffusion_nodes_library/latent_pipeline_drivers/base_driver.py |
Renames and invokes the preparation hook. |
docs/adding-new-model.md |
Updates driver contract guidance. |
CLAUDE.md |
Updates repository guidance. |
.github/skills/add-pipeline-variants/SKILL.md |
Updates variant guidance. |
.github/skills/add-modular-pipeline/SKILL.md |
Updates modular pipeline guidance. |
.github/skills/add-modular-pipeline/references/driver-details.md |
Updates driver details and testing guidance. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
VACE prepends one latent frame per reference image to the control branch. The pipeline compensates when sizing the noise latent itself, but the driver always passes an explicit `latents` tensor, which short-circuits that path — leaving the control branch a frame longer than the noise and crashing the transformer on a negative control-padding width. Prepend the matching noise frames on the way in and trim them on the way out, and reject a reference count large enough to indicate a video was connected instead of individual images.
ladipobaruwa-fn
force-pushed
the
fix/vace-reference-image-latent-frames
branch
from
September 15, 2026 11:07
87424ed to
fe00038
Compare
omkar-foundry
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opened by
griptapeops[bot]as a draft starting point. This may not be correct or complete as-is; please review, adjust as needed, and mark ready for review (or close) when you pick up the associated work.What
Prepends one noise latent frame per reference image in
prepare_input_latentand trims them back off inprepare_output_latent, so the VACE noise and control branches carry the same frame count. Also rejects a reference count high enough to mean a video was connected rather than individual images.Why
VACE adds a leading control frame per reference image, and the pipeline only compensates when it sizes the noise latent itself — which this driver bypasses by always passing explicit
latents. The mismatch crashed the transformer on a negative control-padding width, making reference images unusable.Closes #58