multimodalart HF Staff commited on
Commit
4218146
·
verified ·
1 Parent(s): e97569c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -36,7 +36,7 @@ pipe.to(device=device, dtype=torch_dtype)
36
  MAX_SEED = np.iinfo(np.int32).max
37
 
38
  @spaces.GPU
39
- def infer(prompt, seed, randomize_seed, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
40
  prompt_template = f"A side by side 4 frame image showing consecutive stills from a looped gif moving from left to right. The gif is {prompt}"
41
  if randomize_seed:
42
  seed = random.randint(0, MAX_SEED)
@@ -56,9 +56,9 @@ def infer(prompt, seed, randomize_seed, num_inference_steps, progress=gr.Progres
56
  return gif_name, gr.update(value=image, visible=True), seed
57
 
58
  examples = [
59
- "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
60
- "An astronaut riding a green horse",
61
- "A delicious ceviche cheesecake slice",
62
  ]
63
 
64
  css="""
@@ -113,7 +113,10 @@ with gr.Blocks(css=css) as demo:
113
 
114
  gr.Examples(
115
  examples = examples,
116
- inputs = [prompt]
 
 
 
117
  )
118
  gr.on(
119
  triggers=[run_button.click, prompt.submit],
 
36
  MAX_SEED = np.iinfo(np.int32).max
37
 
38
  @spaces.GPU
39
+ def infer(prompt, seed=42, randomize_seed=False, num_inference_steps=8, progress=gr.Progress(track_tqdm=True)):
40
  prompt_template = f"A side by side 4 frame image showing consecutive stills from a looped gif moving from left to right. The gif is {prompt}"
41
  if randomize_seed:
42
  seed = random.randint(0, MAX_SEED)
 
56
  return gif_name, gr.update(value=image, visible=True), seed
57
 
58
  examples = [
59
+ "a cute cat raising their paws in the air and waving hello. There is a sign over the cat's head that says "Flux does Video?!"",
60
+ "Will Smith eating pizza",
61
+ "A flying saucer over the white house",
62
  ]
63
 
64
  css="""
 
113
 
114
  gr.Examples(
115
  examples = examples,
116
+ inputs = [prompt],
117
+ outputs = [result, result_full, seed],
118
+ fn=infer,
119
+ cache_examples="lazy"
120
  )
121
  gr.on(
122
  triggers=[run_button.click, prompt.submit],