Skip to content

Commit 97c2c6e

Browse files
kirillsstHezlich2
andauthored
Fix wrong do_classifier_free_guidance threshold in ZImagePipeline (#13183)
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. Co-authored-by: Hezlich2 <typretypre@gmail.com>
1 parent 212db7b commit 97c2c6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/pipelines/z_image/pipeline_z_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def guidance_scale(self):
276276

277277
@property
278278
def do_classifier_free_guidance(self):
279-
return self._guidance_scale > 1
279+
return self._guidance_scale > 0
280280

281281
@property
282282
def joint_attention_kwargs(self):

0 commit comments

Comments
 (0)