Delete test_pipeline.py
Browse files- test_pipeline.py +0 -24
test_pipeline.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
import sys
|
| 2 |
-
import os
|
| 3 |
-
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 4 |
-
|
| 5 |
-
import torch
|
| 6 |
-
from modular_pipeline import MatrixGameWanModularPipeline
|
| 7 |
-
from modular_blocks import ACTION2VIDEO_BLOCKS
|
| 8 |
-
from diffusers.modular_pipelines import SequentialPipelineBlocks
|
| 9 |
-
from diffusers import AutoModel
|
| 10 |
-
from diffusers.utils import load_image, export_to_video
|
| 11 |
-
|
| 12 |
-
blocks = SequentialPipelineBlocks.from_blocks_dict(ACTION2VIDEO_BLOCKS.copy())
|
| 13 |
-
pipe = MatrixGameWanModularPipeline(blocks)
|
| 14 |
-
pipe.load_components(torch_dtype=torch.bfloat16)
|
| 15 |
-
pipe.load_components(["vae"], repo="Wan-AI/Wan2.1-T2V-1.3B-Diffusers", subfolder="vae", torch_dtype=torch.float32)
|
| 16 |
-
pipe.load_components(["scheduler"], repo="Wan-AI/Wan2.1-T2V-1.3B-Diffusers", subfolder="scheduler")
|
| 17 |
-
|
| 18 |
-
transformer = AutoModel.from_pretrained("./transformer", trust_remote_code=True, torch_dtype=torch.bfloat16)
|
| 19 |
-
pipe.transformer = transformer
|
| 20 |
-
pipe.to("cuda")
|
| 21 |
-
|
| 22 |
-
image = load_image("/home/dhruv/matrix-game-workspace/Matrix-Game/Matrix-Game-2/demo_images/universal/0000.png")
|
| 23 |
-
output = pipe(image=image, num_frames=141)
|
| 24 |
-
export_to_video(output.values['videos'][0], "modular-matrix-game.mp4")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|