stefanbenten commited on
Commit
df700b4
1 Parent(s): e5111ed

app.py: use samplers endpoint

Browse files
Files changed (1) hide show
  1. app.py +6 -44
app.py CHANGED
@@ -48,6 +48,10 @@ class Prodia:
48
  response = self._get(f"{self.base}/sd/models")
49
  return response.json()
50
 
 
 
 
 
51
  def _post(self, url, params):
52
  headers = {
53
  **self.headers,
@@ -202,28 +206,6 @@ css = """
202
  }
203
  """
204
 
205
- samplers = [
206
- "Euler",
207
- "Euler a",
208
- "LMS",
209
- "Heun",
210
- "DPM2",
211
- "DPM2 a",
212
- "DPM++ 2S a",
213
- "DPM++ 2M",
214
- "DPM++ SDE",
215
- "DPM fast",
216
- "DPM adaptive",
217
- "LMS Karras",
218
- "DPM2 Karras",
219
- "DPM2 a Karras",
220
- "DPM++ 2S a Karras",
221
- "DPM++ 2M Karras",
222
- "DPM++ SDE Karras",
223
- "DDIM",
224
- "PLMS",
225
- ]
226
-
227
  with gr.Blocks(css=css) as demo:
228
  with gr.Row():
229
  with gr.Column(scale=6):
@@ -247,27 +229,7 @@ with gr.Blocks(css=css) as demo:
247
  with gr.Tab("Generation"):
248
  with gr.Row():
249
  with gr.Column(scale=1):
250
- sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", choices=[
251
- "Euler",
252
- "Euler a",
253
- "LMS",
254
- "Heun",
255
- "DPM2",
256
- "DPM2 a",
257
- "DPM++ 2S a",
258
- "DPM++ 2M",
259
- "DPM++ SDE",
260
- "DPM fast",
261
- "DPM adaptive",
262
- "LMS Karras",
263
- "DPM2 Karras",
264
- "DPM2 a Karras",
265
- "DPM++ 2S a Karras",
266
- "DPM++ 2M Karras",
267
- "DPM++ SDE Karras",
268
- "DDIM",
269
- "PLMS",
270
- ])
271
 
272
  with gr.Column(scale=1):
273
  steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
@@ -305,7 +267,7 @@ with gr.Blocks(css=css) as demo:
305
 
306
  with gr.Row():
307
  with gr.Column(scale=1):
308
- i2i_sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", choices=samplers)
309
 
310
  with gr.Column(scale=1):
311
  i2i_steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
 
48
  response = self._get(f"{self.base}/sd/models")
49
  return response.json()
50
 
51
+ def list_samplers(self):
52
+ response = self._get(f"{self.base}/sd/samplers")
53
+ return response.json()
54
+
55
  def _post(self, url, params):
56
  headers = {
57
  **self.headers,
 
206
  }
207
  """
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  with gr.Blocks(css=css) as demo:
210
  with gr.Row():
211
  with gr.Column(scale=6):
 
229
  with gr.Tab("Generation"):
230
  with gr.Row():
231
  with gr.Column(scale=1):
232
+ sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  with gr.Column(scale=1):
235
  steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
 
267
 
268
  with gr.Row():
269
  with gr.Column(scale=1):
270
+ i2i_sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
271
 
272
  with gr.Column(scale=1):
273
  i2i_steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)