Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,7 @@ import spaces
|
|
| 25 |
import gradio as gr
|
| 26 |
|
| 27 |
import pk_workflow as pk
|
|
|
|
| 28 |
|
| 29 |
MODEL_REPO = os.environ.get("H3_MODEL_REPO", "MiniMaxAI/MiniMax-H3")
|
| 30 |
CONDITIONER_SPACE = os.environ.get("H3_CONDITIONER", "dagloop5/qwen3vl-conditioner")
|
|
@@ -111,6 +112,7 @@ SAMPLERS = {
|
|
| 111 |
"er_sde": "er_sde",
|
| 112 |
"dpmpp_2m_sde_gpu": "dpmpp_2m_sde_gpu",
|
| 113 |
"dpmpp_3m_sde_gpu": "dpmpp_3m_sde_gpu",
|
|
|
|
| 114 |
}
|
| 115 |
DEFAULT_SAMPLER = "euler"
|
| 116 |
|
|
@@ -559,18 +561,20 @@ def _generate(
|
|
| 559 |
|
| 560 |
started = time.time()
|
| 561 |
with pk.use_schedule(PIPE, steps, schedule, video_shift, audio_shift, sampler_name=sampler, seed=int(seed)):
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
|
|
|
|
|
|
| 574 |
denoised = time.time() - started
|
| 575 |
|
| 576 |
video = state.get("videos")[0] # (frames, 3, H, W), float in [0, 1], on the card
|
|
|
|
| 25 |
import gradio as gr
|
| 26 |
|
| 27 |
import pk_workflow as pk
|
| 28 |
+
from h3_dpmpp_2s_ancestral import use_dpmpp_2s_ancestral
|
| 29 |
|
| 30 |
MODEL_REPO = os.environ.get("H3_MODEL_REPO", "MiniMaxAI/MiniMax-H3")
|
| 31 |
CONDITIONER_SPACE = os.environ.get("H3_CONDITIONER", "dagloop5/qwen3vl-conditioner")
|
|
|
|
| 112 |
"er_sde": "er_sde",
|
| 113 |
"dpmpp_2m_sde_gpu": "dpmpp_2m_sde_gpu",
|
| 114 |
"dpmpp_3m_sde_gpu": "dpmpp_3m_sde_gpu",
|
| 115 |
+
"dpmpp_2s_ancestral": "dpmpp_2s_ancestral",
|
| 116 |
}
|
| 117 |
DEFAULT_SAMPLER = "euler"
|
| 118 |
|
|
|
|
| 561 |
|
| 562 |
started = time.time()
|
| 563 |
with pk.use_schedule(PIPE, steps, schedule, video_shift, audio_shift, sampler_name=sampler, seed=int(seed)):
|
| 564 |
+
with use_dpmpp_2s_ancestral(PIPE, int(seed), enabled=(sampler == "dpmpp_2s_ancestral")):
|
| 565 |
+
state = PIPE(
|
| 566 |
+
prompt_embeds=prompt_embeds.to("cuda"),
|
| 567 |
+
text_token_tags=text_token_tags,
|
| 568 |
+
image=first_frame,
|
| 569 |
+
last_image=last_frame,
|
| 570 |
+
height=height,
|
| 571 |
+
width=width,
|
| 572 |
+
num_frames=num_frames,
|
| 573 |
+
num_inference_steps=requested_steps,
|
| 574 |
+
output_type="pt",
|
| 575 |
+
generator=torch.Generator("cpu").manual_seed(int(seed)),
|
| 576 |
+
)
|
| 577 |
+
|
| 578 |
denoised = time.time() - started
|
| 579 |
|
| 580 |
video = state.get("videos")[0] # (frames, 3, H, W), float in [0, 1], on the card
|