sayakpaul HF staff commited on
Commit
b82f6a5
·
1 Parent(s): 4eea26f

add: description.

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -13,6 +13,27 @@ from torchmetrics.image.inception import InceptionScore
13
  SEED = 0
14
  WEIGHT_DTYPE = torch.float16
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  inception_score_fn = InceptionScore(normalize=True)
18
  torch.manual_seed(SEED)
@@ -186,6 +207,7 @@ demo = gr.Interface(
186
  ],
187
  value="CompVis/stable-diffusion-v1-4",
188
  multiselect=False,
 
189
  ),
190
  gr.Dropdown(
191
  [
@@ -200,6 +222,8 @@ demo = gr.Interface(
200
  ),
201
  ],
202
  outputs=[gr.Markdown().style()],
 
 
203
  allow_flagging=False,
204
  )
205
  demo.launch()
 
13
  SEED = 0
14
  WEIGHT_DTYPE = torch.float16
15
 
16
+ TITLE = "Evaluate Schedulers with StableDiffusionPipeline 🧨"
17
+ DESCRIPTION = """
18
+ This Space allows you to quantitatively compare different noise schedulers with a [`StableDiffusionPipeline`](https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/overview).
19
+
20
+ One of the applications of this Space could be to evaluate different schedulers for a certain Stable Diffusion checkpoint for fixed number of inference steps.
21
+
22
+ Here's how it works:
23
+
24
+ * The users provides:
25
+ * An input prompt.
26
+ * Number of images to generate with the prompt.
27
+ * A checkpoint path compatible with `StableDiffusionPipeline`. You can either select one from the drop-down list or provide a valid path ("valhalla/sd-pokemon-model" for example).
28
+ * Names of the schedulers to evaluate.
29
+ * The evaluator first sets a seed and then generates the initial noise which is passed as the initial latent to start the image generation process. It is done to ensure fair comparison.
30
+ * This initial latent is used every time the pipeline is run (with different schedulers).
31
+ * To quantify the quality of the generated images we use:
32
+ * [Inception Score](https://en.wikipedia.org/wiki/Inception_score)
33
+ * [Clip Score](https://arxiv.org/abs/2104.08718)
34
+
35
+ """
36
+
37
 
38
  inception_score_fn = InceptionScore(normalize=True)
39
  torch.manual_seed(SEED)
 
207
  ],
208
  value="CompVis/stable-diffusion-v1-4",
209
  multiselect=False,
210
+ interactive=True,
211
  ),
212
  gr.Dropdown(
213
  [
 
222
  ),
223
  ],
224
  outputs=[gr.Markdown().style()],
225
+ title=TITLE,
226
+ description=DESCRIPTION,
227
  allow_flagging=False,
228
  )
229
  demo.launch()