app.py: use samplers endpoint

#4
Files changed (1) hide show
  1. app.py +5 -19
app.py CHANGED
@@ -36,6 +36,10 @@ class Prodia:
36
  response = self._get(f"{self.base}/sdxl/models")
37
  return response.json()
38
 
 
 
 
 
39
  def _post(self, url, params):
40
  headers = {
41
  **self.headers,
@@ -119,25 +123,7 @@ with gr.Blocks(css=css) as demo:
119
  with gr.Tab("Generation"):
120
  with gr.Row():
121
  with gr.Column(scale=1):
122
- sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampling Method", choices=[
123
- "Euler",
124
- "Euler a",
125
- "LMS",
126
- "Heun",
127
- "DPM2",
128
- "DPM2 a",
129
- "DPM++ 2S a",
130
- "DPM++ 2M",
131
- "DPM++ SDE",
132
- "DPM fast",
133
- "DPM adaptive",
134
- "LMS Karras",
135
- "DPM2 Karras",
136
- "DPM2 a Karras",
137
- "DPM++ 2S a Karras",
138
- "DPM++ 2M Karras",
139
- "DPM++ SDE Karras",
140
- ])
141
 
142
  with gr.Column(scale=1):
143
  steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
 
36
  response = self._get(f"{self.base}/sdxl/models")
37
  return response.json()
38
 
39
+ def list_samplers(seflf):
40
+ response = self._get(f"{self.base}/sdxl/samplers")
41
+ return response.json()
42
+
43
  def _post(self, url, params):
44
  headers = {
45
  **self.headers,
 
123
  with gr.Tab("Generation"):
124
  with gr.Row():
125
  with gr.Column(scale=1):
126
+ sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
 
128
  with gr.Column(scale=1):
129
  steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)