LuyangZ commited on
Commit
4d4bd97
·
verified ·
1 Parent(s): 5805c80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -30,6 +30,13 @@ pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , con
30
  # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float16)
31
  pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.config)
32
 
 
 
 
 
 
 
 
33
  pipeline = pipeline.to(device)
34
  # torch.cuda.empty_cache()
35
 
 
30
  # pipeline = StableDiffusionControlNetPipeline.from_pretrained(base_model_id , controlnet=controlnet, torch_dtype=torch.float16)
31
  pipeline.scheduler = UniPCMultistepScheduler.from_config(pipeline.scheduler.config)
32
 
33
+
34
+
35
+ pipe.enable_xformers_memory_efficient_attention()
36
+ pipe.enable_model_cpu_offload()
37
+ pipe.enable_attention_slicing()
38
+
39
+
40
  pipeline = pipeline.to(device)
41
  # torch.cuda.empty_cache()
42