Spaces:
Running
Running
Update
Browse files
app.py
CHANGED
@@ -17,9 +17,10 @@ DESCRIPTION = '# [Plug-and-Play diffusion features](https://github.com/MichalGey
|
|
17 |
|
18 |
if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
|
19 |
DESCRIPTION += f'\n<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>'
|
|
|
|
|
20 |
|
21 |
if torch.cuda.is_available():
|
22 |
-
DESCRIPTION += '\n<p>Running on GPU 🔥</p>'
|
23 |
weight_dir = pathlib.Path('plug-and-play/models/ldm/stable-diffusion-v1')
|
24 |
if not weight_dir.exists():
|
25 |
subprocess.run(
|
@@ -29,8 +30,6 @@ if torch.cuda.is_available():
|
|
29 |
shlex.split(
|
30 |
'wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O plug-and-play/models/ldm/stable-diffusion-v1/model.ckpt'
|
31 |
))
|
32 |
-
else:
|
33 |
-
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.'
|
34 |
|
35 |
with gr.Blocks(css='style.css') as demo:
|
36 |
gr.Markdown(DESCRIPTION)
|
|
|
17 |
|
18 |
if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
|
19 |
DESCRIPTION += f'\n<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>'
|
20 |
+
if not torch.cuda.is_available():
|
21 |
+
DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
|
22 |
|
23 |
if torch.cuda.is_available():
|
|
|
24 |
weight_dir = pathlib.Path('plug-and-play/models/ldm/stable-diffusion-v1')
|
25 |
if not weight_dir.exists():
|
26 |
subprocess.run(
|
|
|
30 |
shlex.split(
|
31 |
'wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O plug-and-play/models/ldm/stable-diffusion-v1/model.ckpt'
|
32 |
))
|
|
|
|
|
33 |
|
34 |
with gr.Blocks(css='style.css') as demo:
|
35 |
gr.Markdown(DESCRIPTION)
|