Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -225,16 +225,16 @@ with gr.Blocks(css=css) as demo:
|
|
| 225 |
sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
|
| 226 |
|
| 227 |
with gr.Column(scale=1):
|
| 228 |
-
steps = gr.Slider(label="количество обработок", minimum=1, maximum=
|
| 229 |
|
| 230 |
with gr.Row():
|
| 231 |
with gr.Column(scale=1):
|
| 232 |
-
width = gr.Slider(label="Ширина", maximum=
|
| 233 |
-
height = gr.Slider(label="Высота", maximum=
|
| 234 |
|
| 235 |
with gr.Column(scale=1):
|
| 236 |
-
batch_size = gr.Slider(label="Batch Size", maximum=
|
| 237 |
-
batch_count = gr.Slider(label="Batch Count", maximum=
|
| 238 |
|
| 239 |
cfg_scale = gr.Slider(label="CFG Scale(степень фантазии ии)", minimum=1, maximum=20, value=7, step=1)
|
| 240 |
seed = gr.Number(label="Семя рандома", value=-1)
|
|
@@ -243,7 +243,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 243 |
image_output = gr.Image(value="https://images.prodia.xyz/8ede1a7c-c0ee-4ded-987d-6ffed35fc477.png")
|
| 244 |
|
| 245 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height,
|
| 246 |
-
seed], outputs=image_output, concurrency_limit=
|
| 247 |
|
| 248 |
with gr.Tab("img2img", id='i2i'):
|
| 249 |
with gr.Row():
|
|
@@ -267,15 +267,15 @@ with gr.Blocks(css=css) as demo:
|
|
| 267 |
|
| 268 |
with gr.Row():
|
| 269 |
with gr.Column(scale=1):
|
| 270 |
-
i2i_width = gr.Slider(label="Ширина", maximum=
|
| 271 |
-
i2i_height = gr.Slider(label="Высота", maximum=
|
| 272 |
|
| 273 |
with gr.Column(scale=1):
|
| 274 |
-
i2i_batch_size = gr.Slider(label="Batch Size", maximum=
|
| 275 |
-
i2i_batch_count = gr.Slider(label="Batch Count", maximum=
|
| 276 |
|
| 277 |
-
i2i_cfg_scale = gr.Slider(label="CFG Scale(степень фантазии ии)", minimum=1, maximum=
|
| 278 |
-
i2i_denoising = gr.Slider(label="сила изменения фото", minimum
|
| 279 |
i2i_seed = gr.Number(label="Семя рандома ", value=-1)
|
| 280 |
|
| 281 |
with gr.Column(scale=2):
|
|
@@ -283,7 +283,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 283 |
|
| 284 |
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt,
|
| 285 |
model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height,
|
| 286 |
-
i2i_seed], outputs=i2i_image_output, concurrency_limit=
|
| 287 |
|
| 288 |
with gr.Tab("PNG Info"):
|
| 289 |
def plaintext_to_html(text, classname=None):
|
|
@@ -316,12 +316,12 @@ with gr.Blocks(css=css) as demo:
|
|
| 316 |
|
| 317 |
with gr.Column():
|
| 318 |
exif_output = gr.HTML(label="EXIF Data")
|
| 319 |
-
send_to_txt2img_btn = gr.Button("
|
| 320 |
|
| 321 |
image_input.upload(get_exif_data, inputs=[image_input], outputs=exif_output)
|
| 322 |
send_to_txt2img_btn.click(send_to_txt2img, inputs=[image_input], outputs=[tabs, prompt, negative_prompt,
|
| 323 |
steps, seed, model, sampler,
|
| 324 |
width, height, cfg_scale],
|
| 325 |
-
concurrency_limit=
|
| 326 |
|
| 327 |
demo.queue(max_size=80, api_open=False).launch(max_threads=1024, show_api=False)
|
|
|
|
| 225 |
sampler = gr.Dropdown(value="DPM++ 2M Karras", show_label=True, label="Sampling Method", choices=prodia_client.list_samplers())
|
| 226 |
|
| 227 |
with gr.Column(scale=1):
|
| 228 |
+
steps = gr.Slider(label="количество обработок", minimum=1, maximum=25, value=20, step=1)
|
| 229 |
|
| 230 |
with gr.Row():
|
| 231 |
with gr.Column(scale=1):
|
| 232 |
+
width = gr.Slider(label="Ширина", maximum=1024, value=512, step=8)
|
| 233 |
+
height = gr.Slider(label="Высота", maximum=1024, value=512, step=8)
|
| 234 |
|
| 235 |
with gr.Column(scale=1):
|
| 236 |
+
batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
|
| 237 |
+
batch_count = gr.Slider(label="Batch Count", maximum=1, value=1)
|
| 238 |
|
| 239 |
cfg_scale = gr.Slider(label="CFG Scale(степень фантазии ии)", minimum=1, maximum=20, value=7, step=1)
|
| 240 |
seed = gr.Number(label="Семя рандома", value=-1)
|
|
|
|
| 243 |
image_output = gr.Image(value="https://images.prodia.xyz/8ede1a7c-c0ee-4ded-987d-6ffed35fc477.png")
|
| 244 |
|
| 245 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height,
|
| 246 |
+
seed], outputs=image_output, concurrency_limit=128)
|
| 247 |
|
| 248 |
with gr.Tab("img2img", id='i2i'):
|
| 249 |
with gr.Row():
|
|
|
|
| 267 |
|
| 268 |
with gr.Row():
|
| 269 |
with gr.Column(scale=1):
|
| 270 |
+
i2i_width = gr.Slider(label="Ширина", maximum=1024, value=512, step=8)
|
| 271 |
+
i2i_height = gr.Slider(label="Высота", maximum=1024, value=512, step=8)
|
| 272 |
|
| 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="сила изменения фото", minimum=0, maximum=1, value=0.7, step=0.05)
|
| 279 |
i2i_seed = gr.Number(label="Семя рандома ", value=-1)
|
| 280 |
|
| 281 |
with gr.Column(scale=2):
|
|
|
|
| 283 |
|
| 284 |
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt,
|
| 285 |
model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height,
|
| 286 |
+
i2i_seed], outputs=i2i_image_output, concurrency_limit=128)
|
| 287 |
|
| 288 |
with gr.Tab("PNG Info"):
|
| 289 |
def plaintext_to_html(text, classname=None):
|
|
|
|
| 316 |
|
| 317 |
with gr.Column():
|
| 318 |
exif_output = gr.HTML(label="EXIF Data")
|
| 319 |
+
send_to_txt2img_btn = gr.Button("копировать в данные в txt2img")
|
| 320 |
|
| 321 |
image_input.upload(get_exif_data, inputs=[image_input], outputs=exif_output)
|
| 322 |
send_to_txt2img_btn.click(send_to_txt2img, inputs=[image_input], outputs=[tabs, prompt, negative_prompt,
|
| 323 |
steps, seed, model, sampler,
|
| 324 |
width, height, cfg_scale],
|
| 325 |
+
concurrency_limit=128)
|
| 326 |
|
| 327 |
demo.queue(max_size=80, api_open=False).launch(max_threads=1024, show_api=False)
|