Maximofn commited on
Commit
490f3d3
·
1 Parent(s): e07fcea

Remove load_example_video function and update example prompts with direct video paths

Browse files
Files changed (1) hide show
  1. app.py +10 -15
app.py CHANGED
@@ -115,13 +115,6 @@ def generate_video(transformer_model, prompt, negative_prompt, num_frames, heigh
115
  print("Saving video")
116
  return save_video(video_frames)
117
 
118
- def load_example_video(example_index, *args):
119
- """Carga un video de ejemplo desde la carpeta example_outputs"""
120
- example_path = f"example_outputs/example_{example_index}.mp4"
121
- if os.path.exists(example_path):
122
- return example_path
123
- return None
124
-
125
  def create_interface():
126
  """Create and configure the Gradio interface"""
127
  with gr.Blocks() as demo:
@@ -193,25 +186,29 @@ def create_interface():
193
  "sayakpaul/pika-dissolve-v0",
194
  "PIKA_DISSOLVE A slender glass vase, brimming with tiny white pebbles, stands centered on a polished ebony dais. Without warning, the glass begins to dissolve from the edges inward. Wisps of translucent dust swirl upward in an elegant spiral, illuminating each pebble as they drop onto the dais. The gently drifting dust eventually settles, leaving only the scattered stones and faint traces of shimmering powder on the stage.",
195
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
196
- 50, 512, 512, 50
 
197
  ],
198
  [
199
  "finetrainers/crush-smol-v0",
200
  "DIFF_crush A thick burger is placed on a dining table, and a large metal cylinder descends from above, crushing the burger as if it were under a hydraulic press. The bulb is crushed, leaving a pile of debris around it.",
201
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
202
- 50, 512, 512, 50
 
203
  ],
204
  [
205
  "finetrainers/3dgs-v0",
206
  "3D_dissolve In a 3D appearance, a bookshelf filled with books is surrounded by a burst of red sparks, creating a dramatic and explosive effect against a black background.",
207
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
208
- 50, 512, 512, 50
 
209
  ],
210
  [
211
  "finetrainers/cakeify-v0",
212
  "PIKA_CAKEIFY On a gleaming glass display stand, a sleek black purse quietly commands attention. Suddenly, a knife appears and slices through the shoe, revealing a fluffy vanilla sponge at its core. Immediately, it turns into a hyper-realistic prop cake, delighting the senses with its playful juxtaposition of the everyday and the extraordinary.",
213
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
214
- 50, 512, 512, 50
 
215
  ]
216
  ],
217
  inputs=[
@@ -221,11 +218,9 @@ def create_interface():
221
  num_frames,
222
  height,
223
  width,
224
- num_inference_steps
 
225
  ],
226
- outputs=video_output,
227
- fn=load_example_video,
228
- cache_examples=True,
229
  label="Prompt Examples"
230
  )
231
 
 
115
  print("Saving video")
116
  return save_video(video_frames)
117
 
 
 
 
 
 
 
 
118
  def create_interface():
119
  """Create and configure the Gradio interface"""
120
  with gr.Blocks() as demo:
 
186
  "sayakpaul/pika-dissolve-v0",
187
  "PIKA_DISSOLVE A slender glass vase, brimming with tiny white pebbles, stands centered on a polished ebony dais. Without warning, the glass begins to dissolve from the edges inward. Wisps of translucent dust swirl upward in an elegant spiral, illuminating each pebble as they drop onto the dais. The gently drifting dust eventually settles, leaving only the scattered stones and faint traces of shimmering powder on the stage.",
188
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
189
+ 50, 512, 512, 50,
190
+ "example_outputs/pika-dissolve-v0.mp4"
191
  ],
192
  [
193
  "finetrainers/crush-smol-v0",
194
  "DIFF_crush A thick burger is placed on a dining table, and a large metal cylinder descends from above, crushing the burger as if it were under a hydraulic press. The bulb is crushed, leaving a pile of debris around it.",
195
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
196
+ 50, 512, 512, 50,
197
+ "example_outputs/crush-smol-v0.mp4"
198
  ],
199
  [
200
  "finetrainers/3dgs-v0",
201
  "3D_dissolve In a 3D appearance, a bookshelf filled with books is surrounded by a burst of red sparks, creating a dramatic and explosive effect against a black background.",
202
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
203
+ 50, 512, 512, 50,
204
+ "example_outputs/3dgs-v0.mp4"
205
  ],
206
  [
207
  "finetrainers/cakeify-v0",
208
  "PIKA_CAKEIFY On a gleaming glass display stand, a sleek black purse quietly commands attention. Suddenly, a knife appears and slices through the shoe, revealing a fluffy vanilla sponge at its core. Immediately, it turns into a hyper-realistic prop cake, delighting the senses with its playful juxtaposition of the everyday and the extraordinary.",
209
  "inconsistent motion, blurry motion, worse quality, degenerate outputs, deformed outputs",
210
+ 50, 512, 512, 50,
211
+ "example_outputs/cakeify-v0.mp4"
212
  ]
213
  ],
214
  inputs=[
 
218
  num_frames,
219
  height,
220
  width,
221
+ num_inference_steps,
222
+ video_output,
223
  ],
 
 
 
224
  label="Prompt Examples"
225
  )
226