Skip to content

Commit d4bdd36

Browse files
authored
[new-model] Port LingBot-World-v2 (#1579)
1 parent e2f8322 commit d4bdd36

35 files changed

Lines changed: 3318 additions & 6 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ results/
66
wandb/
77
*.ipynb
88
*.jpg
9+
!examples/dataset/lingbotworld2/image.jpg
910
*.safetensors
1011
*.mp4
1112
*.png

docs/design/inference_schema_parity_inventory.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ surfaces:
450450
grid_sizes: request.inputs.grid_sizes
451451
pose: request.inputs.pose
452452
c2ws_plucker_emb: request.inputs.c2ws_plucker_emb
453+
action_path: request.inputs.action_path
453454
refine_from: request.inputs.refine_from
454455
stage1_video: request.inputs.stage1_video
455456
prompt: request.prompt
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# LingBot World 2 Example Dataset
2+
3+
These files were copied unchanged from the LingBot World 2 repository for the
4+
FastVideo causal-fast inference example.
5+
6+
- Repository: `https://github.com/Robbyant/lingbot-world-v2.git`
7+
- Source commit: `94f43115de8d4a4f9f282126528c300a0b232c5f`
8+
- Source directory: `examples/03`
9+
10+
## Files
11+
12+
- `image.jpg`: source image for image-to-video generation. SHA-256:
13+
`6ee3dacfef32cfef504dd698adb8a660cf15f686535c52fed4903fef27c0edd0`
14+
- `poses.npy`: camera-to-world trajectory matrices. SHA-256:
15+
`bd0a23a696e184b0b43e7767eb432bfe644690560fe327fa96961affc941c404`
16+
- `intrinsics.npy`: camera intrinsic parameters. SHA-256:
17+
`821fca6cf957ae8fbb1181307f02479efb1705e04c9e05734cd02fb43462e082`
1.19 MB
Loading
4.33 KB
Binary file not shown.
16.9 KB
Binary file not shown.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
"""Run LingBot World 2 14B causal-fast I2V generation with FastVideo."""
3+
4+
import os
5+
from pathlib import Path
6+
7+
from fastvideo import VideoGenerator
8+
9+
10+
REPO_ROOT = Path(__file__).resolve().parents[3]
11+
DATASET_DIR = REPO_ROOT / "examples" / "dataset" / "lingbotworld2"
12+
OUTPUT_PATH = REPO_ROOT / "outputs" / "lingbotworld2_causal_fast.mp4"
13+
14+
15+
def main() -> None:
16+
"""Load the native FastVideo LingBot World 2 causal-fast pipeline and generate one video."""
17+
generator = VideoGenerator.from_pretrained(
18+
os.environ["LINGBOTWORLD2_MODEL_PATH"],
19+
num_gpus=8,
20+
sp_size=8,
21+
hsdp_shard_dim=8,
22+
use_fsdp_inference=True,
23+
dit_layerwise_offload=False,
24+
dit_cpu_offload=False,
25+
vae_cpu_offload=False,
26+
text_encoder_cpu_offload=False,
27+
pin_cpu_memory=True,
28+
override_pipeline_cls_name="LingBotWorld2CausalFastPipeline",
29+
)
30+
31+
try:
32+
generator.generate_video(
33+
"A serene lakeside scene with a lone tree standing in calm water, surrounded by distant snow-capped mountains under a bright blue sky with drifting white clouds; gentle ripples reflect the tree and sky, creating a tranquil, meditative atmosphere.",
34+
image_path=str(DATASET_DIR / "image.jpg"),
35+
action_path=str(DATASET_DIR),
36+
output_path=str(OUTPUT_PATH),
37+
save_video=True,
38+
height=480,
39+
width=832,
40+
num_frames=65,
41+
num_inference_steps=4,
42+
guidance_scale=1.0,
43+
negative_prompt="",
44+
fps=16,
45+
seed=42,
46+
)
47+
finally:
48+
generator.shutdown()
49+
50+
51+
if __name__ == "__main__":
52+
main()

fastvideo/api/sampling_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ class SamplingParam:
5151
gt_latents: Any | None = None # Ground truth latents [B, 16, T, H, W]
5252
conditioning_mask: Any | None = None # Mask [B, 1, T, H, W]
5353

54-
# Camera control inputs (LingBotWorld)
54+
# Camera control inputs (LingBotWorld and LingBotWorld2)
5555
c2ws_plucker_emb: Any | None = None # Plucker embedding: [B, C, F_lat, H_lat, W_lat]
56+
action_path: str | None = None # Directory containing poses.npy and intrinsics.npy
5657

5758
# Refine inputs (LongCat 480p->720p upscaling)
5859
# Path-based refine (load stage1 video from disk, e.g. MP4)

fastvideo/api/schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class InputConfig:
130130
keyboard_cond: Any | None = None
131131
grid_sizes: Any | None = None
132132
c2ws_plucker_emb: Any | None = None
133+
action_path: str | None = None
133134
refine_from: str | None = None
134135
stage1_video: Any | None = None
135136

fastvideo/configs/models/dits/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
from fastvideo.configs.models.dits.zimage import ZImageDiTConfig
1616
from fastvideo.configs.models.dits.hyworld import HYWorldConfig
1717
from fastvideo.configs.models.dits.kandinsky5 import Kandinsky5VideoConfig
18+
from fastvideo.configs.models.dits.lingbotworld2 import LingBotWorld2CausalFastVideoConfig
1819

1920
__all__ = [
2021
"HunyuanVideoConfig", "HunyuanVideo15Config", "HunyuanGameCraftConfig", "WanVideoConfig", "DreamXWorldConfig",
2122
"DreamXWorldARConfig", "CosmosVideoConfig", "Cosmos25VideoConfig", "FluxDiTConfig", "Flux2Config",
2223
"LongCatVideoConfig", "LTX2VideoConfig", "HYWorldConfig", "Kandinsky5VideoConfig", "MagiHumanVideoConfig",
23-
"StableAudioConfig", "GlmImageDiTConfig", "ZImageDiTConfig"
24+
"StableAudioConfig", "GlmImageDiTConfig", "LingBotWorld2CausalFastVideoConfig", "ZImageDiTConfig"
2425
]

0 commit comments

Comments
 (0)