Skip to content

Commit

Permalink
always_offload
Browse files Browse the repository at this point in the history
  • Loading branch information
dkackman committed Feb 5, 2024
1 parent 48793e8 commit ae822a2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions swarm/diffusion/diffusion_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@ def diffusion_callback(device_identifier, model_name, **kwargs):
main_pipeline.enable_vae_slicing()
if has_method(main_pipeline, "enable_vae_tiling"):
main_pipeline.enable_vae_tiling()
if has_method(main_pipeline, "enable_model_cpu_offload"):
main_pipeline.enable_model_cpu_offload()

if kwargs.pop("always_offload", False) and has_method(main_pipeline, "enable_model_cpu_offload"):
if (preserve_vram or kwargs.pop("always_offload", False)) and has_method(main_pipeline, "enable_model_cpu_offload"):
main_pipeline.enable_model_cpu_offload()

# prior pipeline is used by the Kandinsky v2 and others
Expand Down

0 comments on commit ae822a2

Please sign in to comment.