Skip to content

Commit ce1c27a

Browse files
[Revision] Don't recommend using revision (#1764)
1 parent b267d28 commit ce1c27a

20 files changed

+45
-84
lines changed

docs/source/api/pipelines/overview.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ from diffusers import StableDiffusionImg2ImgPipeline
139139

140140
# load the pipeline
141141
device = "cuda"
142-
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
143-
"runwayml/stable-diffusion-v1-5", revision="fp16", torch_dtype=torch.float16
144-
).to(device)
142+
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to(
143+
device
144+
)
145145

146146
# let's download an initial image
147147
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
@@ -189,7 +189,6 @@ mask_image = download_image(mask_url).resize((512, 512))
189189

190190
pipe = StableDiffusionInpaintPipeline.from_pretrained(
191191
"runwayml/stable-diffusion-inpainting",
192-
revision="fp16",
193192
torch_dtype=torch.float16,
194193
)
195194
pipe = pipe.to("cuda")

docs/source/api/pipelines/stable_diffusion_2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ import torch
113113

114114
# load model and scheduler
115115
model_id = "stabilityai/stable-diffusion-x4-upscaler"
116-
pipeline = StableDiffusionUpscalePipeline.from_pretrained(model_id, revision="fp16", torch_dtype=torch.float16)
116+
pipeline = StableDiffusionUpscalePipeline.from_pretrained(model_id, torch_dtype=torch.float16)
117117
pipeline = pipeline.to("cuda")
118118

119119
# let's download an image

docs/source/optimization/fp16.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ To save more GPU memory and get even more speed, you can load and run the model
7979
```Python
8080
pipe = StableDiffusionPipeline.from_pretrained(
8181
"runwayml/stable-diffusion-v1-5",
82-
revision="fp16",
82+
8383
torch_dtype=torch.float16,
8484
)
8585
pipe = pipe.to("cuda")
@@ -107,7 +107,7 @@ from diffusers import StableDiffusionPipeline
107107

108108
pipe = StableDiffusionPipeline.from_pretrained(
109109
"runwayml/stable-diffusion-v1-5",
110-
revision="fp16",
110+
111111
torch_dtype=torch.float16,
112112
)
113113
pipe = pipe.to("cuda")
@@ -134,7 +134,7 @@ from diffusers import StableDiffusionPipeline
134134

135135
pipe = StableDiffusionPipeline.from_pretrained(
136136
"runwayml/stable-diffusion-v1-5",
137-
revision="fp16",
137+
138138
torch_dtype=torch.float16,
139139
)
140140
pipe = pipe.to("cuda")
@@ -159,7 +159,7 @@ from diffusers import StableDiffusionPipeline
159159

160160
pipe = StableDiffusionPipeline.from_pretrained(
161161
"runwayml/stable-diffusion-v1-5",
162-
revision="fp16",
162+
163163
torch_dtype=torch.float16,
164164
)
165165
pipe = pipe.to("cuda")
@@ -179,7 +179,7 @@ from diffusers import StableDiffusionPipeline
179179

180180
pipe = StableDiffusionPipeline.from_pretrained(
181181
"runwayml/stable-diffusion-v1-5",
182-
revision="fp16",
182+
183183
torch_dtype=torch.float16,
184184
)
185185
pipe = pipe.to("cuda")
@@ -234,7 +234,6 @@ def generate_inputs():
234234

235235
pipe = StableDiffusionPipeline.from_pretrained(
236236
"runwayml/stable-diffusion-v1-5",
237-
revision="fp16",
238237
torch_dtype=torch.float16,
239238
).to("cuda")
240239
unet = pipe.unet
@@ -298,7 +297,6 @@ class UNet2DConditionOutput:
298297

299298
pipe = StableDiffusionPipeline.from_pretrained(
300299
"runwayml/stable-diffusion-v1-5",
301-
revision="fp16",
302300
torch_dtype=torch.float16,
303301
).to("cuda")
304302

@@ -349,7 +347,6 @@ import torch
349347

350348
pipe = StableDiffusionPipeline.from_pretrained(
351349
"runwayml/stable-diffusion-v1-5",
352-
revision="fp16",
353350
torch_dtype=torch.float16,
354351
).to("cuda")
355352

docs/source/using-diffusers/custom_pipeline_examples.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ guided_pipeline = DiffusionPipeline.from_pretrained(
5858
custom_pipeline="clip_guided_stable_diffusion",
5959
clip_model=clip_model,
6060
feature_extractor=feature_extractor,
61-
revision="fp16",
6261
torch_dtype=torch.float16,
6362
)
6463
guided_pipeline.enable_attention_slicing()
@@ -113,7 +112,6 @@ import torch
113112

114113
pipe = DiffusionPipeline.from_pretrained(
115114
"CompVis/stable-diffusion-v1-4",
116-
revision="fp16",
117115
torch_dtype=torch.float16,
118116
safety_checker=None, # Very important for videos...lots of false positives while interpolating
119117
custom_pipeline="interpolate_stable_diffusion",
@@ -159,7 +157,6 @@ pipe = DiffusionPipeline.from_pretrained(
159157
"CompVis/stable-diffusion-v1-4",
160158
custom_pipeline="stable_diffusion_mega",
161159
torch_dtype=torch.float16,
162-
revision="fp16",
163160
)
164161
pipe.to("cuda")
165162
pipe.enable_attention_slicing()
@@ -204,7 +201,7 @@ from diffusers import DiffusionPipeline
204201
import torch
205202

206203
pipe = DiffusionPipeline.from_pretrained(
207-
"hakurei/waifu-diffusion", custom_pipeline="lpw_stable_diffusion", revision="fp16", torch_dtype=torch.float16
204+
"hakurei/waifu-diffusion", custom_pipeline="lpw_stable_diffusion", torch_dtype=torch.float16
208205
)
209206
pipe = pipe.to("cuda")
210207

@@ -268,7 +265,7 @@ diffuser_pipeline = DiffusionPipeline.from_pretrained(
268265
custom_pipeline="speech_to_image_diffusion",
269266
speech_model=model,
270267
speech_processor=processor,
271-
revision="fp16",
268+
272269
torch_dtype=torch.float16,
273270
)
274271

docs/source/using-diffusers/img2img.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ from diffusers import StableDiffusionImg2ImgPipeline
2424

2525
# load the pipeline
2626
device = "cuda"
27-
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
28-
"runwayml/stable-diffusion-v1-5", revision="fp16", torch_dtype=torch.float16
29-
).to(device)
27+
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to(
28+
device
29+
)
3030

3131
# let's download an initial image
3232
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"

docs/source/using-diffusers/inpaint.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ mask_image = download_image(mask_url).resize((512, 512))
4242

4343
pipe = StableDiffusionInpaintPipeline.from_pretrained(
4444
"runwayml/stable-diffusion-inpainting",
45-
revision="fp16",
4645
torch_dtype=torch.float16,
4746
)
4847
pipe = pipe.to("cuda")

examples/community/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ guided_pipeline = DiffusionPipeline.from_pretrained(
5757
custom_pipeline="clip_guided_stable_diffusion",
5858
clip_model=clip_model,
5959
feature_extractor=feature_extractor,
60-
revision="fp16",
60+
6161
torch_dtype=torch.float16,
6262
)
6363
guided_pipeline.enable_attention_slicing()
@@ -208,7 +208,7 @@ import torch
208208
pipe = DiffusionPipeline.from_pretrained(
209209
'hakurei/waifu-diffusion',
210210
custom_pipeline="lpw_stable_diffusion",
211-
revision="fp16",
211+
212212
torch_dtype=torch.float16
213213
)
214214
pipe=pipe.to("cuda")
@@ -275,7 +275,7 @@ diffuser_pipeline = DiffusionPipeline.from_pretrained(
275275
custom_pipeline="speech_to_image_diffusion",
276276
speech_model=model,
277277
speech_processor=processor,
278-
revision="fp16",
278+
279279
torch_dtype=torch.float16,
280280
)
281281

@@ -333,7 +333,7 @@ import torch
333333
pipe = DiffusionPipeline.from_pretrained(
334334
"CompVis/stable-diffusion-v1-4",
335335
custom_pipeline="wildcard_stable_diffusion",
336-
revision="fp16",
336+
337337
torch_dtype=torch.float16,
338338
)
339339
prompt = "__animal__ sitting on a __object__ wearing a __clothing__"
@@ -567,7 +567,7 @@ diffuser_pipeline = DiffusionPipeline.from_pretrained(
567567
detection_pipeline=language_detection_pipeline,
568568
translation_model=trans_model,
569569
translation_tokenizer=trans_tokenizer,
570-
revision="fp16",
570+
571571
torch_dtype=torch.float16,
572572
)
573573

@@ -615,7 +615,7 @@ mask_image = PIL.Image.open(mask_path).convert("RGB").resize((512, 512))
615615
pipe = DiffusionPipeline.from_pretrained(
616616
"runwayml/stable-diffusion-inpainting",
617617
custom_pipeline="img2img_inpainting",
618-
revision="fp16",
618+
619619
torch_dtype=torch.float16
620620
)
621621
pipe = pipe.to("cuda")

examples/community/wildcard_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class WildcardStableDiffusionPipeline(DiffusionPipeline):
6868
Example Usage:
6969
pipe = WildcardStableDiffusionPipeline.from_pretrained(
7070
"CompVis/stable-diffusion-v1-4",
71-
revision="fp16",
71+
7272
torch_dtype=torch.float16,
7373
)
7474
prompt = "__animal__ sitting on a __object__ wearing a __clothing__"

src/diffusers/pipelines/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ from diffusers import StableDiffusionImg2ImgPipeline
113113
device = "cuda"
114114
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
115115
"runwayml/stable-diffusion-v1-5",
116-
revision="fp16",
117116
torch_dtype=torch.float16,
118117
).to(device)
119118

@@ -161,7 +160,6 @@ mask_image = download_image(mask_url).resize((512, 512))
161160

162161
pipe = StableDiffusionInpaintPipeline.from_pretrained(
163162
"runwayml/stable-diffusion-inpainting",
164-
revision="fp16",
165163
torch_dtype=torch.float16,
166164
)
167165
pipe = pipe.to("cuda")

tests/pipelines/altdiffusion/test_alt_diffusion.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,7 @@ def test_alt_diffusion_fast_ddim(self):
248248
def test_alt_diffusion_text2img_pipeline_fp16(self):
249249
torch.cuda.reset_peak_memory_stats()
250250
model_id = "BAAI/AltDiffusion"
251-
pipe = AltDiffusionPipeline.from_pretrained(
252-
model_id, revision="fp16", torch_dtype=torch.float16, safety_checker=None
253-
)
251+
pipe = AltDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, safety_checker=None)
254252
pipe = pipe.to(torch_device)
255253
pipe.set_progress_bar_config(disable=None)
256254

0 commit comments

Comments
 (0)