Spaces:
Running on Zero
Running on Zero
Mirror the generator's title, theme and advanced-options layout
Browse files51 unmodified lines52535455565758253 unmodified lines31231331431431531631731831932032132231531631731831932032132232332432532646 unmodified lines37337437537537637737737837937837938038138238338438538638738838939039139239339417 unmodified lines41241341440340440540640740840941541641741841942042142242342442542642712 unmodified lines44044144242944351 unmodified lines "544x960 · 9:16 fast": (960, 544), "640x1152 · 9:16": (1152, 640), "768x1344 · 9:16 full": (1344, 768), "544x544 · 1:1 fast": (544, 544), "768x768 · 1:1 full": (768, 768), "1024x768 · 4:3 full": (768, 1024), "768x1024 · 3:4 full": (1024, 768),253 unmodified lines
def generate( prompt, video_path, first_image_path, second_image_path, audio_path, canvas, match, duration, steps, seed, video_path=None, first_image_path=None, second_image_path=None, audio_path=None, canvas=DEFAULT_CANVAS, match=True, duration=5, steps=28, seed=42, progress=gr.Progress(track_tqdm=True),): if LOAD_ERROR:46 unmodified lines
load_models()
INTRO = """# MiniMax-H3 · referencesINTRO = """# MiniMax-H3
Bring a subject, a style, a camera move or a voice, and generate video with a synchronized soundtrack in one pass.Fill as many tabs as you like — references are read **in tab order**, video then images then audio, and that order ispart of the request.<div align="center"> <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3"><strong>[ model ]</strong></a> <a href="PAPER_URL_PLACEHOLDER"><strong>[ paper ]</strong></a> <a href="https://www.minimax.io"><strong>[ project ]</strong></a></div>
**MiniMax-H3** is a 33B parameter state of the art video generation model that produces video and afully synchronized soundtrack (ambience, foley, speech). Bring your own subject, camera move or voice as areference — they are read **in tab order**, video then images then audio."""
CSS = """#col-container { max-width: 1180px; margin: 0 auto; }.dark .gradio-container { color: var(--body-text-color); }"""
with gr.Blocks(title="MiniMax-H3 references") as demo:17 unmodified lines second_image = gr.Image(label="Subject, style or scene", type="filepath") with gr.Tab("Audio"): audio = gr.Audio(label="A voice or a piece of music", type="filepath") canvas = gr.Dropdown(label="Canvas", choices=list(CANVASES), value=DEFAULT_CANVAS) match = gr.Checkbox(label="Match the reference soundtrack", value=True, visible=False) duration = gr.Slider( label="Duration (s)", minimum=MIN_DURATION, maximum=MAX_UI_DURATION, step=1, value=5 ) steps = gr.Slider(label="Steps", minimum=10, maximum=40, step=1, value=28) seed = gr.Number(label="Seed", value=42, precision=0) run = gr.Button("Generate", variant="primary") with gr.Accordion("Advanced options", open=False): canvas = gr.Dropdown(label="Canvas", choices=list(CANVASES), value=DEFAULT_CANVAS) match = gr.Checkbox(label="Match the reference soundtrack", value=True, visible=False) duration = gr.Slider( label="Duration (s)", minimum=MIN_DURATION, maximum=MAX_UI_DURATION, step=1, value=5 ) steps = gr.Slider(label="Steps", minimum=10, maximum=40, step=1, value=28) seed = gr.Number(label="Seed", value=42, precision=0)
with gr.Column(): result = gr.Video(label="Video + soundtrack")
12 unmodified lines
if __name__ == "__main__": demo.queue(max_size=4).launch(show_error=True) demo.launch(show_error=True, theme=gr.themes.Citrus(), css=CSS)app.py+35-21