Spaces:
Build error
Build error
update app
Browse files
app.py
CHANGED
|
@@ -103,6 +103,19 @@ def _set_lora(transformer, name: str) -> str:
|
|
| 103 |
return "off"
|
| 104 |
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
def load_models() -> str | None:
|
| 107 |
global PIPE, MUTE_PIPE, MANAGER, LOAD_ERROR, MUTE_ERROR, LOADED_IN, LORA_STATUS
|
| 108 |
|
|
@@ -572,6 +585,7 @@ and the VAEs.
|
|
| 572 |
|
| 573 |
with gr.Blocks(title="MiniMax-H3-Turbo-LoRA-Fast") as demo:
|
| 574 |
gr.Markdown(INTRO)
|
|
|
|
| 575 |
|
| 576 |
with gr.Row():
|
| 577 |
with gr.Column(scale=3):
|
|
@@ -591,15 +605,15 @@ with gr.Blocks(title="MiniMax-H3-Turbo-LoRA-Fast") as demo:
|
|
| 591 |
value="single",
|
| 592 |
)
|
| 593 |
duration = gr.Slider(
|
| 594 |
-
MIN_UI_DURATION, MAX_UI_DURATION, value=
|
| 595 |
label="Length (s)", info="Rounded up to the next 17n+5 at 24 fps.",
|
| 596 |
)
|
| 597 |
with gr.Row():
|
| 598 |
-
with_audio = gr.Checkbox(label="Generate audio", value=
|
| 599 |
upsample = gr.Checkbox(label="Prompt upsampling (+15–50s)", value=False)
|
| 600 |
-
with gr.Accordion("Advanced", open=
|
| 601 |
steps = gr.Slider(2, 12, value=6, step=1, label="Steps")
|
| 602 |
-
lora = gr.Dropdown(label="Turbo/Style-LoRA", choices=list(LORA_NAMES), value="
|
| 603 |
seed = gr.Number(label="Seed (clip i = seed + i)", value=42, precision=0)
|
| 604 |
gpu_duration = gr.Slider(
|
| 605 |
minimum=GPU_DURATION_CHOICES[0],
|
|
@@ -622,6 +636,7 @@ with gr.Blocks(title="MiniMax-H3-Turbo-LoRA-Fast") as demo:
|
|
| 622 |
for control in cost_inputs:
|
| 623 |
control.change(cost_hint, cost_inputs, cost)
|
| 624 |
demo.load(cost_hint, cost_inputs, cost)
|
|
|
|
| 625 |
|
| 626 |
run_button.click(
|
| 627 |
run,
|
|
@@ -634,4 +649,4 @@ with gr.Blocks(title="MiniMax-H3-Turbo-LoRA-Fast") as demo:
|
|
| 634 |
load_models()
|
| 635 |
|
| 636 |
if __name__ == "__main__":
|
| 637 |
-
demo.queue(default_concurrency_limit=1, max_size=8).launch(
|
|
|
|
| 103 |
return "off"
|
| 104 |
|
| 105 |
|
| 106 |
+
def status() -> str:
|
| 107 |
+
if LOAD_ERROR:
|
| 108 |
+
return LOAD_ERROR
|
| 109 |
+
if PIPE is None:
|
| 110 |
+
return f"Loading `{MODEL_REPO}` (transformer + VAEs, 77.3 GB). See the Space logs."
|
| 111 |
+
audio_note = "video-only pipeline active" if MUTE_PIPE is not None else f"video-only pipeline not available ({MUTE_ERROR})"
|
| 112 |
+
return (
|
| 113 |
+
f"Ready · transformer + VAEs **bfloat16, unquantized** · placement `{PLACEMENT}` · attention `{ATTENTION}` "
|
| 114 |
+
f"· {LORA_STATUS or 'no LoRA'} · {audio_note} · window {MIN_UI_DURATION:g}–{MAX_UI_DURATION:g}s "
|
| 115 |
+
f"· loaded in {LOADED_IN:.0f}s · conditioner `{CONDITIONER_SPACE}`"
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
|
| 119 |
def load_models() -> str | None:
|
| 120 |
global PIPE, MUTE_PIPE, MANAGER, LOAD_ERROR, MUTE_ERROR, LOADED_IN, LORA_STATUS
|
| 121 |
|
|
|
|
| 585 |
|
| 586 |
with gr.Blocks(title="MiniMax-H3-Turbo-LoRA-Fast") as demo:
|
| 587 |
gr.Markdown(INTRO)
|
| 588 |
+
banner = gr.Markdown(status())
|
| 589 |
|
| 590 |
with gr.Row():
|
| 591 |
with gr.Column(scale=3):
|
|
|
|
| 605 |
value="single",
|
| 606 |
)
|
| 607 |
duration = gr.Slider(
|
| 608 |
+
MIN_UI_DURATION, MAX_UI_DURATION, value=5, step=0.5,
|
| 609 |
label="Length (s)", info="Rounded up to the next 17n+5 at 24 fps.",
|
| 610 |
)
|
| 611 |
with gr.Row():
|
| 612 |
+
with_audio = gr.Checkbox(label="Generate audio", value=True)
|
| 613 |
upsample = gr.Checkbox(label="Prompt upsampling (+15–50s)", value=False)
|
| 614 |
+
with gr.Accordion("Advanced", open=False):
|
| 615 |
steps = gr.Slider(2, 12, value=6, step=1, label="Steps")
|
| 616 |
+
lora = gr.Dropdown(label="Turbo/Style-LoRA", choices=list(LORA_NAMES), value="larry")
|
| 617 |
seed = gr.Number(label="Seed (clip i = seed + i)", value=42, precision=0)
|
| 618 |
gpu_duration = gr.Slider(
|
| 619 |
minimum=GPU_DURATION_CHOICES[0],
|
|
|
|
| 636 |
for control in cost_inputs:
|
| 637 |
control.change(cost_hint, cost_inputs, cost)
|
| 638 |
demo.load(cost_hint, cost_inputs, cost)
|
| 639 |
+
demo.load(status, None, banner)
|
| 640 |
|
| 641 |
run_button.click(
|
| 642 |
run,
|
|
|
|
| 649 |
load_models()
|
| 650 |
|
| 651 |
if __name__ == "__main__":
|
| 652 |
+
demo.queue(default_concurrency_limit=1, max_size=8).launch(show_error=True, allowed_paths=[OUTPUT_DIR])
|