[SDXL] Add docs about forcing passed embeddings to be 0 (#4783) · zzmjohn/diffusers@2764db3 · GitHub
Skip to content

Commit 2764db3

Browse files
[SDXL] Add docs about forcing passed embeddings to be 0 (huggingface#4783)
* make style * make style * Apply suggestions from code review Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> * make style --------- Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
1 parent 048d901 commit 2764db3

5 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎src/diffusers/pipelines/controlnet/pipeline_controlnet_sd_xl.py‎

Lines changed: 7 additions & 0 deletions

‎src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ class StableDiffusionXLPipeline(DiffusionPipeline, FromSingleFileMixin, LoraLoad
116116
scheduler ([`SchedulerMixin`]):
117117
A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
118118
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
119+
force_zeros_for_empty_prompt (`bool`, *optional*, defaults to `"True"`):
120+
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
121+
`stabilityai/stable-diffusion-xl-base-1-0`.
122+
add_watermarker (`bool`, *optional*):
123+
Whether to use the [invisible_watermark library](https://github.com/ShieldMnt/invisible-watermark/) to
124+
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
125+
watermarker will be used.
119126
"""
120127

121128
def __init__(

‎src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ class StableDiffusionXLImg2ImgPipeline(DiffusionPipeline, FromSingleFileMixin, L
120120
scheduler ([`SchedulerMixin`]):
121121
A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
122122
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
123+
requires_aesthetics_score (`bool`, *optional*, defaults to `"False"`):
124+
Whether the `unet` requires an `aesthetic_score` condition to be passed during inference. Also see the
125+
config of `stabilityai/stable-diffusion-xl-refiner-1-0`.
126+
force_zeros_for_empty_prompt (`bool`, *optional*, defaults to `"True"`):
127+
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
128+
`stabilityai/stable-diffusion-xl-base-1-0`.
129+
add_watermarker (`bool`, *optional*):
130+
Whether to use the [invisible_watermark library](https://github.com/ShieldMnt/invisible-watermark/) to
131+
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
132+
watermarker will be used.
123133
"""
124134
_optional_components = ["tokenizer", "text_encoder"]
125135

‎src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,16 @@ class StableDiffusionXLInpaintPipeline(DiffusionPipeline, LoraLoaderMixin, FromS
266266
scheduler ([`SchedulerMixin`]):
267267
A scheduler to be used in combination with `unet` to denoise the encoded image latents. Can be one of
268268
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
269+
requires_aesthetics_score (`bool`, *optional*, defaults to `"False"`):
270+
Whether the `unet` requires a aesthetic_score condition to be passed during inference. Also see the config
271+
of `stabilityai/stable-diffusion-xl-refiner-1-0`.
272+
force_zeros_for_empty_prompt (`bool`, *optional*, defaults to `"True"`):
273+
Whether the negative prompt embeddings shall be forced to always be set to 0. Also see the config of
274+
`stabilityai/stable-diffusion-xl-base-1-0`.
275+
add_watermarker (`bool`, *optional*):
276+
Whether to use the [invisible_watermark library](https://github.com/ShieldMnt/invisible-watermark/) to
277+
watermark output images. If not defined, it will default to True if the package is installed, otherwise no
278+
watermarker will be used.
269279
"""
270280
_optional_components = ["tokenizer", "text_encoder"]
271281

‎src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_instruct_pix2pix.py‎

Lines changed: 10 additions & 0 deletions

0 commit comments

Comments
 (0)