multimodalart HF Staff commited on
Commit
c4170c1
verified
1 Parent(s): d957826

Start the duration slider at the 5 s the model actually generates

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -51,7 +51,9 @@ CANVASES = {
51
  }
52
  DEFAULT_CANVAS = "960x544 路 16:9 fast"
53
  FPS, FRAMES_PER_CHUNK, LATENTS_PER_CHUNK = 24, 17, 5
54
- MAX_UI_DURATION = 14
 
 
55
 
56
 
57
  def snap_frames(seconds: float) -> int:
@@ -383,7 +385,7 @@ with gr.Blocks(title="MiniMax-H3") as demo:
383
  run = gr.Button("Generate", variant="primary")
384
  with gr.Accordion("Advanced options", open=False):
385
  canvas = gr.Dropdown(label="Canvas", choices=list(CANVASES), value=DEFAULT_CANVAS)
386
- duration = gr.Slider(label="Duration (s)", minimum=2, maximum=MAX_UI_DURATION, step=1, value=5)
387
  steps = gr.Slider(label="Steps", minimum=10, maximum=40, step=1, value=28)
388
  seed = gr.Number(label="Seed", value=42, precision=0)
389
 
 
51
  }
52
  DEFAULT_CANVAS = "960x544 路 16:9 fast"
53
  FPS, FRAMES_PER_CHUNK, LATENTS_PER_CHUNK = 24, 17, 5
54
+ # MiniMax-H3 generates 5 to 15 seconds, and it is the snapped frame count that has to hold for the ceiling: 15 s is
55
+ # 360 frames, which rounds up to 362, i.e. 15.083 s, and is refused.
56
+ MIN_UI_DURATION, MAX_UI_DURATION = 5, 14
57
 
58
 
59
  def snap_frames(seconds: float) -> int:
 
385
  run = gr.Button("Generate", variant="primary")
386
  with gr.Accordion("Advanced options", open=False):
387
  canvas = gr.Dropdown(label="Canvas", choices=list(CANVASES), value=DEFAULT_CANVAS)
388
+ duration = gr.Slider(label="Duration (s)", minimum=MIN_UI_DURATION, maximum=MAX_UI_DURATION, step=1, value=5)
389
  steps = gr.Slider(label="Steps", minimum=10, maximum=40, step=1, value=28)
390
  seed = gr.Number(label="Seed", value=42, precision=0)
391