Spaces:
Running
on
Zero
Running
on
Zero
update gradio examples
Browse files
UltraEdit
CHANGED
@@ -1 +1 @@
|
|
1 |
-
Subproject commit
|
|
|
1 |
+
Subproject commit d47eb6c3b8a2be9eef88f09155c17e6792234968
|
app.py
CHANGED
@@ -49,6 +49,27 @@ def generate(image_mask, prompt, num_inference_steps=50, image_guidance_scale=1.
|
|
49 |
|
50 |
return image
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# image_mask_input = gr.ImageMask(label="Input Image", type="pil", brush_color="#000000", elem_id="inputmask",
|
54 |
# shape=(512, 512))
|
@@ -120,7 +141,8 @@ demo = gr.Interface(
|
|
120 |
inputs=inputs,
|
121 |
outputs=outputs,
|
122 |
description=article_html, # Add article parameter
|
123 |
-
article = html
|
|
|
124 |
)
|
125 |
|
126 |
demo.queue().launch()
|
|
|
49 |
|
50 |
return image
|
51 |
|
52 |
+
example_lists=[
|
53 |
+
|
54 |
+
[['UltraEdit/images/example_images/1-input.png','UltraEdit/images/example_images/1-mask.png','UltraEdit/images/example_images/1-merged.png'], "Add a moon in the sky", 20, 1.5, 12.5,255],
|
55 |
+
|
56 |
+
[['UltraEdit/images/example_images/1-input.png','UltraEdit/images/example_images/1-input.png','UltraEdit/images/example_images/1-input.png'], "Add a moon in the sky", 20, 1.5, 6.5,255],
|
57 |
+
|
58 |
+
[['UltraEdit/images/example_images/2-input.png','UltraEdit/images/example_images/2-mask.png','UltraEdit/images/example_images/2-merged.png'], "add cherry blossoms", 20, 1.5, 12.5,255],
|
59 |
+
|
60 |
+
[['UltraEdit/images/example_images/3-input.png','UltraEdit/images/example_images/3-mask.png','UltraEdit/images/example_images/3-merged.png'], "Please dress her in a short purple wedding dress adorned with white floral embroidery.", 20, 1.5, 6.5,255],
|
61 |
+
|
62 |
+
[['UltraEdit/images/example_images/4-input.png','UltraEdit/images/example_images/4-mask.png','UltraEdit/images/example_images/4-merged.png'], "give her a chief's headdress.", 20, 1.5, 7.5, 24555]
|
63 |
+
|
64 |
+
]
|
65 |
+
mask_ex_list = []
|
66 |
+
for exp in example_lists:
|
67 |
+
ex_dict= {}
|
68 |
+
ex_dict['background'] = exp[0][0]
|
69 |
+
ex_dict['layers'] = [exp[0][1],exp[0][2]]
|
70 |
+
ex_dict['composite'] = exp[0][2]
|
71 |
+
re_list = [ex_dict, exp[1],exp[2],exp[3],exp[4],exp[5]]
|
72 |
+
mask_ex_list.append(re_list)
|
73 |
|
74 |
# image_mask_input = gr.ImageMask(label="Input Image", type="pil", brush_color="#000000", elem_id="inputmask",
|
75 |
# shape=(512, 512))
|
|
|
141 |
inputs=inputs,
|
142 |
outputs=outputs,
|
143 |
description=article_html, # Add article parameter
|
144 |
+
article = html,
|
145 |
+
examples=mask_ex_list
|
146 |
)
|
147 |
|
148 |
demo.queue().launch()
|