Update app.py
Browse files
app.py
CHANGED
@@ -204,85 +204,35 @@ with gr.Blocks(css=css) as demo:
|
|
204 |
model = gr.Radio(interactive=True, value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=False, choices=prodia_client.list_models())
|
205 |
|
206 |
with gr.Tabs() as tabs:
|
207 |
-
|
208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
prompt = gr.Textbox("", placeholder="Prompt", show_label=False, lines=3)
|
215 |
-
negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=False, lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
|
216 |
-
|
217 |
-
with gr.Row():
|
218 |
-
with gr.Column(scale=1):
|
219 |
-
steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
|
220 |
-
|
221 |
-
with gr.Row():
|
222 |
-
with gr.Column(scale=1):
|
223 |
-
width = gr.Slider(label="Ширина", minimum=15, maximum=1024, value=512, step=8)
|
224 |
-
height = gr.Slider(label="Длина", minimum=15, maximum=1024, value=512, step=8)
|
225 |
-
|
226 |
-
with gr.Tab("Расширенные настройки"):
|
227 |
-
with gr.Row():
|
228 |
-
with gr.Column(scale=1):
|
229 |
-
sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
|
230 |
-
|
231 |
-
with gr.Column(scale=1):
|
232 |
-
batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
|
233 |
-
batch_count = gr.Slider(label="Batch Count", maximum=1, value=1)
|
234 |
-
|
235 |
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)
|
236 |
seed = gr.Slider(label="Seed", minimum=-1, maximum=10000000, value=-1)
|
237 |
-
|
238 |
-
with gr.Column():
|
239 |
-
text_button = gr.Button("Создать", variant='primary', elem_id="generate")
|
240 |
-
with gr.Column(scale=2):
|
241 |
-
image_output = gr.Image()
|
242 |
-
|
243 |
-
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
244 |
-
|
245 |
-
with gr.Tab("img2img", id='i2i'):
|
246 |
-
with gr.Row():
|
247 |
-
with gr.Column(scale=3):
|
248 |
-
with gr.Tab("Основные настройки"):
|
249 |
-
i2i_image_input = gr.Image(type="pil")
|
250 |
-
with gr.Column(scale=6, min_width=600):
|
251 |
-
i2i_prompt = gr.Textbox("", placeholder="Prompt", show_label=False, lines=3)
|
252 |
-
i2i_negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=False, lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
|
253 |
-
|
254 |
-
with gr.Row():
|
255 |
-
|
256 |
-
with gr.Column(scale=1):
|
257 |
-
i2i_steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
|
258 |
-
|
259 |
-
with gr.Row():
|
260 |
-
with gr.Column(scale=1):
|
261 |
-
i2i_width = gr.Slider(label="Ширина", minimum=15, maximum=1024, value=512, step=8)
|
262 |
-
i2i_height = gr.Slider(label="Высота", minimum=15, maximum=1024, value=512, step=8)
|
263 |
-
|
264 |
-
|
265 |
-
with gr.Tab("Расширенные настройки"):
|
266 |
-
|
267 |
-
with gr.Row():
|
268 |
-
with gr.Column(scale=1):
|
269 |
-
i2i_sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
|
270 |
-
|
271 |
-
|
272 |
-
with gr.Row():
|
273 |
-
with gr.Column(scale=1):
|
274 |
-
i2i_batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
|
275 |
-
i2i_batch_count = gr.Slider(label="Batch Count", maximum=1, value=1)
|
276 |
-
|
277 |
-
i2i_cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)
|
278 |
-
i2i_denoising = gr.Slider(label="Denoising Strength", minimum=0, maximum=1, value=0.7, step=0.1)
|
279 |
-
i2i_seed = gr.Slider(label="Seed", minimum=-1, maximum=10000000, value=-1)
|
280 |
-
|
281 |
-
|
282 |
-
with gr.Column():
|
283 |
-
i2i_text_button = gr.Button("Генерация", variant='primary', elem_id="generate")
|
284 |
-
with gr.Column(scale=2):
|
285 |
-
i2i_image_output = gr.Image()
|
286 |
|
287 |
-
|
|
|
|
|
|
|
|
|
288 |
demo.queue(concurrency_count=64, max_size=80, api_open=False).launch(max_threads=256)
|
|
|
204 |
model = gr.Radio(interactive=True, value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=False, choices=prodia_client.list_models())
|
205 |
|
206 |
with gr.Tabs() as tabs:
|
207 |
+
with gr.Row():
|
208 |
+
with gr.Column(scale=3):
|
209 |
+
with gr.Tab("Основные настройки"):
|
210 |
+
with gr.Column(scale=6, min_width=600):
|
211 |
+
prompt = gr.Textbox("", placeholder="Prompt", show_label=False, lines=3)
|
212 |
+
negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=False, lines=3, value="[deformed | disfigured], poorly drawn, [bad : wrong] anatomy, [extra | missing | floating | disconnected] limb, (mutated hands and fingers), blurry")
|
213 |
+
with gr.Accordion(label="Модель", open=False):
|
214 |
+
model = gr.Radio(interactive=True, value="absolutereality_v181.safetensors [3d9d4d2b]", show_label=False, choices=prodia_client.list_models())
|
215 |
+
|
216 |
+
with gr.Tab("Расширенные настройки"):
|
217 |
+
with gr.Row():
|
218 |
+
with gr.Column(scale=1):
|
219 |
+
sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
|
220 |
+
with gr.Column(scale=1):
|
221 |
+
steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=30, value=25, step=1)
|
222 |
+
with gr.Column(scale=1):
|
223 |
+
width = gr.Slider(label="Ширина", minimum=15, maximum=1024, value=512, step=8)
|
224 |
+
height = gr.Slider(label="Длина", minimum=15, maximum=1024, value=512, step=8)
|
225 |
|
226 |
+
with gr.Column(scale=1):
|
227 |
+
batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
|
228 |
+
batch_count = gr.Slider(label="Batch Count", maximum=1, value=1)
|
229 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)
|
231 |
seed = gr.Slider(label="Seed", minimum=-1, maximum=10000000, value=-1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
|
233 |
+
with gr.Column():
|
234 |
+
text_button = gr.Button("Создать", variant='primary', elem_id="generate")
|
235 |
+
with gr.Column(scale=2):
|
236 |
+
image_output = gr.Image()
|
237 |
+
|
238 |
demo.queue(concurrency_count=64, max_size=80, api_open=False).launch(max_threads=256)
|