hysts HF Staff commited on
Commit
d2d62f5
·
1 Parent(s): da11108
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -58,6 +58,10 @@ def infer(
58
  return image, seed
59
 
60
 
 
 
 
 
61
  examples = [
62
  "a tiny astronaut hatching from an egg on the moon",
63
  "a cat holding a sign that says hello world",
@@ -126,11 +130,9 @@ with gr.Blocks(css=css) as demo:
126
 
127
  gr.Examples(
128
  examples=examples,
129
- fn=infer,
130
  inputs=prompt,
131
  outputs=[result, seed],
132
- cache_examples=True,
133
- cache_mode="lazy",
134
  )
135
 
136
  prompt.submit(
 
58
  return image, seed
59
 
60
 
61
+ def run_example(prompt: str) -> tuple[PIL.Image.Image, int]:
62
+ return infer(prompt, seed=42, randomize_seed=False)
63
+
64
+
65
  examples = [
66
  "a tiny astronaut hatching from an egg on the moon",
67
  "a cat holding a sign that says hello world",
 
130
 
131
  gr.Examples(
132
  examples=examples,
133
+ fn=run_example,
134
  inputs=prompt,
135
  outputs=[result, seed],
 
 
136
  )
137
 
138
  prompt.submit(