Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def infer(input_image, prompt, seed=42, randomize_seed=False, guidance_scale=2.5
|
|
52 |
css="""
|
53 |
#col-container {
|
54 |
margin: 0 auto;
|
55 |
-
max-width:
|
56 |
}
|
57 |
"""
|
58 |
|
@@ -64,18 +64,20 @@ with gr.Blocks(css=css) as demo:
|
|
64 |
|
65 |
input_image = gr.Image(label="Upload the image for editing", type="pil")
|
66 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
|
69 |
-
label="
|
70 |
-
|
71 |
-
max_lines=1,
|
72 |
-
placeholder="Enter your prompt for editing (e.g., 'Remove glasses', 'Add a hat')",
|
73 |
-
container=False,
|
74 |
-
)
|
75 |
-
|
76 |
-
run_button = gr.Button("Run", scale=0)
|
77 |
-
|
78 |
-
result = gr.Image(label="Result", show_label=False)
|
79 |
|
80 |
with gr.Accordion("Advanced Settings", open=False):
|
81 |
|
@@ -103,5 +105,10 @@ with gr.Blocks(css=css) as demo:
|
|
103 |
inputs = [input_image, prompt, seed, randomize_seed, guidance_scale],
|
104 |
outputs = [result, seed]
|
105 |
)
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
demo.launch()
|
|
|
52 |
css="""
|
53 |
#col-container {
|
54 |
margin: 0 auto;
|
55 |
+
max-width: 960px;
|
56 |
}
|
57 |
"""
|
58 |
|
|
|
64 |
|
65 |
input_image = gr.Image(label="Upload the image for editing", type="pil")
|
66 |
with gr.Row():
|
67 |
+
with gr.Column():
|
68 |
+
prompt = gr.Text(
|
69 |
+
label="Prompt",
|
70 |
+
show_label=False,
|
71 |
+
max_lines=1,
|
72 |
+
placeholder="Enter your prompt for editing (e.g., 'Remove glasses', 'Add a hat')",
|
73 |
+
container=False,
|
74 |
+
)
|
75 |
+
|
76 |
+
run_button = gr.Button("Run", scale=0)
|
77 |
|
78 |
+
with gr.Column():
|
79 |
+
result = gr.Image(label="Result", show_label=False)
|
80 |
+
reuse_button = gr.Button("Reuse this image", scale=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
with gr.Accordion("Advanced Settings", open=False):
|
83 |
|
|
|
105 |
inputs = [input_image, prompt, seed, randomize_seed, guidance_scale],
|
106 |
outputs = [result, seed]
|
107 |
)
|
108 |
+
reuse_button.click(
|
109 |
+
fn = lambda image: image,
|
110 |
+
inputs = [result],
|
111 |
+
outputs = [input_image]
|
112 |
+
)
|
113 |
|
114 |
demo.launch()
|