multimodalart HF Staff commited on
Commit
508462c
·
verified ·
1 Parent(s): 9e3b8ca

One tab per reference modality, in reading order

Browse files
Files changed (1) hide show
  1. app.py +16 -7
app.py CHANGED
@@ -375,7 +375,8 @@ load_models()
375
  INTRO = """# MiniMax-H3 · references
376
 
377
  Bring a subject, a style, a camera move or a voice, and generate video with a synchronized soundtrack in one pass.
378
- References are read **in the order below** — the video first, then the images, then the audio.
 
379
  """
380
 
381
  with gr.Blocks(title="MiniMax-H3 references") as demo:
@@ -388,11 +389,17 @@ with gr.Blocks(title="MiniMax-H3 references") as demo:
388
  lines=3,
389
  value="The character walks through a neon-lit street in the rain, humming to themselves",
390
  )
391
- video = gr.Video(label="Motion & camera reference (optional, 2–15 s)")
392
- with gr.Row():
393
- first_image = gr.Image(label="Reference image", type="filepath")
394
- second_image = gr.Image(label="Reference image", type="filepath")
395
- audio = gr.Audio(label="Voice or music reference (optional)", type="filepath")
 
 
 
 
 
 
396
  canvas = gr.Dropdown(label="Canvas", choices=list(CANVASES), value=DEFAULT_CANVAS)
397
  match = gr.Checkbox(label="Match the reference soundtrack", value=True, visible=False)
398
  duration = gr.Slider(
@@ -406,7 +413,9 @@ with gr.Blocks(title="MiniMax-H3 references") as demo:
406
 
407
  slots = [video, first_image, second_image, audio]
408
  for control in [*slots, match]:
409
- control.change(duration_controls, [*slots, match], [match, duration], show_progress="hidden")
 
 
410
 
411
  run.click(
412
  generate,
 
375
  INTRO = """# MiniMax-H3 · references
376
 
377
  Bring a subject, a style, a camera move or a voice, and generate video with a synchronized soundtrack in one pass.
378
+ Fill as many tabs as you like — references are read **in tab order**, video then images then audio, and that order is
379
+ part of the request.
380
  """
381
 
382
  with gr.Blocks(title="MiniMax-H3 references") as demo:
 
389
  lines=3,
390
  value="The character walks through a neon-lit street in the rain, humming to themselves",
391
  )
392
+ # One tab per modality, in the order the model reads them. A reference left in a tab that is not the
393
+ # open one is still part of the request — the tabs lay the slots out, they do not choose between them.
394
+ with gr.Tabs():
395
+ with gr.Tab("Video"):
396
+ video = gr.Video(label="Motion & camera, 2–15 s. Its soundtrack comes along.")
397
+ with gr.Tab("Images"):
398
+ with gr.Row():
399
+ first_image = gr.Image(label="Subject, style or scene", type="filepath")
400
+ second_image = gr.Image(label="Subject, style or scene", type="filepath")
401
+ with gr.Tab("Audio"):
402
+ audio = gr.Audio(label="A voice or a piece of music", type="filepath")
403
  canvas = gr.Dropdown(label="Canvas", choices=list(CANVASES), value=DEFAULT_CANVAS)
404
  match = gr.Checkbox(label="Match the reference soundtrack", value=True, visible=False)
405
  duration = gr.Slider(
 
413
 
414
  slots = [video, first_image, second_image, audio]
415
  for control in [*slots, match]:
416
+ control.change(
417
+ duration_controls, [*slots, match], [match, duration], show_progress="hidden", api_name=False
418
+ )
419
 
420
  run.click(
421
  generate,