ljzycmd commited on
Commit
18438f3
β€’
1 Parent(s): b7d4a35

Update README.md

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import numpy as np
3
  import torch
@@ -16,18 +17,16 @@ from gradio_app.real_image_editing_app import create_demo_editing
16
  from gradio_app.app_utils import global_context
17
 
18
 
19
- TITLE = "# [MasaCtrl](https://ljzycmd.github.io/projects/MasaCtrl/)"
20
- DESCRIPTION = "<b>Gradio demo for MasaCtrl</b>: [[GitHub]](https://github.com/TencentARC/MasaCtrl), \
21
- [[Paper]](https://arxiv.org/abs/2304.08465). \
22
- If MasaCtrl is helpful, please help to ⭐ the [Github Repo](https://github.com/TencentARC/MasaCtrl) 😊 </p>"
23
-
24
- DESCRIPTION += '<p>For faster inference without waiting in queue, \
25
- you may duplicate the space and upgrade to GPU in settings. </p>'
26
-
27
 
28
  with gr.Blocks(css="style.css") as demo:
29
  gr.Markdown(TITLE)
30
- gr.Markdown(DESCRIPTION)
31
  model_path_gr = gr.Dropdown(
32
  ["andite/anything-v4.0",
33
  "CompVis/stable-diffusion-v1-4",
 
1
+ import os
2
  import gradio as gr
3
  import numpy as np
4
  import torch
 
17
  from gradio_app.app_utils import global_context
18
 
19
 
20
+ SPACE_ID = os.getenv('SPACE_ID')
21
+ TITLE = '# [MasaCtrl](https://ljzycmd.github.io/projects/MasaCtrl/)</h1>'
22
+ DESCRIPTION = '<div align="center">'
23
+ DESCRIPTION += f'<p>Gradio demo for MasaCtrl: <a href="https://github.com/TencentARC/MasaCtrl">[Github]</a>, <a href="https://arxiv.org/abs/2304.08465">[Paper]</a>. If MasaCtrl is helpful, please help to ⭐ the <a href="https://github.com/TencentARC/MasaCtrl">Github Repo</a> 😊</p>'
24
+ DESCRIPTION += f'<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></a></p>'
25
+ DESCRIPTION += '</div>'
 
 
26
 
27
  with gr.Blocks(css="style.css") as demo:
28
  gr.Markdown(TITLE)
29
+ gr.HTML(DESCRIPTION)
30
  model_path_gr = gr.Dropdown(
31
  ["andite/anything-v4.0",
32
  "CompVis/stable-diffusion-v1-4",