[Bugfix] Z-Image CFG threshold should be > 0 instead of > 1 (#1634)

Signed-off-by: Lancer <maruixiang6688@gmail.com>
This commit is contained in:
Lancer authored and GitHub committed 2026-03-20 20:13:10 +08:00
1 parent ff254795fa
commit b33d7637de
1 file changed
+3 -3
@@ -305,7 +305,7 @@ class ZImagePipeline(nn.Module, DiffusionPipelineProfilerMixin):
@property
def do_classifier_free_guidance(self):
return self._guidance_scale > 1
return self._guidance_scale > 0
@property
def joint_attention_kwargs(self):
@@ -365,7 +365,7 @@ class ZImagePipeline(nn.Module, DiffusionPipelineProfilerMixin):
Guidance scale as defined in [Classifier-Free Diffusion Guidance](https://arxiv.org/abs/2207.12598).
`guidance_scale` is defined as `w` of equation 2. of [Imagen
Paper](https://arxiv.org/pdf/2205.11487.pdf). Guidance scale is enabled by setting `guidance_scale >
1`. Higher guidance scale encourages to generate images that are closely linked to the text `prompt`,
0`. Higher guidance scale encourages to generate images that are closely linked to the text `prompt`,
usually at the expense of lower image quality.
cfg_normalization (`bool`, *optional*, defaults to False):
Whether to apply configuration normalization.
@@ -374,7 +374,7 @@ class ZImagePipeline(nn.Module, DiffusionPipelineProfilerMixin):
negative_prompt (`str` or `list[str]`, *optional*):
The prompt or prompts not to guide the image generation. If not defined, one has to pass
`negative_prompt_embeds` instead. Ignored when not using guidance (i.e., ignored if `guidance_scale` is
less than `1`).
less than or equal to `0`).
num_images_per_prompt (`int`, *optional*, defaults to 1):
The number of images to generate per prompt.
generator (`torch.Generator` or `list[torch.Generator]`, *optional*):