Spaces:
Runtime error
Runtime error
dreamdrop-art
commited on
Commit
·
23de566
1
Parent(s):
314c360
Update app.py
Browse files
app.py
CHANGED
@@ -220,7 +220,7 @@ def txt2img(prompt, negative_prompt, model, steps, sampler, cfg_scale, width, he
|
|
220 |
progress(0.75, desc="Opening image")
|
221 |
job = prodia_client.wait(result)
|
222 |
progress(0.99, desc="Sending image")
|
223 |
-
return job["imageUrl"]
|
224 |
|
225 |
|
226 |
def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed, progress=gr.Progress()):
|
@@ -247,7 +247,7 @@ def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampl
|
|
247 |
job = prodia_client.wait(result)
|
248 |
progress(0.99, desc="Sending image")
|
249 |
time.sleep(0.5)
|
250 |
-
return job["imageUrl"]
|
251 |
|
252 |
|
253 |
css = """
|
@@ -296,13 +296,13 @@ with gr.Blocks(css=css) as demo:
|
|
296 |
seed = gr.Number(label="Seed", value=-1)
|
297 |
|
298 |
with gr.Column(scale=2):
|
299 |
-
image_output = gr.
|
300 |
send_to_img2img = gr.Button(value="Send OUTPUT IMAGE to img2img")
|
301 |
send_to_png = gr.Button(value="Send OUTPUT IMAGE to PNG Info")
|
302 |
-
|
303 |
|
304 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height,
|
305 |
-
seed], outputs=image_output, concurrency_limit=64)
|
306 |
|
307 |
with gr.Tab("img2img", id='i2i'):
|
308 |
with gr.Row():
|
@@ -316,7 +316,7 @@ with gr.Blocks(css=css) as demo:
|
|
316 |
with gr.Row():
|
317 |
with gr.Column(scale=3):
|
318 |
with gr.Tab("Generation"):
|
319 |
-
i2i_image_input = gr.Image(type="
|
320 |
|
321 |
with gr.Row():
|
322 |
with gr.Column(scale=1):
|
@@ -340,13 +340,14 @@ with gr.Blocks(css=css) as demo:
|
|
340 |
i2i_seed = gr.Number(label="Seed", value=-1)
|
341 |
|
342 |
with gr.Column(scale=2):
|
343 |
-
i2i_image_output = gr.
|
344 |
send_to_png_i2i = gr.Button(value="Send INPUT IMAGE to PNG Info")
|
|
|
345 |
|
346 |
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt,
|
347 |
model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height,
|
348 |
-
i2i_seed], outputs=i2i_image_output, concurrency_limit=64)
|
349 |
-
send_to_img2img.click(send_to_img2img_def, inputs=
|
350 |
|
351 |
with gr.Tab("PNG Info"):
|
352 |
def plaintext_to_html(text, classname=None):
|
@@ -376,7 +377,7 @@ with gr.Blocks(css=css) as demo:
|
|
376 |
|
377 |
with gr.Row():
|
378 |
with gr.Column():
|
379 |
-
image_input = gr.Image(type="
|
380 |
png_button = gr.Button("Get Info")
|
381 |
with gr.Row():
|
382 |
with gr.Column():
|
@@ -390,9 +391,9 @@ with gr.Blocks(css=css) as demo:
|
|
390 |
steps, seed, model, sampler,
|
391 |
width, height, cfg_scale],
|
392 |
concurrency_limit=64)
|
393 |
-
send_to_png.click(send_to_img2img_def, inputs=
|
394 |
-
send_to_img2img_png.click(send_to_img2img_def, inputs=
|
395 |
-
send_to_png_i2i.click(send_to_img2img_def, inputs=
|
396 |
with gr.Tab("HuggingFace Inference"):
|
397 |
with gr.Row():
|
398 |
gr.Markdown("Add your model from HF.co, enter model ID.")
|
|
|
220 |
progress(0.75, desc="Opening image")
|
221 |
job = prodia_client.wait(result)
|
222 |
progress(0.99, desc="Sending image")
|
223 |
+
return [job["imageUrl"]], job["imageUrl"]
|
224 |
|
225 |
|
226 |
def img2img(input_image, denoising, prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed, progress=gr.Progress()):
|
|
|
247 |
job = prodia_client.wait(result)
|
248 |
progress(0.99, desc="Sending image")
|
249 |
time.sleep(0.5)
|
250 |
+
return [job["imageUrl"]], job["imageUrl"]
|
251 |
|
252 |
|
253 |
css = """
|
|
|
296 |
seed = gr.Number(label="Seed", value=-1)
|
297 |
|
298 |
with gr.Column(scale=2):
|
299 |
+
image_output = gr.Gallery(show_label=False, rows=2)
|
300 |
send_to_img2img = gr.Button(value="Send OUTPUT IMAGE to img2img")
|
301 |
send_to_png = gr.Button(value="Send OUTPUT IMAGE to PNG Info")
|
302 |
+
past_url = gr.Textbox(visible=False, interactive=False)
|
303 |
|
304 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height,
|
305 |
+
seed], outputs=[image_output, past_url], concurrency_limit=64)
|
306 |
|
307 |
with gr.Tab("img2img", id='i2i'):
|
308 |
with gr.Row():
|
|
|
316 |
with gr.Row():
|
317 |
with gr.Column(scale=3):
|
318 |
with gr.Tab("Generation"):
|
319 |
+
i2i_image_input = gr.Image(type="filepath", interactive=True)
|
320 |
|
321 |
with gr.Row():
|
322 |
with gr.Column(scale=1):
|
|
|
340 |
i2i_seed = gr.Number(label="Seed", value=-1)
|
341 |
|
342 |
with gr.Column(scale=2):
|
343 |
+
i2i_image_output = gr.Gallery(show_label=False, rows=2)
|
344 |
send_to_png_i2i = gr.Button(value="Send INPUT IMAGE to PNG Info")
|
345 |
+
i2i_past_url = gr.Textbox(visible=False, interactive=False)
|
346 |
|
347 |
i2i_text_button.click(img2img, inputs=[i2i_image_input, i2i_denoising, i2i_prompt, i2i_negative_prompt,
|
348 |
model, i2i_steps, i2i_sampler, i2i_cfg_scale, i2i_width, i2i_height,
|
349 |
+
i2i_seed], outputs=[i2i_image_output, i2i_past_url], concurrency_limit=64)
|
350 |
+
send_to_img2img.click(send_to_img2img_def, inputs=past_url, outputs=i2i_image_input)
|
351 |
|
352 |
with gr.Tab("PNG Info"):
|
353 |
def plaintext_to_html(text, classname=None):
|
|
|
377 |
|
378 |
with gr.Row():
|
379 |
with gr.Column():
|
380 |
+
image_input = gr.Image(type="filepath", interactive=True)
|
381 |
png_button = gr.Button("Get Info")
|
382 |
with gr.Row():
|
383 |
with gr.Column():
|
|
|
391 |
steps, seed, model, sampler,
|
392 |
width, height, cfg_scale],
|
393 |
concurrency_limit=64)
|
394 |
+
send_to_png.click(send_to_img2img_def, inputs=past_url, outputs=image_input)
|
395 |
+
send_to_img2img_png.click(send_to_img2img_def, inputs=past_url, outputs=i2i_image_input)
|
396 |
+
send_to_png_i2i.click(send_to_img2img_def, inputs=i2i_past_url, outputs=image_input)
|
397 |
with gr.Tab("HuggingFace Inference"):
|
398 |
with gr.Row():
|
399 |
gr.Markdown("Add your model from HF.co, enter model ID.")
|