Skip to content

Commit 5b53f67

Browse files
authored
[docs] Clarify guidance scale in Qwen pipelines (#12181)
* add clarification regarding guidance_scale in QwenImage * propagate.
1 parent 9918d13 commit 5b53f67

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

docs/source/en/api/pipelines/qwenimage.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ image.save("qwen_fewsteps.png")
8686

8787
</details>
8888

89+
<Tip>
90+
91+
The `guidance_scale` parameter in the pipeline is there to support future guidance-distilled models when they come up. Note that passing `guidance_scale` to the pipeline is ineffective. To enable classifier-free guidance, please pass `true_cfg_scale` and `negative_prompt` (even an empty negative prompt like " ") should enable classifier-free guidance computations.
92+
93+
</Tip>
94+
8995
## QwenImagePipeline
9096

9197
[[autodoc]] QwenImagePipeline

src/diffusers/pipelines/qwenimage/pipeline_qwenimage.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ def __call__(
480480
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
481481
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
482482
the text `prompt`, usually at the expense of lower image quality.
483+
484+
This parameter in the pipeline is there to support future guidance-distilled models when they come up.
485+
Note that passing `guidance_scale` to the pipeline is ineffective. To enable classifier-free guidance,
486+
please pass `true_cfg_scale` and `negative_prompt` (even an empty negative prompt like " ") should
487+
enable classifier-free guidance computations.
483488
num_images_per_prompt (`int`, *optional*, defaults to 1):
484489
The number of images to generate per prompt.
485490
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,11 @@ def __call__(
597597
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
598598
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
599599
the text `prompt`, usually at the expense of lower image quality.
600+
601+
This parameter in the pipeline is there to support future guidance-distilled models when they come up.
602+
Note that passing `guidance_scale` to the pipeline is ineffective. To enable classifier-free guidance,
603+
please pass `true_cfg_scale` and `negative_prompt` (even an empty negative prompt like " ") should
604+
enable classifier-free guidance computations.
600605
num_images_per_prompt (`int`, *optional*, defaults to 1):
601606
The number of images to generate per prompt.
602607
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/qwenimage/pipeline_qwenimage_img2img.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,11 @@ def __call__(
568568
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
569569
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
570570
the text `prompt`, usually at the expense of lower image quality.
571+
572+
This parameter in the pipeline is there to support future guidance-distilled models when they come up.
573+
Note that passing `guidance_scale` to the pipeline is ineffective. To enable classifier-free guidance,
574+
please pass `true_cfg_scale` and `negative_prompt` (even an empty negative prompt like " ") should
575+
enable classifier-free guidance computations.
571576
num_images_per_prompt (`int`, *optional*, defaults to 1):
572577
The number of images to generate per prompt.
573578
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/qwenimage/pipeline_qwenimage_inpaint.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,11 @@ def __call__(
698698
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
699699
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
700700
the text `prompt`, usually at the expense of lower image quality.
701+
702+
This parameter in the pipeline is there to support future guidance-distilled models when they come up.
703+
Note that passing `guidance_scale` to the pipeline is ineffective. To enable classifier-free guidance,
704+
please pass `true_cfg_scale` and `negative_prompt` (even an empty negative prompt like " ") should
705+
enable classifier-free guidance computations.
701706
num_images_per_prompt (`int`, *optional*, defaults to 1):
702707
The number of images to generate per prompt.
703708
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

0 commit comments

Comments
 (0)