Spaces:
Running
on
Zero
Running
on
Zero
bo.l
commited on
Commit
·
58b61fb
1
Parent(s):
6e1abe1
update demo
Browse files- .gitattributes +1 -0
- app.py +19 -13
- assets/-1KG_J6e_src1.png +3 -0
- assets/-1KG_J6e_src2.png +3 -0
- assets/BgYeqlzB_src1.png +3 -0
- assets/BgYeqlzB_src2.png +3 -0
- assets/H99pnBoC_src1.png +3 -0
- assets/H99pnBoC_src2.png +3 -0
- assets/Uwn0WEbC_src1.png +3 -0
- assets/Uwn0WEbC_src2.png +3 -0
- assets/pmkexBUx_src1.png +3 -0
- assets/pmkexBUx_src2.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
assets/*.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -119,19 +119,19 @@ def infer(
|
|
| 119 |
# ---------------------------
|
| 120 |
# UI
|
| 121 |
# ---------------------------
|
| 122 |
-
|
| 123 |
-
"
|
| 124 |
-
|
| 125 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
]
|
| 127 |
|
| 128 |
-
css = """
|
| 129 |
-
#col-container {
|
| 130 |
-
margin: 0 auto;
|
| 131 |
-
max-width: 640px;
|
| 132 |
-
}
|
| 133 |
-
"""
|
| 134 |
-
|
| 135 |
with gr.Blocks(css=css) as demo:
|
| 136 |
with gr.Column(elem_id="col-container"):
|
| 137 |
gr.Markdown("# Multi Ref Edit Demo")
|
|
@@ -195,7 +195,13 @@ with gr.Blocks(css=css) as demo:
|
|
| 195 |
value=28,
|
| 196 |
)
|
| 197 |
|
| 198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
# 注意:不要把 [ref1, ref2] 当作列表传给 inputs!
|
| 201 |
gr.on(
|
|
@@ -216,4 +222,4 @@ with gr.Blocks(css=css) as demo:
|
|
| 216 |
)
|
| 217 |
|
| 218 |
if __name__ == "__main__":
|
| 219 |
-
demo.launch()
|
|
|
|
| 119 |
# ---------------------------
|
| 120 |
# UI
|
| 121 |
# ---------------------------
|
| 122 |
+
example_triples = [
|
| 123 |
+
["assets/-1KG_J6e_src1.png", "assets/-1KG_J6e_src2.png",
|
| 124 |
+
"Transform the first image (pizza) into an oil painting style, using the warm and textured brushstrokes, color gradients, and artistic composition observed in the second image (stone house painting)."],
|
| 125 |
+
["assets/BgYeqlzB_src1.png", "assets/pmkexBUx_src2.png",
|
| 126 |
+
"Place the butterfly from the first image onto the landscape of the second image, positioning it either flying above the river near the bridge or perched on one of the trees in the foreground. Adjust the butterfly's size and blending to ensure it fits naturally in the scene."],
|
| 127 |
+
["assets/H99pnBoC_src1.png", "assets/H99pnBoC_src2.png",
|
| 128 |
+
"Insert the person from the first image into the autumn park setting of the second image. Position them standing next to the person on the bench and have them interact by tipping their hat in greeting."],
|
| 129 |
+
["assets/pmkexBUx_src1.png", "assets/pmkexBUx_src2.png",
|
| 130 |
+
"Place the person wearing a wide-brimmed hat and beige scarf/shawl from the first image onto the mountain ridge in the second image. Position them as if standing on the ridge, facing the valley view, to create an immersive outdoors scene."],
|
| 131 |
+
["assets/Uwn0WEbC_src1.png", "assets/Uwn0WEbC_src2.png",
|
| 132 |
+
"Change the clothing of the person in the first image to match the attire shown in the second image, ensuring the details of the dress, including the blue bodice, white blouse, and the overall rustic aesthetic, are faithfully replicated."]
|
| 133 |
]
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
with gr.Blocks(css=css) as demo:
|
| 136 |
with gr.Column(elem_id="col-container"):
|
| 137 |
gr.Markdown("# Multi Ref Edit Demo")
|
|
|
|
| 195 |
value=28,
|
| 196 |
)
|
| 197 |
|
| 198 |
+
# ⚠️ 这里把 inputs 的顺序改为 [ref1, ref2, prompt],示例条目也按这个顺序
|
| 199 |
+
gr.Examples(
|
| 200 |
+
examples=example_triples,
|
| 201 |
+
inputs=[ref1_comp, ref2_comp, prompt],
|
| 202 |
+
label="Examples (2 refs + prompt)",
|
| 203 |
+
# run_on_click=True, # 如果希望点示例后自动运行,可以取消注释
|
| 204 |
+
)
|
| 205 |
|
| 206 |
# 注意:不要把 [ref1, ref2] 当作列表传给 inputs!
|
| 207 |
gr.on(
|
|
|
|
| 222 |
)
|
| 223 |
|
| 224 |
if __name__ == "__main__":
|
| 225 |
+
demo.launch()
|
assets/-1KG_J6e_src1.png
ADDED
|
Git LFS Details
|
assets/-1KG_J6e_src2.png
ADDED
|
Git LFS Details
|
assets/BgYeqlzB_src1.png
ADDED
|
Git LFS Details
|
assets/BgYeqlzB_src2.png
ADDED
|
Git LFS Details
|
assets/H99pnBoC_src1.png
ADDED
|
Git LFS Details
|
assets/H99pnBoC_src2.png
ADDED
|
Git LFS Details
|
assets/Uwn0WEbC_src1.png
ADDED
|
Git LFS Details
|
assets/Uwn0WEbC_src2.png
ADDED
|
Git LFS Details
|
assets/pmkexBUx_src1.png
ADDED
|
Git LFS Details
|
assets/pmkexBUx_src2.png
ADDED
|
Git LFS Details
|