Spaces:
Runtime error
Runtime error
Add sample images
Browse files- app.py +14 -11
- samples/ddpm-128-exp000-ddim-20steps.png +3 -0
app.py
CHANGED
@@ -13,23 +13,26 @@ DESCRIPTION = 'Expected execution time on Hugging Face Spaces: 5s (DDIM, 20 step
|
|
13 |
FOOTER = '<img id="visitor-badge" src="https://visitor-badge.glitch.me/badge?page_id=hysts.diffusers-anime-faces" alt="visitor badge" />'
|
14 |
|
15 |
|
16 |
-
def get_sample_image_url(
|
17 |
sample_image_dir = 'https://huggingface.co/spaces/hysts/diffusers-anime-faces/resolve/main/samples'
|
18 |
-
return f'{sample_image_dir}/{
|
19 |
|
20 |
|
21 |
def get_sample_image_markdown(name: str) -> str:
|
22 |
model_name = name.split()[0]
|
23 |
-
url = get_sample_image_url(model_name)
|
24 |
if name == 'ddpm-128-exp000 (DDPM)':
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
- scheduler: DDPM
|
29 |
-
|
30 |
-
![sample images]({url})'''
|
31 |
else:
|
32 |
raise ValueError
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
return text
|
34 |
|
35 |
|
@@ -90,10 +93,10 @@ def main():
|
|
90 |
with gr.Row():
|
91 |
model_name2 = gr.Dropdown([
|
92 |
'ddpm-128-exp000 (DDPM)',
|
|
|
93 |
],
|
94 |
value='ddpm-128-exp000 (DDPM)',
|
95 |
-
label='Model'
|
96 |
-
interactive=False)
|
97 |
with gr.Row():
|
98 |
text = get_sample_image_markdown(model_name2.value)
|
99 |
sample_images = gr.Markdown(text)
|
|
|
13 |
FOOTER = '<img id="visitor-badge" src="https://visitor-badge.glitch.me/badge?page_id=hysts.diffusers-anime-faces" alt="visitor badge" />'
|
14 |
|
15 |
|
16 |
+
def get_sample_image_url(file_name: str) -> str:
|
17 |
sample_image_dir = 'https://huggingface.co/spaces/hysts/diffusers-anime-faces/resolve/main/samples'
|
18 |
+
return f'{sample_image_dir}/{file_name}'
|
19 |
|
20 |
|
21 |
def get_sample_image_markdown(name: str) -> str:
|
22 |
model_name = name.split()[0]
|
|
|
23 |
if name == 'ddpm-128-exp000 (DDPM)':
|
24 |
+
file_name = f'{model_name}.png'
|
25 |
+
elif name == 'ddpm-128-exp000 (DDIM, 20 steps)':
|
26 |
+
file_name = f'{model_name}-ddim-20steps.png'
|
|
|
|
|
|
|
27 |
else:
|
28 |
raise ValueError
|
29 |
+
url = get_sample_image_url(file_name)
|
30 |
+
text = f'''
|
31 |
+
- size: 128x128
|
32 |
+
- seed: 0-99
|
33 |
+
- scheduler: DDPM
|
34 |
+
|
35 |
+
![sample images]({url})'''
|
36 |
return text
|
37 |
|
38 |
|
|
|
93 |
with gr.Row():
|
94 |
model_name2 = gr.Dropdown([
|
95 |
'ddpm-128-exp000 (DDPM)',
|
96 |
+
'ddpm-128-exp000 (DDIM, 20 steps)',
|
97 |
],
|
98 |
value='ddpm-128-exp000 (DDPM)',
|
99 |
+
label='Model')
|
|
|
100 |
with gr.Row():
|
101 |
text = get_sample_image_markdown(model_name2.value)
|
102 |
sample_images = gr.Markdown(text)
|
samples/ddpm-128-exp000-ddim-20steps.png
ADDED
Git LFS Details
|