Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
e9edbfc2
Unverified
Commit
e9edbfc2
authored
Apr 25, 2023
by
Isaac
Committed by
GitHub
Apr 25, 2023
Browse files
adding enable_vae_tiling and disable_vae_tiling functions (#3225)
adding enable_vae_tiling and disable_val_tiling functions
parent
0ddc5bf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py
.../stable_diffusion/pipeline_stable_diffusion_controlnet.py
+18
-0
No files found.
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py
View file @
e9edbfc2
...
...
@@ -249,6 +249,24 @@ class StableDiffusionControlNetPipeline(DiffusionPipeline, TextualInversionLoade
"""
self
.
vae
.
disable_slicing
()
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.enable_vae_tiling
def
enable_vae_tiling
(
self
):
r
"""
Enable tiled VAE decoding.
When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.
"""
self
.
vae
.
enable_tiling
()
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.disable_vae_tiling
def
disable_vae_tiling
(
self
):
r
"""
Disable tiled VAE decoding. If `enable_vae_tiling` was previously invoked, this method will go back to
computing decoding in one step.
"""
self
.
vae
.
disable_tiling
()
def
enable_sequential_cpu_offload
(
self
,
gpu_id
=
0
):
r
"""
Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment