🌟 Highlights
Lance is a lightweight native unified multimodal model that supports image and video understanding, generation, and editing within a single framework.
- Efficient at 3B scale. With only 3B active parameters, Lance delivers strong performance across image generation, image editing, and video generation benchmarks.
- Trained from scratch. Lance is built with a staged multi-task recipe and trained entirely from scratch within a 128-A100-GPU budget.
🎨 Demo
Text-to-Video
Video Editing
Multi-turn Consistency Editing
Intelligent Video Generation
Video Understanding
Text-to-Image Generation
Image Editing
Image Understanding
Installation Steps
First, clone the repository:
git clone https://github.com/bytedance/Lance.git
cd Lance
Then, set up the environment:
conda create -n Lance python=3.11 -y
conda activate Lance
pip install torch==2.5.1+cu124 torchvision==0.20.1+cu124 torchaudio==2.5.1+cu124 --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt
pip install flash-attn==2.8.3 --no-build-isolation
Note: If installing
flash-attnfrom source fails, you can install the prebuilt wheel instead:pip install --no-cache-dir --no-deps --force-reinstall \ "https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3%2Bcu12torch2.5cxx11abiFALSE-cp311-cp311-linux_x86_64.whl"
Download Model Weights
Please download all necessary model checkpoints from Lance-3B on Hugging Face and place them in the downloads/ directory.
from huggingface_hub import snapshot_download
save_dir = "./downloads/"
repo_id = "bytedance-research/Lance"
cache_dir = save_dir + "/cache"
snapshot_download(cache_dir=cache_dir,
local_dir=save_dir,
repo_id=repo_id,
local_dir_use_symlinks=False,
resume_download=True,
allow_patterns=["*.json", "*.safetensors", "*.bin", "*.py", "*.md", "*.txt","*.pth",],
)
📚 Usage
Inference
We provide a unified command-line interface for all generation / editing / understanding tasks:
Option 1: Configure and Run the Unified Script
bash inference_lance.sh
- Before running, please configure the inference parameters at the top of
inference_lance.sh. - Supported tasks:
t2i,t2v,image_edit,video_edit,x2t_image, andx2t_video. You can modifyTASK_DEFAULT_CONFIGSininference_lance.pyto customize the default data samples for each task. - Note: For all tasks, we recommend following the
promptformat used in the provided examples when writing input prompts, as this typically leads to better generation quality.
Option 2: Configure and Run the Unified Script
We provide task-specific one-click commands for different generation, editing, and understanding tasks.
Text-to-Video Generation
bash inference_lance.sh \
--TASK_NAME t2v \
--MODEL_PATH downloads/Lance_3B_Video \
--RESOLUTION video_480p \
--NUM_FRAMES 121 \
--VIDEO_HEIGHT 480 \
--VIDEO_WIDTH 848 \
--SAVE_PATH_GEN results/t2v_121f
Text-to-Image Generation
bash inference_lance.sh \
--TASK_NAME t2i \
--MODEL_PATH downloads/Lance_3B \
--RESOLUTION image_768res \
--VIDEO_HEIGHT 768 \
--VIDEO_WIDTH 768 \
--SAVE_PATH_GEN results/t2i
Video Editing
bash inference_lance.sh \
--TASK_NAME video_edit \
--MODEL_PATH downloads/Lance_3B_Video \
--RESOLUTION video_480p \
--SAVE_PATH_GEN results/video_edit
Image Editing
bash inference_lance.sh \
--TASK_NAME image_edit \
--MODEL_PATH downloads/Lance_3B \
--RESOLUTION image_768res \
--SAVE_PATH_GEN results/image_edit
Video Understanding
bash inference_lance.sh \
--TASK_NAME x2t_video \
--MODEL_PATH downloads/Lance_3B_Video \
--RESOLUTION video_480p \
--NUM_FRAMES 50 \
--SAVE_PATH_GEN results/x2t_video
Image Understanding
bash inference_lance.sh \
--TASK_NAME x2t_image \
--MODEL_PATH downloads/Lance_3B \
--RESOLUTION image_768res \
--SAVE_PATH_GEN results/x2t_image
Available Tasks
| Task Name | Description | Example JSON |
|---|---|---|
t2v | Text-to-Video generation | config/examples/t2v_example.json |
t2i | Text-to-Image generation | config/examples/t2i_example.json |
image_edit | Image editing | config/examples/image_edit_example.json |
video_edit | Video editing | config/examples/video_edit_example.json |
x2t_image | Image understanding | config/examples/x2t_image_example.json |
x2t_video | Video understanding | config/examples/x2t_video_example.json |
For understanding examples:
config/examples/x2t_image_example.json: image understanding examples for visual question answering and image-based reasoning.config/examples/x2t_video_example.json: video understanding examples for video question answering and video captioning.
Parameters
You can configure the following hyperparameters at the top of the inference_lance.sh script:
| Parameter | Default Value | Description |
|---|---|---|
MODEL_PATH | "downloads/lance_3b" | Path to the downloaded Lance model weights. |
NUM_GPUS | 1 | Number of GPUs to use for inference. |
VALIDATION_NUM_TIMESTEPS | 30 | Number of denoising steps (e.g., 30 or 50). |
VALIDATION_TIMESTEP_SHIFT | 3.5 | Timestep shift parameter for flow matching scheduling. |
CFG_TEXT_SCALE | 4.0 | Classifier-Free Guidance (CFG) scale for text conditioning. |
VALIDATION_DATA_SEED | 42 | Random seed for generation reproducibility. |
NUM_FRAMES | 50 | Number of frames for video generation (Max: 121). Unused for image tasks. |
VIDEO_HEIGHT / VIDEO_WIDTH | 768 | Spatial resolution. Unused for editing tasks (determined by input image/video). |
RESOLUTION | "video_480p" | Base resolution preset (image_768res or video_480p). |
Gradio
python lance_gradio_t2v_v2t.py --gpus 0 --server-port 7860
Benchmarks
DPG-Bench Evaluation
GenEval Evaluation
GEdit-Bench Evaluation
VBench Evaluation (Video Generation)
Running Benchmarks
Ready-to-run benchmark scripts are provided under benchmarks/:
| Benchmark | Modality | Script |
|---|---|---|
| GenEVAL (image gen) | Image | benchmarks/image_gen/GenEVAL/sample_GenEVAL.sh |
| DPG (image gen) | Image | benchmarks/image_gen/DPG/sample_DPG.sh |
| GEdit (image edit) | Image | benchmarks/image_gen/GEdit/sample_GEdit.sh |
| VBench (video gen) | Video | benchmarks/video_gen/Vbench/sample_vbench.sh |
📄 License
Copyright 2025 Bytedance Ltd. and/or its affiliates.
🙏 Acknowledgements
We would like to thank the contributors of BAGEL, Qwen2.5-VL-3B-Instruct, and Wan2.2 for their open research and contributions.
💖 Citation
If you find Lance useful for your project or research, welcome to 🌟 this repo and cite our work using the following BibTeX:
@misc{lance2026,
title = {Lance: Unified Multimodal Modeling by Multi-Task Synergy},
author = {Fengyi Fu and Mengqi Huang and Shaojin Wu and Yunsheng Jiang and Yufei Huo and Jianzhu Guo and Hao Li and Yinghang Song and Fei Ding and Qian He and Zheren Fu and Zhendong Mao and Yongdong Zhang},
year = {2026},
note = {Manuscript}
}
📞 Contact
For questions, issues, or collaborations, please contact Mengqi Huang and Jianzhu Guo.