hysts HF Staff commited on
Commit
1d2a6dd
·
1 Parent(s): b2a74a5
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -63,6 +63,10 @@ def infer(
63
  return image, seed
64
 
65
 
 
 
 
 
66
  examples = [
67
  "a tiny astronaut hatching from an egg on the moon",
68
  "a cat holding a sign that says hello world",
@@ -139,11 +143,9 @@ with gr.Blocks(css=css) as demo:
139
 
140
  gr.Examples(
141
  examples=examples,
142
- fn=infer,
143
  inputs=prompt,
144
  outputs=[result, seed],
145
- cache_examples=True,
146
- cache_mode="lazy",
147
  )
148
 
149
  prompt.submit(
 
63
  return image, seed
64
 
65
 
66
+ def run_example(prompt: str) -> tuple[PIL.Image.Image, int]:
67
+ return infer(prompt, seed=42, randomize_seed=False)
68
+
69
+
70
  examples = [
71
  "a tiny astronaut hatching from an egg on the moon",
72
  "a cat holding a sign that says hello world",
 
143
 
144
  gr.Examples(
145
  examples=examples,
146
+ fn=run_example,
147
  inputs=prompt,
148
  outputs=[result, seed],
 
 
149
  )
150
 
151
  prompt.submit(