Skip to content

Comments

Fix wrong do_classifier_free_guidance threshold in ZImagePipeline#13183

Open
kirillsst wants to merge 1 commit intohuggingface:mainfrom
kirillsst:fix/z-image-guidance-scale-threshold
Open

Fix wrong do_classifier_free_guidance threshold in ZImagePipeline#13183
kirillsst wants to merge 1 commit intohuggingface:mainfrom
kirillsst:fix/z-image-guidance-scale-threshold

Conversation

@kirillsst
Copy link

Summary

  • Z-Image uses a different CFG formula: pred = pos + guidance_scale * (pos - neg), where guidance_scale = 0 corresponds to no guidance
  • The do_classifier_free_guidance property was checking > 1 (standard diffusers convention), but for this formula it should be > 0
  • This caused guidance_scale values between 0 and 1 (e.g. 0.5) to be silently ignored

Fixes #12905

Z-Image uses CFG formula `pred = pos + scale * (pos - neg)` where
`guidance_scale = 0` means no guidance. The threshold should be `> 0`
instead of `> 1` to match this formula.
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.

Wrong Z_Image guidance scale implementation

2 participants