explaingit

msalab-pku/loomvideo

Analysis updated 2026-05-18

43PythonAudience · researcherComplexity · 5/5Setup · hard

TLDR

A research AI model from Peking University and Alibaba that generates and edits video from text, existing video, or reference images, at 5B parameters and faster than similar tools.

Mindmap

mindmap
  root((repo))
    What it does
      Text to video
      Edits video by text
      Uses reference images
      Combines multiple images
    Tech stack
      Python
      PyTorch
      Flash Attention
      Hugging Face
    Use cases
      Generate video clips
      Edit video style
      Swap objects in video
    Audience
      Researchers
      ML engineers
    Requirements
      GPU
      uv package manager
      Model weights download

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Generate a short video from just a text prompt.

USE CASE 2

Edit an existing video's style or content by giving text instructions.

USE CASE 3

Use a reference image to guide how an object or background in a video changes.

USE CASE 4

Combine several reference photos into one coherent generated video scene.

What is it built with?

PythonPyTorchFlash AttentionHugging Faceuv

How does it compare?

msalab-pku/loomvideoalibaba/omnidoc-tokenbencharccalc/dwmfix
Stars434343
LanguagePythonPythonPython
Setup difficultyhardmoderateeasy
Complexity5/53/52/5
Audienceresearcherresearchergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Requires a capable GPU, a Python environment via uv, Flash Attention, and downloading model weights from Hugging Face.

In plain English

LoomVideo is a research project from Peking University and Alibaba Group that generates and edits video using artificial intelligence. It is the official code release accompanying an academic paper, and it lets a single AI model take in different combinations of text prompts, existing videos, and reference images, then produce a new video as output. The project supports four related tasks through one model: creating a video purely from a text description, editing an existing video according to written instructions, editing a video using both written instructions and a reference image to guide the change, and combining several separate reference images into one coherent video following a text prompt. The README shows example outputs for each of these, such as changing the artistic style of a video while keeping its motion and camera movement intact, replacing an object in a scene with something else, or combining photos of a person and a location into a new video of that person walking through that location. Compared to other AI models that try to do all of this in one system, the authors highlight that theirs is much smaller, at 5 billion parameters versus the 13 billion or more used by comparable models, while still achieving similar or better results and running over five times faster. They describe three technical design choices that make this possible, involving how information from a language and vision model gets fed into the video generation model, and how the model is told which parts of its input are the unchanged source content versus the new content to generate. To use it, you need to clone the repository and set up a Python environment, for which the authors recommend a tool called uv for fast, reproducible installs, plus a library called Flash Attention for efficient model computation. The trained model weights are hosted separately on Hugging Face and downloaded during setup. Running the full pipeline requires a capable GPU, since this is a large video generation model, though the README's setup section does not specify exact hardware requirements.

Copy-paste prompts

Prompt 1
Walk me through setting up LoomVideo's Python environment with uv and Flash Attention.
Prompt 2
Explain in plain terms what Deepstack Injection and Scale-and-Add Conditioning do in this model.
Prompt 3
Help me write a text-to-video prompt in the style shown in this README's examples.
Prompt 4
Compare LoomVideo's four supported tasks and tell me which one fits editing a video with a reference image.

Frequently asked questions

What is loomvideo?

A research AI model from Peking University and Alibaba that generates and edits video from text, existing video, or reference images, at 5B parameters and faster than similar tools.

What language is loomvideo written in?

Mainly Python. The stack also includes Python, PyTorch, Flash Attention.

How hard is loomvideo to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is loomvideo for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.