hysts HF staff commited on
Commit
ea424ac
1 Parent(s): 70d5056

Add sample images

Browse files
Files changed (2) hide show
  1. app.py +14 -11
  2. 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(name: str) -> str:
17
  sample_image_dir = 'https://huggingface.co/spaces/hysts/diffusers-anime-faces/resolve/main/samples'
18
- return f'{sample_image_dir}/{name}.png'
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
- text = f'''
26
- - size: 128x128
27
- - seed: 0-99
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

  • SHA256: 1d7fd7bfd9993c5d98d4d5860cf865b959b39fd33e2a9b9a21d1dbfaa1338351
  • Pointer size: 132 Bytes
  • Size of remote file: 3.2 MB