Significant commited on
Commit
bf85a4d
·
verified ·
1 Parent(s): 56ad762

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -52
app.py CHANGED
@@ -223,60 +223,62 @@ def get_example():
223
  return case
224
 
225
  ### Description and style
226
- logo = r"""
227
- <center><img src='https://photo-maker.github.io/assets/logo.png' alt='PhotoMaker logo' style="width:80px; margin-bottom:10px"></center>
228
- """
229
  title = r"""
230
- <h1 align="center">PhotoMaker V2: Improved ID Fidelity and Better Controllability than PhotoMaker V1</h1>
231
- """
232
-
233
- description = r"""
234
- <b>Official 🤗 Gradio demo</b> for <a href='https://github.com/TencentARC/PhotoMaker' target='_blank'><b>PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding</b></a>.<br>
235
- How to use PhotoMaker V2 can be found in 🎬 <a href='https://photo-maker.github.io/assets/demo_pm_v2_full.mp4' target='_blank'>this video</a> 🎬.
236
- <br>
237
- <br>
238
- For previous version of PhotoMaker, you could use our original gradio demos [PhotoMaker](https://huggingface.co/spaces/TencentARC/PhotoMaker) and [PhotoMaker-Style](https://huggingface.co/spaces/TencentARC/PhotoMaker-Style).
239
- <br>
240
- ❗️❗️❗️[<b>Important</b>] Personalization steps:<br>
241
- 1️⃣ Upload images of someone you want to customize. One image is ok, but more is better. Although we do not perform face detection, the face in the uploaded image should <b>occupy the majority of the image</b>.<br>
242
- 2️⃣ Enter a text prompt, making sure to <b>follow the class word</b> you want to customize with the <b>trigger word</b>: `img`, such as: `man img` or `woman img` or `girl img`.<br>
243
- 3️⃣ Choose your preferred style template.<br>
244
- 4️⃣ <b>(Optional: but new feature)</b> Select the ‘Enable Drawing Doodle...’ option and draw on the canvas<br>
245
- 5️⃣ Click the <b>Submit</b> button to start customizing.
246
- """
247
-
248
- article = r"""
249
-
250
- If PhotoMaker V2 is helpful, please help to ⭐ the <a href='https://github.com/TencentARC/PhotoMaker' target='_blank'>Github Repo</a>. Thanks!
251
- [![GitHub Stars](https://img.shields.io/github/stars/TencentARC/PhotoMaker?style=social)](https://github.com/TencentARC/PhotoMaker)
252
- ---
253
- 📝 **Citation**
254
- <br>
255
- If our work is useful for your research, please consider citing:
256
-
257
- ```bibtex
258
- @article{li2023photomaker,
259
- title={PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding},
260
- author={Li, Zhen and Cao, Mingdeng and Wang, Xintao and Qi, Zhongang and Cheng, Ming-Ming and Shan, Ying},
261
- booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
262
- year={2024}
263
- }
264
- ```
265
- 📋 **License**
266
- <br>
267
- Apache-2.0 LICENSE. Please refer to the [LICENSE file](https://huggingface.co/TencentARC/PhotoMaker/blob/main/LICENSE) for details.
268
-
269
- 📧 **Contact**
270
- <br>
271
- If you have any questions, please feel free to reach me out at <b>zhenli1031@gmail.com</b>.
272
- """
273
-
274
- tips = r"""
275
- ### Usage tips of PhotoMaker
276
- 1. Upload **more photos**of the person to be customized to **improve ID fidelty**.
277
- 2. If you find that the image quality is poor when using doodle for control, you can reduce the conditioning scale and factor of the adapter.
278
- If you have any issues, leave the issue in the discussion page of the space. For a more stable (queue-free) experience, you can duplicate the space.
279
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  # We have provided some generate examples and comparisons at: [this website]().
281
 
282
  css = '''
 
223
  return case
224
 
225
  ### Description and style
226
+ # logo = r"""
227
+ # <center><img src='https://photo-maker.github.io/assets/logo.png' alt='PhotoMaker logo' style="width:80px; margin-bottom:10px"></center>
228
+ # """
229
  title = r"""
230
+ <h1 align="center">PhotoMaker>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  """
232
+ #V2: Improved ID Fidelity and Better Controllability than PhotoMaker V1</h1>
233
+
234
+
235
+ # description = r"""
236
+ # <b>Official 🤗 Gradio demo</b> for <a href='https://github.com/TencentARC/PhotoMaker' target='_blank'><b>PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding</b></a>.<br>
237
+ # How to use PhotoMaker V2 can be found in 🎬 <a href='https://photo-maker.github.io/assets/demo_pm_v2_full.mp4' target='_blank'>this video</a> 🎬.
238
+ # <br>
239
+ # <br>
240
+ # For previous version of PhotoMaker, you could use our original gradio demos [PhotoMaker](https://huggingface.co/spaces/TencentARC/PhotoMaker) and [PhotoMaker-Style](https://huggingface.co/spaces/TencentARC/PhotoMaker-Style).
241
+ # <br>
242
+ # ❗️❗️❗️[<b>Important</b>] Personalization steps:<br>
243
+ # 1️⃣ Upload images of someone you want to customize. One image is ok, but more is better. Although we do not perform face detection, the face in the uploaded image should <b>occupy the majority of the image</b>.<br>
244
+ # 2️⃣ Enter a text prompt, making sure to <b>follow the class word</b> you want to customize with the <b>trigger word</b>: `img`, such as: `man img` or `woman img` or `girl img`.<br>
245
+ # 3️⃣ Choose your preferred style template.<br>
246
+ # 4️⃣ <b>(Optional: but new feature)</b> Select the ‘Enable Drawing Doodle...’ option and draw on the canvas<br>
247
+ # 5️⃣ Click the <b>Submit</b> button to start customizing.
248
+ # """
249
+
250
+ # article = r"""
251
+
252
+ # If PhotoMaker V2 is helpful, please help to ⭐ the <a href='https://github.com/TencentARC/PhotoMaker' target='_blank'>Github Repo</a>. Thanks!
253
+ # [![GitHub Stars](https://img.shields.io/github/stars/TencentARC/PhotoMaker?style=social)](https://github.com/TencentARC/PhotoMaker)
254
+ # ---
255
+ # 📝 **Citation**
256
+ # <br>
257
+ # If our work is useful for your research, please consider citing:
258
+
259
+ # ```bibtex
260
+ # @article{li2023photomaker,
261
+ # title={PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding},
262
+ # author={Li, Zhen and Cao, Mingdeng and Wang, Xintao and Qi, Zhongang and Cheng, Ming-Ming and Shan, Ying},
263
+ # booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
264
+ # year={2024}
265
+ # }
266
+ # ```
267
+ # 📋 **License**
268
+ # <br>
269
+ # Apache-2.0 LICENSE. Please refer to the [LICENSE file](https://huggingface.co/TencentARC/PhotoMaker/blob/main/LICENSE) for details.
270
+
271
+ # 📧 **Contact**
272
+ # <br>
273
+ # If you have any questions, please feel free to reach me out at <b>zhenli1031@gmail.com</b>.
274
+ # """
275
+
276
+ # tips = r"""
277
+ # ### Usage tips of PhotoMaker
278
+ # 1. Upload **more photos**of the person to be customized to **improve ID fidelty**.
279
+ # 2. If you find that the image quality is poor when using doodle for control, you can reduce the conditioning scale and factor of the adapter.
280
+ # If you have any issues, leave the issue in the discussion page of the space. For a more stable (queue-free) experience, you can duplicate the space.
281
+ # """
282
  # We have provided some generate examples and comparisons at: [this website]().
283
 
284
  css = '''