Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,52 +16,49 @@ def create_demo():
|
|
| 16 |
gr.Markdown('Type what you want to see and the app will create images with the faces in the input while preserving body pose. Should work for multiple humans too!')
|
| 17 |
|
| 18 |
with gr.Group():
|
| 19 |
-
with gr.
|
| 20 |
-
with gr.
|
| 21 |
-
with gr.
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
object_fit="contain",
|
| 48 |
-
height="auto")
|
| 49 |
-
with gr.Accordion('Settings', open=False):
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
|
| 66 |
|
| 67 |
with gr.Accordion('How does it work?', open=False):
|
|
|
|
| 16 |
gr.Markdown('Type what you want to see and the app will create images with the faces in the input while preserving body pose. Should work for multiple humans too!')
|
| 17 |
|
| 18 |
with gr.Group():
|
| 19 |
+
with gr.Column():
|
| 20 |
+
with gr.Row() as main_blocks:
|
| 21 |
+
with gr.Column() as input_step:
|
| 22 |
+
gr.Markdown('# Input')
|
| 23 |
+
with gr.Tab("Upload Image"):
|
| 24 |
+
image_upload = gr.Image(sources='upload',
|
| 25 |
+
height=500,
|
| 26 |
+
type='pil',#numpy',
|
| 27 |
+
elem_classes="image_upload",
|
| 28 |
+
label='Image Upload')
|
| 29 |
+
with gr.Tab("Webcam"):
|
| 30 |
+
image_cam = gr.Image(sources='webcam',
|
| 31 |
+
height=500,
|
| 32 |
+
type='pil',#numpy',
|
| 33 |
+
elem_classes="image_upload",
|
| 34 |
+
label='Webcam')
|
| 35 |
+
prompt = gr.Textbox(value="Astronaut, photograph inside the ISS International Space Station corridor", label="Prompt:")
|
| 36 |
+
send_button = gr.Button(value='Generate')
|
| 37 |
+
|
| 38 |
+
with gr.Column() as output_step:
|
| 39 |
+
gr.Markdown('# Output')
|
| 40 |
+
output_image = gr.Gallery(label="Generated images",
|
| 41 |
+
show_label=False,
|
| 42 |
+
preview=True,
|
| 43 |
+
elem_id="output_image",
|
| 44 |
+
object_fit="contain",
|
| 45 |
+
height="auto")
|
| 46 |
+
with gr.Accordion('Settings', open=False):
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
num_steps = gr.Slider(label='Steps',
|
| 49 |
+
minimum=1,
|
| 50 |
+
maximum=100,
|
| 51 |
+
value=25,
|
| 52 |
+
step=1)
|
| 53 |
+
n_prompt = gr.Textbox(value="", label="Negative Prompt: Avoid these features in the image...")
|
| 54 |
+
original_resolution=gr.Checkbox(value=False,
|
| 55 |
+
label="Preserve Resolution",
|
| 56 |
+
info="Prevent Downscaling to 512 pixels (default)")
|
| 57 |
+
seed = gr.Slider(label='Seed',
|
| 58 |
+
minimum=-1,
|
| 59 |
+
maximum=2147483647,
|
| 60 |
+
step=1,
|
| 61 |
+
randomize=True)
|
| 62 |
|
| 63 |
|
| 64 |
with gr.Accordion('How does it work?', open=False):
|