bo.l commited on
Commit
58b61fb
·
1 Parent(s): 6e1abe1

update demo

Browse files
.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
- examples = [
123
- "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.",
124
- "An astronaut riding a green horse",
125
- "A delicious ceviche cheesecake slice",
 
 
 
 
 
 
 
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
- gr.Examples(examples=[[e] for e in examples], inputs=[prompt])
 
 
 
 
 
 
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

  • SHA256: 5be9e8504e353bd50878b421a6c3819ff570c1302344b50c3037b7b989e3f4b1
  • Pointer size: 131 Bytes
  • Size of remote file: 330 kB
assets/-1KG_J6e_src2.png ADDED

Git LFS Details

  • SHA256: 1269c7770389c53fe8535fdf689f30a39dfaa3c111312f59a971761ef0d4476b
  • Pointer size: 131 Bytes
  • Size of remote file: 310 kB
assets/BgYeqlzB_src1.png ADDED

Git LFS Details

  • SHA256: d8b6e62d24960c5fc9910408a66b1ef53be0e8cb75f09148183aa4f725373092
  • Pointer size: 131 Bytes
  • Size of remote file: 431 kB
assets/BgYeqlzB_src2.png ADDED

Git LFS Details

  • SHA256: 75161c4ddc9fc8be32842730e07650e8ad7e6196b439b3abd2ae4b376421b86f
  • Pointer size: 131 Bytes
  • Size of remote file: 234 kB
assets/H99pnBoC_src1.png ADDED

Git LFS Details

  • SHA256: 65cbb4e151c85c977e8187512c78495be3edf4087c1bc781e25e5be943e37baa
  • Pointer size: 131 Bytes
  • Size of remote file: 219 kB
assets/H99pnBoC_src2.png ADDED

Git LFS Details

  • SHA256: 783cb064a30ae3e221ca79ca2c38c14aeab36173b43a6f503d6ca751cea9b7ed
  • Pointer size: 131 Bytes
  • Size of remote file: 421 kB
assets/Uwn0WEbC_src1.png ADDED

Git LFS Details

  • SHA256: d00aa5d83e06b541ba918d7967bfd09bfa9ca558345c1afa0f9621aaf21d68dc
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
assets/Uwn0WEbC_src2.png ADDED

Git LFS Details

  • SHA256: 8ce71e733a70ed0c3bb6a4dff840203d0a57ff035e6006a59eec54c705619853
  • Pointer size: 131 Bytes
  • Size of remote file: 391 kB
assets/pmkexBUx_src1.png ADDED

Git LFS Details

  • SHA256: 2720575fa2b98c814ab04bcd90d867b7a08dd2de5e04c8079bf2e8472adad25d
  • Pointer size: 131 Bytes
  • Size of remote file: 245 kB
assets/pmkexBUx_src2.png ADDED

Git LFS Details

  • SHA256: bd64bec627a7b989107d029886e5dd5f4a61e1d5c726c0a3b7cc914977b564a7
  • Pointer size: 131 Bytes
  • Size of remote file: 183 kB