Shriharsh commited on
Commit
4644672
·
1 Parent(s): db75ef7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -5,11 +5,17 @@ import torch
5
  import torch.cuda.amp as amp
6
  from diffusers import StableDiffusionPipeline
7
 
8
- modelid = "CompVis/stable-diffusion-v1-4"
 
 
 
9
  device = torch.device("cpu") # Default to CPU device
10
  if torch.cuda.is_available():
11
  device = torch.device("cuda")
12
- pipe = StableDiffusionPipeline.from_pretrained(modelid, use_auth_token=auth_token)
 
 
 
13
  pipe.to(device)
14
 
15
  def generate(prompt):
 
5
  import torch.cuda.amp as amp
6
  from diffusers import StableDiffusionPipeline
7
 
8
+
9
+
10
+ modelid = "stabilityai/stable-diffusion-2-1"
11
+
12
  device = torch.device("cpu") # Default to CPU device
13
  if torch.cuda.is_available():
14
  device = torch.device("cuda")
15
+
16
+ # Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead
17
+ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
18
+ pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
19
  pipe.to(device)
20
 
21
  def generate(prompt):