Spaces:
Runtime error
Runtime error
Commit
·
e34dfbf
1
Parent(s):
b50ae09
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,13 +139,35 @@ def infer(prompt, negative_prompt, image):
|
|
| 139 |
with gr.Blocks(theme='gradio/soft') as demo:
|
| 140 |
gr.Markdown("## Stable Diffusion with Hand Control")
|
| 141 |
|
| 142 |
-
with gr.
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
demo.launch()
|
|
|
|
| 139 |
with gr.Blocks(theme='gradio/soft') as demo:
|
| 140 |
gr.Markdown("## Stable Diffusion with Hand Control")
|
| 141 |
|
| 142 |
+
with gr.Row():
|
| 143 |
+
with gr.Column():
|
| 144 |
+
prompt_input = gr.Textbox(label="Prompt")
|
| 145 |
+
negative_prompt = gr.Textbox(label="Negative Prompt")
|
| 146 |
+
input_image = gr.Image(label="Input Image")
|
| 147 |
+
# output_image = gr.Gallery(label='Output Image', show_label=False, elem_id="gallery").style(grid=3, height='auto')
|
| 148 |
+
submit_btn = gr.Button(value = "Submit")
|
| 149 |
+
# inputs = [prompt_input, negative_prompt, input_image]
|
| 150 |
+
# submit_btn.click(fn=infer, inputs=inputs, outputs=[output_image])
|
| 151 |
+
|
| 152 |
+
gr.Markdown("### Image Examples")
|
| 153 |
+
gr.Examples(
|
| 154 |
+
examples=[
|
| 155 |
+
[
|
| 156 |
+
"a woman is making an ok sign in front of a painting",
|
| 157 |
+
"longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
|
| 158 |
+
"example.png"
|
| 159 |
+
],
|
| 160 |
+
],
|
| 161 |
+
inputs=[prompt_input, negative_prompt, input_image],
|
| 162 |
+
outputs=[output_image],
|
| 163 |
+
fn=infer,
|
| 164 |
+
cache_examples=True,
|
| 165 |
+
)
|
| 166 |
+
|
| 167 |
+
with gr.Column():
|
| 168 |
+
output_image = gr.Gallery(label='Output Image', show_label=False, elem_id="gallery").style(grid=3, height='auto')
|
| 169 |
+
|
| 170 |
+
inputs = [prompt_input, negative_prompt, input_image]
|
| 171 |
+
submit_btn.click(fn=infer, inputs=inputs, outputs=[output_image])
|
| 172 |
|
| 173 |
demo.launch()
|