Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -35,8 +35,8 @@ blocks.sub_blocks.insert("image_to_action", image_to_action_block, 0)
|
|
| 35 |
pipe = MatrixGameWanModularPipeline(blocks, "diffusers/matrix-game-2-modular")
|
| 36 |
pipe.load_components(trust_remote_code=True, device_map="cuda", torch_dtype={"default": torch.bfloat16, "vae": torch.float32})
|
| 37 |
|
| 38 |
-
@spaces.GPU(120)
|
| 39 |
-
def predict(
|
| 40 |
output = pipe(image=image, prompt=prompt, num_frames=141)
|
| 41 |
return export_to_video(output.values['videos'][0], "output.mp4")
|
| 42 |
|
|
@@ -55,7 +55,6 @@ css = """
|
|
| 55 |
}
|
| 56 |
#edit_text{margin-top: -62px !important}
|
| 57 |
"""
|
| 58 |
-
|
| 59 |
with gr.Blocks(css=css) as demo:
|
| 60 |
with gr.Column(elem_id="col-container"):
|
| 61 |
gr.Markdown(
|
|
@@ -83,10 +82,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 83 |
gr.on(
|
| 84 |
triggers=[run_button.click],
|
| 85 |
fn=predict,
|
| 86 |
-
inputs=[
|
| 87 |
-
image,
|
| 88 |
-
prompt,
|
| 89 |
-
],
|
| 90 |
outputs=[result],
|
| 91 |
)
|
| 92 |
|
|
|
|
| 35 |
pipe = MatrixGameWanModularPipeline(blocks, "diffusers/matrix-game-2-modular")
|
| 36 |
pipe.load_components(trust_remote_code=True, device_map="cuda", torch_dtype={"default": torch.bfloat16, "vae": torch.float32})
|
| 37 |
|
| 38 |
+
@spaces.GPU(duration=120)
|
| 39 |
+
def predict():
|
| 40 |
output = pipe(image=image, prompt=prompt, num_frames=141)
|
| 41 |
return export_to_video(output.values['videos'][0], "output.mp4")
|
| 42 |
|
|
|
|
| 55 |
}
|
| 56 |
#edit_text{margin-top: -62px !important}
|
| 57 |
"""
|
|
|
|
| 58 |
with gr.Blocks(css=css) as demo:
|
| 59 |
with gr.Column(elem_id="col-container"):
|
| 60 |
gr.Markdown(
|
|
|
|
| 82 |
gr.on(
|
| 83 |
triggers=[run_button.click],
|
| 84 |
fn=predict,
|
| 85 |
+
inputs=[image, prompt],
|
|
|
|
|
|
|
|
|
|
| 86 |
outputs=[result],
|
| 87 |
)
|
| 88 |
|