# Repository Briefing: bytedance/Lance
> Source: https://repoforai.com/repo/bytedance/Lance (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/bytedance/Lance
- **Official Docs / Website**: https://lance-project.github.io
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B (52/100 · Maintenance 12/35 · Adoption 14/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: GPU, CLI
- **Momentum**: 1,376 ★ total (+0 24h / +5 7d) · 91 forks
- **Topics**: `image-editing`, `image-generation`, `image-understanding`, `unified-multimodal-models`, `video-generation`, `video-understanding`
- **When to Use**: Best for: Research teams with suitable GPUs that want a shared interface for evaluating image and video understanding, generation, and editing, with scripts for batch tests and code for fine-tuning. Skip if: You need inference on GPUs below 40 GB VRAM, consistent production quality for longer or higher-resolution video, or only still-image generation and a dedicated model performs better on your prompts.

## Overview
```text
### Architecture & Core Mechanics
Lance is a native unified image and video model with 3B active parameters, trained from scratch using a staged multitask recipe. The tasks share an inference interface, but deployment still involves checkpoint selection: generation and editing examples point to `Lance_3B` for images and `Lance_3B_Video` for video. `inference_lance.sh` exposes task and runtime settings for `inference_lance.py`, which defines task defaults. Built-in JSON examples can be replaced with custom JSON or JSONL inputs.

The runtime uses PyTorch and CUDA with FlashAttention, alongside Transformers 4.49.0 and Diffusers 0.29.1. The CLI exposes denoising steps, flow-matching timestep shift, classifier-free guidance for text, and a seed. For integration, use the task inputs and checkpoint paths as the starting contract. Optional T2V/I2V prompt rewriting is a separate API call, not a dependency of base inference.

### Key Capabilities & Differentiators
The seven task modes cover text-to-image, text-to-video, image-to-video, image and video editing, and image and video understanding. Understanding examples include visual question answering, reasoning, and captioning for images, plus question answering and captioning for video. Generation training reached 768×768 for images and 480p at 12 FPS for video. The CLI caps video generation at 121 frames, while editing dimensions are determined by the input media rather than the generation size flags.

Lance scores 84.67 overall on DPG-Bench for image generation, with 93.38 on relations and 83.89 on global prompts. Sampling scripts for GenEval, DPG-Bench, GEdit, and VBench cover image generation, image editing, and video generation. Use those as evaluation starting points, then test understanding accuracy, motion, and edit consistency separately on your own inputs.

### Trade-offs & Limitations
The shared task interface can simplify evaluation and integration when a workflow needs several visual tasks. It does not make Lance the strongest image generator: on DPG-Bench, its 84.67 overall is above Janus-Pro-7B's 84.19 but below Show-o2's 86.14 and the generation-only Qwen-Image's 88.32. That ranking says nothing about video editing, understanding quality, or serving cost, so compare alternatives on the task mix you actually need.

Three billion active parameters still come with a documented inference requirement of at least 40 GB VRAM. Training used up to 128 A100s, a separate figure that does not size inference. Treat Lance as a research checkpoint: output quality can vary with resolution, clip length, motion, and edit type. The code is Apache-2.0; verify the checkpoint and any redistributed assets separately before commercial use.

### Hardware & Deployment Guide
Use Python 3.10+, CUDA 12.4+, and a GPU with at least 40 GB VRAM for the documented inference setup. The default install uses Python 3.11, PyTorch 2.8.0 with cu126, and FlashAttention 2.8.3; A100 testing also covers PyTorch 2.5.1 with cu124 and FlashAttention 2.6.3. On other GPUs, verify driver and package compatibility before staging the weights. If you use a third-party FlashAttention wheel, verify its provenance and build compatibility.

Download the Hugging Face snapshot into `downloads/`, select the checkpoint in `inference_lance.sh`, or launch `lance_gradio.py` on loopback for interactive testing. Once installed, base inference can run locally without the optional rewrite endpoint. Project updates added vLLM-Omni integration on June 3, 2026, and fine-tuning code on June 17, 2026; neither should be treated as proof of production readiness.
```

## Key Capabilities
```text
- Task interface: One CLI dispatches seven tasks across image and video understanding, generation, and editing.
- Checkpoint selection: The examples use `Lance_3B` for image generation and editing, and `Lance_3B_Video` for video generation and editing.
- Generation controls: The CLI exposes denoising steps, flow-matching timestep shift, text guidance, and seed; video generation accepts up to 121 frames.
- Evaluation tooling: `benchmarks/` includes sampling scripts for GenEval, DPG-Bench, GEdit, and VBench.
- Training workflow: Lance was trained from scratch using a staged multitask recipe; fine-tuning code and dataset guides are available.
- Serving options: Run local jobs through the CLI, test interactively with Gradio, or evaluate the vLLM-Omni integration for serving.
```

## Quick Start / Clone
```bash
conda create -n Lance python=3.11 -y
conda activate Lance
pip install torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu126
pip install -r requirements.txt
pip install flash-attn==2.8.3 --no-build-isolation
```
