Jackflack09 commited on
Commit
18f6a92
·
1 Parent(s): 1d1a760

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -68,12 +68,15 @@ if is_colab:
68
 
69
 
70
  else:
71
- pipe = StableDiffusionPipeline.from_pretrained(
72
- model_id,
73
- revision="fp16" if torch.cuda.is_available() else "fp32",
74
- torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
75
- scheduler=scheduler
76
- ).to("cuda")
 
 
 
77
 
78
  device = "GPU 🔥" if torch.cuda.is_available() else "CPU 🥶"
79
 
 
68
 
69
 
70
  else:
71
+ pipe = StableDiffusionPipeline.from_pretrained(
72
+ current_model.path,
73
+ torch_dtype=torch.float16,
74
+ scheduler=DPMSolverMultistepScheduler.from_pretrained(current_model.path, subfolder="scheduler")
75
+ )
76
+
77
+ if torch.cuda.is_available():
78
+ pipe = pipe.to("cuda")
79
+ pipe.enable_xformers_memory_efficient_attention()
80
 
81
  device = "GPU 🔥" if torch.cuda.is_available() else "CPU 🥶"
82