Skip to content

fix: initialize multimodal guider post-hook fallbacks at cfg=1#507

Open
Nianze Wu (wunianze666-netizen) wants to merge 1 commit into
Lightricks:masterfrom
wunianze666-netizen:fix/multimodal-guider-cfg-one-post-hook
Open

fix: initialize multimodal guider post-hook fallbacks at cfg=1#507
Nianze Wu (wunianze666-netizen) wants to merge 1 commit into
Lightricks:masterfrom
wunianze666-netizen:fix/multimodal-guider-cfg-one-post-hook

Conversation

@wunianze666-netizen

Copy link
Copy Markdown

Summary

This PR fixes an uninitialized fallback in MultimodalGuider.predict_noise() when cfg=1 or stg=0 and a sampler post-CFG hook is present.

Problem

oise_pred_neg and
oise_pred_perturbed are only assigned inside the unconditional / perturbed branches, but they are later passed to sampler_post_cfg_function hooks unconditionally. In distilled workflows this can surface as an UnboundLocalError when the negative branch is skipped.

Changes

  • initialize packed
    oise_pred_neg and
    oise_pred_perturbed to
    oise_pred_pos before the optional branches
  • preserve the existing behavior for cases where negative / perturbed predictions are actually computed

Verification

  • python -m py_compile guiders/multimodal_guider.py guiders/parameters.py tricks/nodes/ltx_pag_node.py
  • Not run: there does not appear to be a lightweight local test target for this guider path in the current environment.

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.

1 participant