Skip to content

Commit 9572412

Browse files
committed
add negative_prompt documentation.
1 parent 36acdd7 commit 9572412

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/diffusers/pipelines/flux/pipeline_flux.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,16 @@ def __call__(
665665
instead.
666666
prompt_2 (`str` or `List[str]`, *optional*):
667667
The prompt or prompts to be sent to `tokenizer_2` and `text_encoder_2`. If not defined, `prompt` is
668-
will be used instead
668+
will be used instead.
669+
negative_prompt (`str` or `List[str]`, *optional*):
670+
The prompt or prompts not to guide the image generation. If not defined, one has to pass
671+
`negative_prompt_embeds` instead. Ignored when not using guidance (i.e., ignored if `true_cfg_scale` is
672+
not greater than `1`).
673+
negative_prompt_2 (`str` or `List[str]`, *optional*):
674+
The prompt or prompts not to guide the image generation to be sent to `tokenizer_2` and
675+
`text_encoder_2`. If not defined, `negative_prompt` is used in all the text-encoders.
676+
true_cfg_scale (`float`, *optional*, defaults to 1.0):
677+
When > 1.0 and a provided `negative_prompt`, enables true classifier-free guidance.
669678
height (`int`, *optional*, defaults to self.unet.config.sample_size * self.vae_scale_factor):
670679
The height in pixels of the generated image. This is set to 1024 by default for the best results.
671680
width (`int`, *optional*, defaults to self.unet.config.sample_size * self.vae_scale_factor):
@@ -709,6 +718,14 @@ def __call__(
709718
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of
710719
IP-adapters. Each element should be a tensor of shape `(batch_size, num_images, emb_dim)`. If not
711720
provided, embeddings are computed from the `ip_adapter_image` input argument.
721+
negative_prompt_embeds (`torch.FloatTensor`, *optional*):
722+
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt
723+
weighting. If not provided, negative_prompt_embeds will be generated from `negative_prompt` input
724+
argument.
725+
negative_pooled_prompt_embeds (`torch.FloatTensor`, *optional*):
726+
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt
727+
weighting. If not provided, pooled negative_prompt_embeds will be generated from `negative_prompt`
728+
input argument.
712729
output_type (`str`, *optional*, defaults to `"pil"`):
713730
The output format of the generate image. Choose between
714731
[PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`.

src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def encode_prompt(
383383
negative_prompt_2 (`str` or `List[str]`, *optional*):
384384
The prompt or prompts not to guide the image generation to be sent to `tokenizer_2` and
385385
`text_encoder_2`. If not defined, `negative_prompt` is used in all the text-encoders.
386-
negative_prompt_2 (`str` or `List[str]`, *optional*):
386+
negative_prompt_3 (`str` or `List[str]`, *optional*):
387387
The prompt or prompts not to guide the image generation to be sent to `tokenizer_3` and
388388
`text_encoder_3`. If not defined, `negative_prompt` is used in both text-encoders
389389
prompt_embeds (`torch.FloatTensor`, *optional*):

0 commit comments

Comments
 (0)