Skip to content

Commit 661bde0

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

28 files changed

+69
-57
lines changed

scripts/convert_blipdiffusion_to_diffusers.py

Lines changed: 3 additions & 1 deletion
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()

src/diffusers/pipelines/controlnet/pipeline_controlnet.py

Lines changed: 2 additions & 2 deletions
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
"""

src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py

Lines changed: 2 additions & 2 deletions
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
"""

src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py

Lines changed: 7 additions & 7 deletions
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
"""

src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py

Lines changed: 6 additions & 3 deletions
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
"""

src/diffusers/pipelines/pipeline_flax_utils.py

Lines changed: 2 additions & 2 deletions
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*):

src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py

Lines changed: 2 additions & 2 deletions
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
"""

src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_img2img.py

Lines changed: 2 additions & 2 deletions
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
"""

src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_inpaint.py

Lines changed: 2 additions & 2 deletions
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
"""

src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py

Lines changed: 2 additions & 1 deletion
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
"""

0 commit comments

Comments
 (0)