zwl commited on
Commit
ebf438a
·
1 Parent(s): 2b19287

add app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -4,18 +4,7 @@ import torch
4
  from PIL import Image
5
  import os
6
 
7
- scheduler = UniPCMultistepScheduler(
8
- beta_start=0.00085,
9
- beta_end=0.012,
10
- beta_schedule="scaled_linear",
11
- solver_order=2,
12
- prediction_type="epsilon",
13
- predict_x0=True,
14
- thresholding=False,
15
- solver_type='bh2',
16
- lower_order_final=True,
17
- disable_corrector=[0],
18
- )
19
 
20
  class Model:
21
  def __init__(self, name, path, prefix):
@@ -89,6 +78,7 @@ def txt_to_img(model_path, prompt, neg_prompt, guidance, steps, width, height, g
89
 
90
  pipe.to("cpu")
91
  pipe = current_model.pipe_t2i
 
92
 
93
  if torch.cuda.is_available():
94
  pipe = pipe.to("cuda")
@@ -117,6 +107,7 @@ def img_to_img(model_path, prompt, neg_prompt, img, strength, guidance, steps, w
117
 
118
  pipe.to("cpu")
119
  pipe = current_model.pipe_i2i
 
120
 
121
  if torch.cuda.is_available():
122
  pipe = pipe.to("cuda")
 
4
  from PIL import Image
5
  import os
6
 
7
+
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  class Model:
10
  def __init__(self, name, path, prefix):
 
78
 
79
  pipe.to("cpu")
80
  pipe = current_model.pipe_t2i
81
+ pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
82
 
83
  if torch.cuda.is_available():
84
  pipe = pipe.to("cuda")
 
107
 
108
  pipe.to("cpu")
109
  pipe = current_model.pipe_i2i
110
+ pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
111
 
112
  if torch.cuda.is_available():
113
  pipe = pipe.to("cuda")