Skip to content

Commit c56add8

Browse files
authored
post release v0.39.0 (#14116)
* post release v0.39.0 * style. * remove deprecated code path. * remove deprecated method.
1 parent 59d4e5a commit c56add8

117 files changed

Lines changed: 155 additions & 2399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/source/en/api/pipelines/animatediff.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ scheduler = DDIMScheduler.from_pretrained(
6868
pipe.scheduler = scheduler
6969

7070
# enable memory savings
71-
pipe.enable_vae_slicing()
71+
pipe.vae.enable_slicing()
7272
pipe.enable_model_cpu_offload()
7373

7474
output = pipe(
@@ -395,8 +395,8 @@ pipe = AnimateDiffSDXLPipeline.from_pretrained(
395395
).to("cuda")
396396

397397
# enable memory savings
398-
pipe.enable_vae_slicing()
399-
pipe.enable_vae_tiling()
398+
pipe.vae.enable_slicing()
399+
pipe.vae.enable_tiling()
400400

401401
output = pipe(
402402
prompt="a panda surfing in the ocean, realistic, high quality",
@@ -441,7 +441,7 @@ scheduler = DDIMScheduler.from_pretrained(
441441
pipe.scheduler = scheduler
442442

443443
# enable memory savings
444-
pipe.enable_vae_slicing()
444+
pipe.vae.enable_slicing()
445445
pipe.enable_model_cpu_offload()
446446

447447
# helper function to load videos
@@ -640,7 +640,7 @@ scheduler = DDIMScheduler.from_pretrained(
640640
pipe.scheduler = scheduler
641641

642642
# enable memory savings
643-
pipe.enable_vae_slicing()
643+
pipe.vae.enable_slicing()
644644
pipe.enable_model_cpu_offload()
645645

646646
output = pipe(
@@ -714,7 +714,7 @@ scheduler = DDIMScheduler.from_pretrained(
714714
pipe.scheduler = scheduler
715715

716716
# enable memory savings
717-
pipe.enable_vae_slicing()
717+
pipe.vae.enable_slicing()
718718
pipe.enable_model_cpu_offload()
719719

720720
output = pipe(
@@ -772,8 +772,8 @@ pipe.scheduler = DDIMScheduler.from_pretrained(
772772
)
773773

774774
# enable memory savings
775-
pipe.enable_vae_slicing()
776-
pipe.enable_vae_tiling()
775+
pipe.vae.enable_slicing()
776+
pipe.vae.enable_tiling()
777777

778778
# enable FreeInit
779779
# Refer to the enable_free_init documentation for a full list of configurable parameters
@@ -840,7 +840,7 @@ pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, beta_schedule="
840840

841841
pipe.load_lora_weights("wangfuyun/AnimateLCM", weight_name="sd15_lora_beta.safetensors", adapter_name="lcm-lora")
842842

843-
pipe.enable_vae_slicing()
843+
pipe.vae.enable_slicing()
844844
pipe.enable_model_cpu_offload()
845845

846846
output = pipe(
@@ -882,7 +882,7 @@ pipe.load_lora_weights("wangfuyun/AnimateLCM", weight_name="sd15_lora_beta.safet
882882
pipe.load_lora_weights("guoyww/animatediff-motion-lora-tilt-up", adapter_name="tilt-up")
883883

884884
pipe.set_adapters(["lcm-lora", "tilt-up"], [1.0, 0.8])
885-
pipe.enable_vae_slicing()
885+
pipe.vae.enable_slicing()
886886
pipe.enable_model_cpu_offload()
887887

888888
output = pipe(

docs/source/en/api/pipelines/controlnet.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ The original codebase can be found at [lllyasviel/ControlNet](https://github.com
3737
- __call__
3838
- enable_attention_slicing
3939
- disable_attention_slicing
40-
- enable_vae_slicing
41-
- disable_vae_slicing
4240
- enable_xformers_memory_efficient_attention
4341
- disable_xformers_memory_efficient_attention
4442
- load_textual_inversion
@@ -49,8 +47,6 @@ The original codebase can be found at [lllyasviel/ControlNet](https://github.com
4947
- __call__
5048
- enable_attention_slicing
5149
- disable_attention_slicing
52-
- enable_vae_slicing
53-
- disable_vae_slicing
5450
- enable_xformers_memory_efficient_attention
5551
- disable_xformers_memory_efficient_attention
5652
- load_textual_inversion
@@ -61,8 +57,6 @@ The original codebase can be found at [lllyasviel/ControlNet](https://github.com
6157
- __call__
6258
- enable_attention_slicing
6359
- disable_attention_slicing
64-
- enable_vae_slicing
65-
- disable_vae_slicing
6660
- enable_xformers_memory_efficient_attention
6761
- disable_xformers_memory_efficient_attention
6862
- load_textual_inversion

docs/source/en/api/pipelines/latent_consistency_models.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,6 @@ export_to_gif(frames, "animation.gif")
643643
- __call__
644644
- enable_freeu
645645
- disable_freeu
646-
- enable_vae_slicing
647-
- disable_vae_slicing
648-
- enable_vae_tiling
649-
- disable_vae_tiling
650646

651647
## LatentConsistencyModelImg2ImgPipeline
652648

@@ -655,10 +651,6 @@ export_to_gif(frames, "animation.gif")
655651
- __call__
656652
- enable_freeu
657653
- disable_freeu
658-
- enable_vae_slicing
659-
- disable_vae_slicing
660-
- enable_vae_tiling
661-
- disable_vae_tiling
662654

663655
## StableDiffusionPipelineOutput
664656

docs/source/en/api/pipelines/mochi.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview")
8686

8787
# Enable memory savings
8888
pipe.enable_model_cpu_offload()
89-
pipe.enable_vae_tiling()
89+
pipe.vae.enable_tiling()
9090

9191
prompt = "Close-up of a chameleon's eye, with its scaly skin changing color. Ultra high resolution 4k."
9292

@@ -109,7 +109,7 @@ pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", variant="bf16", to
109109

110110
# Enable memory savings
111111
pipe.enable_model_cpu_offload()
112-
pipe.enable_vae_tiling()
112+
pipe.vae.enable_tiling()
113113

114114
prompt = "Close-up of a chameleon's eye, with its scaly skin changing color. Ultra high resolution 4k."
115115
frames = pipe(prompt, num_frames=85).frames[0]
@@ -138,7 +138,7 @@ from diffusers.utils import export_to_video
138138
from diffusers.video_processor import VideoProcessor
139139

140140
pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", force_zeros_for_empty_prompt=True)
141-
pipe.enable_vae_tiling()
141+
pipe.vae.enable_tiling()
142142
pipe.enable_model_cpu_offload()
143143

144144
prompt = "An aerial shot of a parade of elephants walking across the African savannah. The camera showcases the herd and the surrounding landscape."
@@ -205,7 +205,7 @@ transformer = MochiTransformer3DModel.from_pretrained(
205205

206206
pipe = MochiPipeline.from_pretrained(model_id, transformer=transformer)
207207
pipe.enable_model_cpu_offload()
208-
pipe.enable_vae_tiling()
208+
pipe.vae.enable_tiling()
209209

210210
with torch.autocast(device_type="cuda", dtype=torch.bfloat16, cache_enabled=False):
211211
frames = pipe(
@@ -245,7 +245,7 @@ transformer = MochiTransformer3DModel.from_pretrained(ckpt_path, torch_dtype=tor
245245

246246
pipe = MochiPipeline.from_pretrained(model_id, transformer=transformer)
247247
pipe.enable_model_cpu_offload()
248-
pipe.enable_vae_tiling()
248+
pipe.vae.enable_tiling()
249249

250250
with torch.autocast(device_type="cuda", dtype=torch.bfloat16, cache_enabled=False):
251251
frames = pipe(

docs/source/en/api/pipelines/stable_diffusion/adapter.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ This model was contributed by the community contributor [HimariO](https://github
2929
- __call__
3030
- enable_attention_slicing
3131
- disable_attention_slicing
32-
- enable_vae_slicing
33-
- disable_vae_slicing
3432
- enable_xformers_memory_efficient_attention
3533
- disable_xformers_memory_efficient_attention
3634

@@ -41,7 +39,5 @@ This model was contributed by the community contributor [HimariO](https://github
4139
- __call__
4240
- enable_attention_slicing
4341
- disable_attention_slicing
44-
- enable_vae_slicing
45-
- disable_vae_slicing
4642
- enable_xformers_memory_efficient_attention
4743
- disable_xformers_memory_efficient_attention

docs/source/en/api/pipelines/stable_diffusion/text2img.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,8 @@ The abstract from the paper is:
3434
- __call__
3535
- enable_attention_slicing
3636
- disable_attention_slicing
37-
- enable_vae_slicing
38-
- disable_vae_slicing
3937
- enable_xformers_memory_efficient_attention
4038
- disable_xformers_memory_efficient_attention
41-
- enable_vae_tiling
42-
- disable_vae_tiling
4339
- load_textual_inversion
4440
- from_single_file
4541
- load_lora_weights

docs/source/en/api/pipelines/stable_unclip.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ image
106106
- __call__
107107
- enable_attention_slicing
108108
- disable_attention_slicing
109-
- enable_vae_slicing
110-
- disable_vae_slicing
111109
- enable_xformers_memory_efficient_attention
112110
- disable_xformers_memory_efficient_attention
113111

@@ -118,8 +116,6 @@ image
118116
- __call__
119117
- enable_attention_slicing
120118
- disable_attention_slicing
121-
- enable_vae_slicing
122-
- disable_vae_slicing
123119
- enable_xformers_memory_efficient_attention
124120
- disable_xformers_memory_efficient_attention
125121

docs/source/en/optimization/memory.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ VAE slicing saves memory by splitting large batches of inputs into a single batc
173173

174174
For example, if you're generating 4 images at once, decoding would increase peak activation memory by 4x. VAE slicing reduces this by only decoding 1 image at a time instead of all 4 images at once.
175175

176-
Call [`~StableDiffusionPipeline.enable_vae_slicing`] to enable sliced VAE. You can expect a small increase in performance when decoding multi-image batches and no performance impact for single-image batches.
176+
Call [`~AutoencoderKL.enable_slicing`] to enable sliced VAE. You can expect a small increase in performance when decoding multi-image batches and no performance impact for single-image batches.
177177

178178
```py
179179
import torch
@@ -183,7 +183,7 @@ pipeline = StableDiffusionXLPipeline.from_pretrained(
183183
"stabilityai/stable-diffusion-xl-base-1.0",
184184
torch_dtype=torch.float16,
185185
).to("cuda")
186-
pipeline.enable_vae_slicing()
186+
pipeline.vae.enable_slicing()
187187
pipeline(["An astronaut riding a horse on Mars"]*32).images[0]
188188
print(f"Max memory reserved: {torch.cuda.max_memory_allocated() / 1024**3:.2f} GB")
189189
```
@@ -195,7 +195,7 @@ print(f"Max memory reserved: {torch.cuda.max_memory_allocated() / 1024**3:.2f} G
195195

196196
VAE tiling saves memory by dividing an image into smaller overlapping tiles instead of processing the entire image at once. This also reduces peak memory usage because the GPU is only processing a tile at a time.
197197

198-
Call [`~StableDiffusionPipeline.enable_vae_tiling`] to enable VAE tiling. The generated image may have some tone variation from tile-to-tile because they're decoded separately, but there shouldn't be any obvious seams between the tiles. Tiling is disabled for resolutions lower than a pre-specified (but configurable) limit. For example, this limit is 512x512 for the VAE in [`StableDiffusionPipeline`].
198+
Call [`~AutoencoderKL.enable_tiling`] to enable VAE tiling. The generated image may have some tone variation from tile-to-tile because they're decoded separately, but there shouldn't be any obvious seams between the tiles. Tiling is disabled for resolutions lower than a pre-specified (but configurable) limit. For example, this limit is 512x512 for the VAE in [`StableDiffusionPipeline`].
199199

200200
```py
201201
import torch
@@ -205,7 +205,7 @@ from diffusers.utils import load_image
205205
pipeline = AutoPipelineForImage2Image.from_pretrained(
206206
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16
207207
).to("cuda")
208-
pipeline.enable_vae_tiling()
208+
pipeline.vae.enable_tiling()
209209

210210
init_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/img2img-sdxl-init.png")
211211
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"

docs/source/en/using-diffusers/ip_adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ scheduler = DDIMScheduler.from_pretrained(
180180
steps_offset=1,
181181
)
182182
pipeline.scheduler = scheduler
183-
pipeline.enable_vae_slicing()
183+
pipeline.vae.enable_slicing()
184184
pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter_sd15.bin")
185185
pipeline.enable_model_cpu_offload()
186186

docs/source/ko/optimization/fp16.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ image = pipe(prompt).images[0]
112112

113113
이를 [`~StableDiffusionPipeline.enable_attention_slicing`] 또는 [`~StableDiffusionPipeline.enable_xformers_memory_efficient_attention`]과 결합하여 메모리 사용을 추가로 최소화할 수 있습니다.
114114

115-
VAE 디코드를 한 번에 하나씩 수행하려면 추론 전에 파이프라인에서 [`~StableDiffusionPipeline.enable_vae_slicing`]을 호출합니다. 예를 들어:
115+
VAE 디코드를 한 번에 하나씩 수행하려면 추론 전에 파이프라인에서 [`~AutoencoderKL.enable_slicing`]을 호출합니다. 예를 들어:
116116

117117
```Python
118118
import torch
@@ -126,7 +126,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
126126
pipe = pipe.to("cuda")
127127

128128
prompt = "a photo of an astronaut riding a horse on mars"
129-
pipe.enable_vae_slicing()
129+
pipe.vae.enable_slicing()
130130
images = pipe([prompt] * 32).images
131131
```
132132

0 commit comments

Comments
 (0)