Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ def get_new_prompt(img, mode):
|
|
| 35 |
def infer(prompt, mode):
|
| 36 |
img = get_images(prompt)
|
| 37 |
result = get_new_prompt(img, mode)
|
| 38 |
-
return result[0]
|
| 39 |
|
| 40 |
with gr.Blocks() as demo:
|
| 41 |
|
|
@@ -45,11 +45,12 @@ with gr.Blocks() as demo:
|
|
| 45 |
prompt_input = gr.Textbox(lines=4, label="Input v1.x Stable Diffusion prompt")
|
| 46 |
mode_input = gr.Radio(['best', 'classic', 'fast'], label='mode', value='fast')
|
| 47 |
submit_btn = gr.Button("Submit")
|
| 48 |
-
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
submit_btn.click(
|
| 52 |
-
fn=infer, inputs=[prompt_input,mode_input], outputs=[prompt_output]
|
| 53 |
)
|
| 54 |
|
| 55 |
examples=[
|
|
@@ -62,7 +63,7 @@ with gr.Blocks() as demo:
|
|
| 62 |
examples = examples,
|
| 63 |
fn = infer,
|
| 64 |
inputs=[prompt_input,mode_input],
|
| 65 |
-
outputs=[prompt_output]
|
| 66 |
)
|
| 67 |
|
| 68 |
#demo=gr.Interface(fn=infer, inputs=[prompt_input,mode_input], outputs=[prompt_output],title=title,description=description,examples=examples)
|
|
|
|
| 35 |
def infer(prompt, mode):
|
| 36 |
img = get_images(prompt)
|
| 37 |
result = get_new_prompt(img, mode)
|
| 38 |
+
return result[0], img
|
| 39 |
|
| 40 |
with gr.Blocks() as demo:
|
| 41 |
|
|
|
|
| 45 |
prompt_input = gr.Textbox(lines=4, label="Input v1.x Stable Diffusion prompt")
|
| 46 |
mode_input = gr.Radio(['best', 'classic', 'fast'], label='mode', value='fast')
|
| 47 |
submit_btn = gr.Button("Submit")
|
| 48 |
+
with gr.Column():
|
| 49 |
+
sd_inter = gr.Image()
|
| 50 |
+
prompt_output = gr.Textbox(lines=4, label="Converted v2.x Stable Diffusion prompt")
|
| 51 |
|
| 52 |
submit_btn.click(
|
| 53 |
+
fn=infer, inputs=[prompt_input,mode_input], outputs=[prompt_output, sd_inter]
|
| 54 |
)
|
| 55 |
|
| 56 |
examples=[
|
|
|
|
| 63 |
examples = examples,
|
| 64 |
fn = infer,
|
| 65 |
inputs=[prompt_input,mode_input],
|
| 66 |
+
outputs=[prompt_output, sd_inter]
|
| 67 |
)
|
| 68 |
|
| 69 |
#demo=gr.Interface(fn=infer, inputs=[prompt_input,mode_input], outputs=[prompt_output],title=title,description=description,examples=examples)
|