fffiloni commited on
Commit
7255ed6
·
verified ·
1 Parent(s): 9afd27b

set examples caching

Browse files
Files changed (1) hide show
  1. app_df.py +13 -7
app_df.py CHANGED
@@ -20,10 +20,11 @@ if is_shared_ui:
20
 
21
  def generate_diffusion_forced_video(
22
  prompt,
23
- model_id,
24
- resolution,
25
- num_frames,
26
  image=None,
 
 
 
 
27
  ar_step=0,
28
  causal_attention=False,
29
  causal_block_size=1,
@@ -211,12 +212,16 @@ with gr.Blocks() as demo:
211
 
212
  gr.Examples(
213
  examples = [
214
- ["A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed.", "./examples/swan.jpeg"],
215
  # ["A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed.", None],
216
- ["A sea turtle swimming near a shipwreck", "./examples/turtle.jpeg"],
217
  # ["A sea turtle swimming near a shipwreck", None],
218
  ],
219
- inputs = [prompt, image]
 
 
 
 
220
  )
221
 
222
  def set_num_frames(target_l):
@@ -285,10 +290,11 @@ with gr.Blocks() as demo:
285
  fn = generate_diffusion_forced_video,
286
  inputs = [
287
  prompt,
 
 
288
  model_id,
289
  resolution,
290
  num_frames,
291
- image,
292
  ar_step,
293
  causal_attention,
294
  causal_block_size,
 
20
 
21
  def generate_diffusion_forced_video(
22
  prompt,
 
 
 
23
  image=None,
24
+ target_length="4",
25
+ model_id="Skywork/SkyReels-V2-DF-1.3B-540P",
26
+ resolution="540P",
27
+ num_frames=97,
28
  ar_step=0,
29
  causal_attention=False,
30
  causal_block_size=1,
 
212
 
213
  gr.Examples(
214
  examples = [
215
+ ["A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed.", "./examples/swan.jpeg", "10"],
216
  # ["A graceful white swan with a curved neck and delicate feathers swimming in a serene lake at dawn, its reflection perfectly mirrored in the still water as mist rises from the surface, with the swan occasionally dipping its head into the water to feed.", None],
217
+ ["A sea turtle swimming near a shipwreck", "./examples/turtle.jpeg", "10"],
218
  # ["A sea turtle swimming near a shipwreck", None],
219
  ],
220
+ fn = generate_diffusion_forced_video,
221
+ inputs = [prompt, image, target_length],
222
+ outputs = [output_video],
223
+ cache_examples = True,
224
+ cache_mode = "lazy"
225
  )
226
 
227
  def set_num_frames(target_l):
 
290
  fn = generate_diffusion_forced_video,
291
  inputs = [
292
  prompt,
293
+ image,
294
+ target_length,
295
  model_id,
296
  resolution,
297
  num_frames,
 
298
  ar_step,
299
  causal_attention,
300
  causal_block_size,