diff --git a/skynet/dgpu/compute.py b/skynet/dgpu/compute.py index 9620c00..a62fa27 100644 --- a/skynet/dgpu/compute.py +++ b/skynet/dgpu/compute.py @@ -151,7 +151,7 @@ class SkynetMM: num_inference_steps=step, generator=seed, callback=callback_fn, - callback_steps=1, + callback_steps=2, **extra_params ).images[0] diff --git a/skynet/utils.py b/skynet/utils.py index 54cfa1b..4de2b78 100755 --- a/skynet/utils.py +++ b/skynet/utils.py @@ -113,6 +113,8 @@ def pipeline_for(model: str, mem_fraction: float = 1.0, image=False) -> Diffusio pipe.scheduler = EulerAncestralDiscreteScheduler.from_config( pipe.scheduler.config) + pipe.enable_xformers_memory_efficient_attention() + if over_mem: if not image: pipe.enable_vae_slicing() @@ -120,7 +122,8 @@ def pipeline_for(model: str, mem_fraction: float = 1.0, image=False) -> Diffusio pipe.enable_model_cpu_offload() - pipe.enable_xformers_memory_efficient_attention() + else: + pipe = pipe.to('cuda') return pipe