import torch
from diffusers import ModularPipelineBlocks
from diffusers.utils import export_to_video, load_image
from diffusers.modular_pipelines import WanModularPipeline
classMatrixGameWanModularPipeline(WanModularPipeline):
""" A ModularPipeline for MatrixGameWan. <Tip warning={true}> This is an experimental feature and is likely to change in the future. </Tip> """ @propertydefdefault_sample_height(self):
return44 @propertydefdefault_sample_width(self):
return80# Download custom blocks for the pipeline
blocks = ModularPipelineBlocks.from_pretrained(
"diffusers-internal-dev/matrix-game-2-modular",
trust_remote_code=True,
)
# Initialize the pipeline runtime using the config in the repo
pipe = MatrixGameWanModularPipeline(blocks, "diffusers-internal-dev/matrix-game-2-modular")
# Load the model components of the pipeline
pipe.load_components(
trust_remote_code=True,
device_map="cuda",
torch_dtype={"default": torch.bfloat16, "vae": torch.float32}
)
image = load_image("https://github.com/SkyworkAI/Matrix-Game/blob/main/Matrix-Game-2/demo_images/universal/0016.png?raw=true")
output = pipe(image=image, num_frames=141)
export_to_video(output.values['videos'][0], "matrix-game.mp4")
Providing Actions as Inputs
Each action is represented as a string. The available actions are:
Motion Actions: ["forward", "left", "right"]
Camera Actions: ["camera_l", "camera_r", "camera_u", "camera_d"]
Compound Actions: Combinations of motion and camera actions with an
_
separating actions, e.g. "forward_left", "forward_left_camera_l"
Runs of diffusers matrix-game-2-modular on huggingface.co
14
Total runs
0
24-hour runs
0
3-day runs
3
7-day runs
14
30-day runs
More Information About matrix-game-2-modular huggingface.co Model
matrix-game-2-modular huggingface.co
matrix-game-2-modular huggingface.co is an AI model on huggingface.co that provides matrix-game-2-modular's model effect (), which can be used instantly with this diffusers matrix-game-2-modular model. huggingface.co supports a free trial of the matrix-game-2-modular model, and also provides paid use of the matrix-game-2-modular. Support call matrix-game-2-modular model through api, including Node.js, Python, http.
matrix-game-2-modular huggingface.co is an online trial and call api platform, which integrates matrix-game-2-modular's modeling effects, including api services, and provides a free online trial of matrix-game-2-modular, you can try matrix-game-2-modular online for free by clicking the link below.
diffusers matrix-game-2-modular online free url in huggingface.co:
matrix-game-2-modular is an open source model from GitHub that offers a free installation service, and any user can find matrix-game-2-modular on GitHub to install. At the same time, huggingface.co provides the effect of matrix-game-2-modular install, users can directly use matrix-game-2-modular installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
matrix-game-2-modular install url in huggingface.co: