Skip to content

Commit 661bde0

Browse files
authored
Fix style (#10478)
fix
1 parent 4f5e3e3 commit 661bde0

28 files changed

+69
-57
lines changed

Diff for: scripts/convert_blipdiffusion_to_diffusers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ def save_blip_diffusion_model(model, args):
303303
qformer = get_qformer(model)
304304
qformer.eval()
305305

306-
text_encoder = ContextCLIPTextModel.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", subfolder="text_encoder")
306+
text_encoder = ContextCLIPTextModel.from_pretrained(
307+
"stable-diffusion-v1-5/stable-diffusion-v1-5", subfolder="text_encoder"
308+
)
307309
vae = AutoencoderKL.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", subfolder="vae")
308310
unet = UNet2DConditionModel.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", subfolder="unet")
309311
vae.eval()

Diff for: src/diffusers/pipelines/controlnet/pipeline_controlnet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ class StableDiffusionControlNetPipeline(
198198
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
199199
safety_checker ([`StableDiffusionSafetyChecker`]):
200200
Classification module that estimates whether generated images could be considered offensive or harmful.
201-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
202-
about a model's potential harms.
201+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
202+
more details about a model's potential harms.
203203
feature_extractor ([`~transformers.CLIPImageProcessor`]):
204204
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
205205
"""

Diff for: src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ class StableDiffusionControlNetImg2ImgPipeline(
168168
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
169169
safety_checker ([`StableDiffusionSafetyChecker`]):
170170
Classification module that estimates whether generated images could be considered offensive or harmful.
171-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
172-
about a model's potential harms.
171+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
172+
more details about a model's potential harms.
173173
feature_extractor ([`~transformers.CLIPImageProcessor`]):
174174
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
175175
"""

Diff for: src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ class StableDiffusionControlNetInpaintPipeline(
141141
<Tip>
142142
143143
This pipeline can be used with checkpoints that have been specifically fine-tuned for inpainting
144-
([stable-diffusion-v1-5/stable-diffusion-inpainting](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-inpainting)) as well as
145-
default text-to-image Stable Diffusion checkpoints
146-
([stable-diffusion-v1-5/stable-diffusion-v1-5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5)). Default text-to-image
147-
Stable Diffusion checkpoints might be preferable for ControlNets that have been fine-tuned on those, such as
148-
[lllyasviel/control_v11p_sd15_inpaint](https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint).
144+
([stable-diffusion-v1-5/stable-diffusion-inpainting](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-inpainting))
145+
as well as default text-to-image Stable Diffusion checkpoints
146+
([stable-diffusion-v1-5/stable-diffusion-v1-5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5)).
147+
Default text-to-image Stable Diffusion checkpoints might be preferable for ControlNets that have been fine-tuned on
148+
those, such as [lllyasviel/control_v11p_sd15_inpaint](https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint).
149149
150150
</Tip>
151151
@@ -167,8 +167,8 @@ class StableDiffusionControlNetInpaintPipeline(
167167
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
168168
safety_checker ([`StableDiffusionSafetyChecker`]):
169169
Classification module that estimates whether generated images could be considered offensive or harmful.
170-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
171-
about a model's potential harms.
170+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
171+
more details about a model's potential harms.
172172
feature_extractor ([`~transformers.CLIPImageProcessor`]):
173173
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
174174
"""

Diff for: src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@
7575
... "lllyasviel/sd-controlnet-canny", from_pt=True, dtype=jnp.float32
7676
... )
7777
>>> pipe, params = FlaxStableDiffusionControlNetPipeline.from_pretrained(
78-
... "stable-diffusion-v1-5/stable-diffusion-v1-5", controlnet=controlnet, revision="flax", dtype=jnp.float32
78+
... "stable-diffusion-v1-5/stable-diffusion-v1-5",
79+
... controlnet=controlnet,
80+
... revision="flax",
81+
... dtype=jnp.float32,
7982
... )
8083
>>> params["controlnet"] = controlnet_params
8184
@@ -132,8 +135,8 @@ class FlaxStableDiffusionControlNetPipeline(FlaxDiffusionPipeline):
132135
[`FlaxDPMSolverMultistepScheduler`].
133136
safety_checker ([`FlaxStableDiffusionSafetyChecker`]):
134137
Classification module that estimates whether generated images could be considered offensive or harmful.
135-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
136-
about a model's potential harms.
138+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
139+
more details about a model's potential harms.
137140
feature_extractor ([`~transformers.CLIPImageProcessor`]):
138141
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
139142
"""

Diff for: src/diffusers/pipelines/pipeline_flax_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
244244
pretrained_model_name_or_path (`str` or `os.PathLike`, *optional*):
245245
Can be either:
246246
247-
- A string, the *repo id* (for example `stable-diffusion-v1-5/stable-diffusion-v1-5`) of a pretrained pipeline
248-
hosted on the Hub.
247+
- A string, the *repo id* (for example `stable-diffusion-v1-5/stable-diffusion-v1-5`) of a
248+
pretrained pipeline hosted on the Hub.
249249
- A path to a *directory* (for example `./my_model_directory`) containing the model weights saved
250250
using [`~FlaxDiffusionPipeline.save_pretrained`].
251251
dtype (`str` or `jnp.dtype`, *optional*):

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ class FlaxStableDiffusionPipeline(FlaxDiffusionPipeline):
100100
[`FlaxDPMSolverMultistepScheduler`].
101101
safety_checker ([`FlaxStableDiffusionSafetyChecker`]):
102102
Classification module that estimates whether generated images could be considered offensive or harmful.
103-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
104-
about a model's potential harms.
103+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
104+
more details about a model's potential harms.
105105
feature_extractor ([`~transformers.CLIPImageProcessor`]):
106106
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
107107
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ class FlaxStableDiffusionImg2ImgPipeline(FlaxDiffusionPipeline):
124124
[`FlaxDPMSolverMultistepScheduler`].
125125
safety_checker ([`FlaxStableDiffusionSafetyChecker`]):
126126
Classification module that estimates whether generated images could be considered offensive or harmful.
127-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
128-
about a model's potential harms.
127+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
128+
more details about a model's potential harms.
129129
feature_extractor ([`~transformers.CLIPImageProcessor`]):
130130
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
131131
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class FlaxStableDiffusionInpaintPipeline(FlaxDiffusionPipeline):
127127
[`FlaxDPMSolverMultistepScheduler`].
128128
safety_checker ([`FlaxStableDiffusionSafetyChecker`]):
129129
Classification module that estimates whether generated images could be considered offensive or harmful.
130-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
131-
about a model's potential harms.
130+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
131+
more details about a model's potential harms.
132132
feature_extractor ([`~transformers.CLIPImageProcessor`]):
133133
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
134134
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
7878
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
7979
safety_checker ([`StableDiffusionSafetyChecker`]):
8080
Classification module that estimates whether generated images could be considered offensive or harmful.
81-
Please, refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for details.
81+
Please, refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
82+
details.
8283
feature_extractor ([`CLIPImageProcessor`]):
8384
Model that extracts features from generated images to be used as inputs for the `safety_checker`.
8485
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class OnnxStableDiffusionInpaintPipeline(DiffusionPipeline):
7676
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
7777
safety_checker ([`StableDiffusionSafetyChecker`]):
7878
Classification module that estimates whether generated images could be considered offensive or harmful.
79-
Please, refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for details.
79+
Please, refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
80+
details.
8081
feature_extractor ([`CLIPImageProcessor`]):
8182
Model that extracts features from generated images to be used as inputs for the `safety_checker`.
8283
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@
5555
>>> import torch
5656
>>> from diffusers import StableDiffusionPipeline
5757
58-
>>> pipe = StableDiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16)
58+
>>> pipe = StableDiffusionPipeline.from_pretrained(
59+
... "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16
60+
... )
5961
>>> pipe = pipe.to("cuda")
6062
6163
>>> prompt = "a photo of an astronaut riding a horse on mars"
@@ -184,8 +186,8 @@ class StableDiffusionPipeline(
184186
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
185187
safety_checker ([`StableDiffusionSafetyChecker`]):
186188
Classification module that estimates whether generated images could be considered offensive or harmful.
187-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
188-
about a model's potential harms.
189+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
190+
more details about a model's potential harms.
189191
feature_extractor ([`~transformers.CLIPImageProcessor`]):
190192
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
191193
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class StableDiffusionImageVariationPipeline(DiffusionPipeline, StableDiffusionMi
5757
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
5858
safety_checker ([`StableDiffusionSafetyChecker`]):
5959
Classification module that estimates whether generated images could be considered offensive or harmful.
60-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
61-
about a model's potential harms.
60+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
61+
more details about a model's potential harms.
6262
feature_extractor ([`~transformers.CLIPImageProcessor`]):
6363
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
6464
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ class StableDiffusionImg2ImgPipeline(
205205
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
206206
safety_checker ([`StableDiffusionSafetyChecker`]):
207207
Classification module that estimates whether generated images could be considered offensive or harmful.
208-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
209-
about a model's potential harms.
208+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
209+
more details about a model's potential harms.
210210
feature_extractor ([`~transformers.CLIPImageProcessor`]):
211211
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
212212
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ class StableDiffusionInpaintPipeline(
146146
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
147147
safety_checker ([`StableDiffusionSafetyChecker`]):
148148
Classification module that estimates whether generated images could be considered offensive or harmful.
149-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
150-
about a model's potential harms.
149+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
150+
more details about a model's potential harms.
151151
feature_extractor ([`~transformers.CLIPImageProcessor`]):
152152
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
153153
"""

Diff for: src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_instruct_pix2pix.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class StableDiffusionInstructPix2PixPipeline(
114114
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
115115
safety_checker ([`StableDiffusionSafetyChecker`]):
116116
Classification module that estimates whether generated images could be considered offensive or harmful.
117-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
118-
about a model's potential harms.
117+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
118+
more details about a model's potential harms.
119119
feature_extractor ([`~transformers.CLIPImageProcessor`]):
120120
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
121121
"""

Diff for: src/diffusers/pipelines/stable_diffusion_attend_and_excite/pipeline_stable_diffusion_attend_and_excite.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ class StableDiffusionAttendAndExcitePipeline(DiffusionPipeline, StableDiffusionM
194194
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
195195
safety_checker ([`StableDiffusionSafetyChecker`]):
196196
Classification module that estimates whether generated images could be considered offensive or harmful.
197-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
198-
about a model's potential harms.
197+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
198+
more details about a model's potential harms.
199199
feature_extractor ([`~transformers.CLIPImageProcessor`]):
200200
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
201201
"""

Diff for: src/diffusers/pipelines/stable_diffusion_diffedit/pipeline_stable_diffusion_diffedit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ class StableDiffusionDiffEditPipeline(
268268
A scheduler to be used in combination with `unet` to fill in the unmasked part of the input latents.
269269
safety_checker ([`StableDiffusionSafetyChecker`]):
270270
Classification module that estimates whether generated images could be considered offensive or harmful.
271-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
272-
about a model's potential harms.
271+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
272+
more details about a model's potential harms.
273273
feature_extractor ([`~transformers.CLIPImageProcessor`]):
274274
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
275275
"""

Diff for: src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class StableDiffusionGLIGENPipeline(DiffusionPipeline, StableDiffusionMixin):
120120
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
121121
safety_checker ([`StableDiffusionSafetyChecker`]):
122122
Classification module that estimates whether generated images could be considered offensive or harmful.
123-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
124-
about a model's potential harms.
123+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
124+
more details about a model's potential harms.
125125
feature_extractor ([`~transformers.CLIPImageProcessor`]):
126126
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
127127
"""

Diff for: src/diffusers/pipelines/stable_diffusion_gligen/pipeline_stable_diffusion_gligen_text_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ class StableDiffusionGLIGENTextImagePipeline(DiffusionPipeline, StableDiffusionM
172172
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
173173
safety_checker ([`StableDiffusionSafetyChecker`]):
174174
Classification module that estimates whether generated images could be considered offensive or harmful.
175-
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for more details
176-
about a model's potential harms.
175+
Please refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
176+
more details about a model's potential harms.
177177
feature_extractor ([`~transformers.CLIPImageProcessor`]):
178178
A `CLIPImageProcessor` to extract features from generated images; used as inputs to the `safety_checker`.
179179
"""

Diff for: src/diffusers/pipelines/stable_diffusion_k_diffusion/pipeline_stable_diffusion_k_diffusion.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class StableDiffusionKDiffusionPipeline(
8383
[`DDIMScheduler`], [`LMSDiscreteScheduler`], or [`PNDMScheduler`].
8484
safety_checker ([`StableDiffusionSafetyChecker`]):
8585
Classification module that estimates whether generated images could be considered offensive or harmful.
86-
Please, refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for details.
86+
Please, refer to the [model card](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5) for
87+
details.
8788
feature_extractor ([`CLIPImageProcessor`]):
8889
Model that extracts features from generated images to be used as inputs for the `safety_checker`.
8990
"""

0 commit comments

Comments
 (0)