fix: return 3-tuple from predict_with_cfg use_zero_init early-exit#2011
Open
laurigates wants to merge 1 commit into
Open
fix: return 3-tuple from predict_with_cfg use_zero_init early-exit#2011laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
Conversation
The CFG-Zero* early-exit path returned a 2-tuple while every caller (and every other return in predict_with_cfg) unpacks 3 values: (noise_pred, noise_pred_ovi, cache_state). Workflows that enable both cfg_zero_star and use_zero_init crash on step 0 with "ValueError: not enough values to unpack (expected 3, got 2)". Pass cache_state through unchanged - at the zero-init step there is no cache update to record, so returning the input cache state is the natural identity. Same shape of bug as kijai#1454 (HUMO branch), different code path. Fixes kijai#2010
5 tasks
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.
Fixes #2010.
The CFG-Zero* early-exit in
predict_with_cfgreturned a 2-tuple while every caller (and every other return in the same function) unpacks 3 values:(noise_pred, noise_pred_ovi, cache_state). Workflows that enable bothcfg_zero_staranduse_zero_initonWanVideoExperimentalArgscrash on step 0 with:Same shape of bug as #1454 (HUMO branch), different code path that escaped that fix.
Change
cache_stateis passed through unchanged — at the zero-init step there is no actual cache update to record, so returning the input cache state is the natural identity. I have been running this patch locally on a Wan 2.2 14B I2V workflow withcfg_zero_star=true, use_zero_init=trueand it produces correct output (step 0 noise prediction is zeroed as the CFG-Zero* design intends, subsequent steps proceed normally).Test plan
mainwithWanVideoExperimentalArgs(cfg_zero_star=true, use_zero_init=true)wired intoWanVideoSamplerv2.extra_argsviaWanVideoSamplerExtraArgs.predict_with_cfgare 3-tuples.