Skip to content

Commit d146f12

Browse files
committed
update guidance_scale docstring for guidance_distilled models.
1 parent b73c738 commit d146f12

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed

src/diffusers/pipelines/flux/pipeline_flux.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,11 @@ def __call__(
691691
Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
692692
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
693693
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
694-
the text `prompt`, usually at the expense of lower image quality.
694+
the text `prompt`, usually at the expense of lower image quality. In case of Flux, which is a guidance-
695+
distilled model, `guidance_scale > 1` doesn't implement true classifier-free guidance. Specifying
696+
`guidance_scale > 1` just mimics it. In case of Flux, which is a guidance- distilled model,
697+
`guidance_scale > 1` doesn't implement true classifier-free guidance. Specifying `guidance_scale > 1`
698+
just mimics it.
695699
num_images_per_prompt (`int`, *optional*, defaults to 1):
696700
The number of images to generate per prompt.
697701
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/flux/pipeline_flux_control.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,9 @@ def __call__(
665665
Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
666666
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
667667
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
668-
the text `prompt`, usually at the expense of lower image quality.
668+
the text `prompt`, usually at the expense of lower image quality. In case of Flux, which is a guidance-
669+
distilled model, `guidance_scale > 1` doesn't implement true classifier-free guidance. Specifying
670+
`guidance_scale > 1` just mimics it.
669671
num_images_per_prompt (`int`, *optional*, defaults to 1):
670672
The number of images to generate per prompt.
671673
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/flux/pipeline_flux_kontext.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,9 @@ def __call__(
799799
Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
800800
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
801801
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
802-
the text `prompt`, usually at the expense of lower image quality.
802+
the text `prompt`, usually at the expense of lower image quality. In case of Flux, which is a guidance-
803+
distilled model, `guidance_scale > 1` doesn't implement true classifier-free guidance. Specifying
804+
`guidance_scale > 1` just mimics it.
803805
num_images_per_prompt (`int`, *optional*, defaults to 1):
804806
The number of images to generate per prompt.
805807
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/flux/pipeline_flux_kontext_inpaint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,9 @@ def __call__(
10191019
Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
10201020
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
10211021
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
1022-
the text `prompt`, usually at the expense of lower image quality.
1022+
the text `prompt`, usually at the expense of lower image quality. In case of Flux, which is a guidance-
1023+
distilled model, `guidance_scale > 1` doesn't implement true classifier-free guidance. Specifying
1024+
`guidance_scale > 1` just mimics it.
10231025
num_images_per_prompt (`int`, *optional*, defaults to 1):
10241026
The number of images to generate per prompt.
10251027
generator (`torch.Generator` or `List[torch.Generator]`, *optional*):

src/diffusers/pipelines/sana/pipeline_sana_sprint.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,13 @@ def __call__(
643643
in their `set_timesteps` method. If not defined, the default behavior when `num_inference_steps` is
644644
passed will be used. Must be in descending order.
645645
guidance_scale (`float`, *optional*, defaults to 4.5):
646-
Guidance scale as defined in [Classifier-Free Diffusion
647-
Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of equation 2.
648-
of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by setting
649-
`guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely linked to
650-
the text `prompt`, usually at the expense of lower image quality.
646+
Guidance scale as defined in [Classifier-Free Diffusion Guidance scale as defined in [Classifier-Free
647+
Diffusion Guidance](https://huggingface.co/papers/2207.12598). `guidance_scale` is defined as `w` of
648+
equation 2. of [Imagen Paper](https://huggingface.co/papers/2205.11487). Guidance scale is enabled by
649+
setting `guidance_scale > 1`. Higher guidance scale encourages to generate images that are closely
650+
linked to the text `prompt`, usually at the expense of lower image quality. In case of Flux, which is a
651+
guidance- distilled model, `guidance_scale > 1` doesn't implement true classifier-free guidance.
652+
Specifying `guidance_scale > 1` just mimics it.
651653
num_images_per_prompt (`int`, *optional*, defaults to 1):
652654
The number of images to generate per prompt.
653655
height (`int`, *optional*, defaults to self.unet.config.sample_size):

0 commit comments

Comments
 (0)