hysts HF Staff commited on
Commit
dcbba80
·
1 Parent(s): 469696e

Add duplicate space badge

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -2,6 +2,7 @@
2
 
3
  from __future__ import annotations
4
 
 
5
  import pathlib
6
  import shlex
7
  import subprocess
@@ -16,6 +17,13 @@ DESCRIPTION = '''# Plug-and-Play diffusion features
16
  This is an unofficial demo for [https://github.com/MichalGeyer/plug-and-play](https://github.com/MichalGeyer/plug-and-play).
17
  '''
18
 
 
 
 
 
 
 
 
19
  weight_dir = pathlib.Path('plug-and-play/models/ldm/stable-diffusion-v1')
20
  if not weight_dir.exists():
21
  subprocess.run(
 
2
 
3
  from __future__ import annotations
4
 
5
+ import os
6
  import pathlib
7
  import shlex
8
  import subprocess
 
17
  This is an unofficial demo for [https://github.com/MichalGeyer/plug-and-play](https://github.com/MichalGeyer/plug-and-play).
18
  '''
19
 
20
+ if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
21
+ DESCRIPTION += f'''<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings.<br/>
22
+ <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true">
23
+ <img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
24
+ <p/>
25
+ '''
26
+
27
  weight_dir = pathlib.Path('plug-and-play/models/ldm/stable-diffusion-v1')
28
  if not weight_dir.exists():
29
  subprocess.run(