Views
No views yet

1git clone https://github.com/wileewang/LongLive2.0.git
2cd LongLive2.0
3
4conda create -n longlive2_nvfp4 python=3.12 -y
5conda activate longlive2_nvfp4
6
7pip install -r requirements.txt
8pip install --upgrade --index-url https://download.pytorch.org/whl/cu128 \
9 torch==2.10.0 torchvision==0.25.01cd fouroversix
2pip install ninja packaging psutil "setuptools>=77.0.3"
3
4# B200 / GB200 / GB300
5export CUDA_ARCHS=100
6
7# RTX 50/60 series, if needed
8# export CUDA_ARCHS=120
9
10pip install --no-build-isolation -e .
11cd ..
12
13git clone https://github.com/Dao-AILab/flash-attention.git
14cd flash-attention
15git checkout v2.8.3
16pip install -U pip setuptools wheel ninja packaging
17pip install --no-build-isolation -e .
18cd ..
19
20cd utils/kernel
21python setup.py build_ext --inplace
22cd ../..1python -c "import torch, torchvision; print(torch.__version__, torch.version.cuda); print(torchvision.__version__)"
2python -c "import flash_attn; print(flash_attn.__version__)"
3python -c "import fouroversix; from utils.quant import LongLiveQuantizationConfig, quantize_to_fp4"
4python -c "from utils.kernel.kv_dequant import dequantize_kv_cache_fp4"1huggingface-cli download Wan-AI/Wan2.2-TI2V-5B \
2 --local-dir wan_models/Wan2.2-TI2V-5B1huggingface-cli download Perflow-Shuai/LongLive-2.0-5B-NVFP4-2Step \
2 --local-dir checkpoints/longlive2_5b_nvfp4_2stepconfigs/nvfp4/inference_nvfp4.yaml.inference.sampling_steps: 2:1checkpoints:
2 generator_ckpt: checkpoints/longlive2_5b_nvfp4_2step/path/to/generator.pt
3 lora_ckpt: null
4
5merge_lora: false
6
7data:
8 data_path: /path/to/inference_prompts
9 image_or_video_shape:
10 - 1
11 - 384
12 - 48
13 - 44
14 - 80
15
16output_folder: videos/longlive2_nvfp4_2step
17num_samples: 1
18num_output_frames: 384
19
20inference:
21 sampling_steps: 2
22 sink_size: 8
23 guidance_scale: 1.0
24 multi_shot_sink: true
25 multi_shot_rope_offset: 8
26 kv_quant: true
27 kv_quant_scale_rule: mse
28 kv_quant_backend: cuda
29 streaming_vae: false
30 async_vae: false
31 vae_type: wan
32
33model_quant: true
34model_quant_use_transformer_engine: false
35model_quant_scale_rule: mse
36model_quant_activation_scale_rule: mse
37model_quant_weight_scale_rule: mse
38model_quant_gradient_scale_rule: msecheckpoints.lora_ckpt to that LoRA file and set
merge_lora: true, then add the LoRA adapter config:1adapter:
2 type: lora
3 rank: 128
4 alpha: 128
5 dropout: 0.0
6 dtype: bfloat16
7 apply_to_critic: true
8 verbose: truecheckpoints.lora_ckpt is null, remove the adapter section.model_quant_use_transformer_engine: true when loading a FourOverSix
materialized NVFP4 checkpoint. FourOverSix checkpoints store
quantized_weight_* buffers and should be loaded through the FourOverSix path.data.data_path can be either:.txt file, where each line is one single-shot prompt; or1inference_prompts/
2 robot_lab_demo/
3 0.json
4 1.json
5 2.json
6 shot_durations.txt1{
2 "caption": "A compact silver robot with one blue optic explores a clean robotics lab."
3}shot_durations.txt is optional. If provided, each number is the number of
temporal chunks assigned to the corresponding caption, for example:2 2 41torchrun --standalone --nnodes=1 --nproc_per_node=4 inference.py \
2 --config_path configs/nvfp4/inference_nvfp4.yamlpython inference.py --config_path configs/nvfp4/inference_nvfp4.yamlNUM_GPUS / num_gpus when provided:scripts/inference_nvfp4.sh configs/nvfp4/inference_nvfp4.yamloutput_folder.inference.sampling_steps: 2.model_quant enables NVFP4 generator inference.inference.kv_quant enables FP4 KV-cache storage and requires the
utils/kernel extension.inference.multi_shot_sink enables the multi-shot attention sink.inference.multi_shot_rope_offset controls the multi-shot RoPE offset.inference.streaming_vae, inference.async_vae, inference.vae_type, and
inference.vae_device control streaming or asynchronous VAE decode.1@article{longlive_2,
2 title={LongLive2.0: An NVFP4 Parallel Infrastructure for Long Video Generation},
3 author={Chen, Yukang and Wang, Luozhou and Huang, Wei and Yang, Shuai and Zhang, Bohan and Xiao, Yicheng and Chu, Ruihang and Mao, Weian and Hu, Qixin and Liu, Shaoteng and Zhao, Yuyang and Mao, Huizi and Chen, Ying-Cong and Xie, Enze and Qi, Xiaojuan and Han, Song},
4 journal={arXiv preprint arXiv},
5 year={2026}
6}