--- license: cc-by-nc-sa-4.0 library_name: diffusers pipeline_tag: image-to-video base_model: Wan-AI/Wan2.2-TI2V-5B base_model_relation: adapter tags: - video generation - identity-preserving - lora - wan2.2 - image-to-video - text-to-video - cvpr2026 ---

AnyID: Ultra-Fidelity Universal Identity-Preserving Video Generation from Any Visual References

☆ CVPR 2026 ☆

Jiahao Wang1 · Hualian Sheng2 · Sijia Cai2,† · Yuxiao Yang3 · Weizhan Zhang1,* · Caixia Yan1 · Bing Deng2 · Jieping Ye2
1Xi'an Jiaotong University      2Alibaba Cloud      3Tsinghua University
*Corresponding Author      Project Lead

Paper PDF Project Page

Please give us a star⭐ on GitHub if you like our work.

## 📝 Intro **AnyID** is an **ultra-fidelity, universal identity-preserving video generation framework** that overcomes the limitations of single-reference methods by leveraging **multiple free-form inputs**, including faces, portraits, and video clips. By unifying heterogeneous references through a **scalable omni-referenced architecture** and employing a **primary-referenced generation paradigm with differential prompts**, AnyID achieves **precise attribute-level controllability** while maintaining **robust identity consistency** across varying angles and expressions. Further refined by **human-centric reinforcement learning**, the framework delivers superior visual quality, ensuring both **high-fidelity character preservation** and **accurate adherence to user instructions**. Hope you have fun with this demo! 🎬 ![](./assets/teaser.jpg) > ⚠️ **Preview release.** The weights hosted in this repository are a **preview version**, > released for research and evaluation purposes. They may be updated or replaced with an > improved version in the future. ## 🧩 Model Card This repository hosts the **AnyID LoRA**, a lightweight adapter trained on top of the **[Wan2.2 TI2V-5B](https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B)** video diffusion backbone. It does **not** contain the base model — download Wan2.2 TI2V-5B separately (see [Quick Start](#-quick-start)). | Item | Value | |-----------------|--------------------------------------------------------------------| | Version | **Preview** (subject to future updates) | | Model type | LoRA adapter (PEFT) | | Base model | [Wan-AI/Wan2.2-TI2V-5B](https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B) | | Rank / Alpha | 256 / 256 (scaling = 1.0) | | Target modules | All `nn.Linear` layers (self-/cross-attention `q,k,v,o`, FFN, embeddings, head) | | Precision | bf16 | | Task | Identity-preserving text/image/video → video generation | ### Files in this repository | File | Description | |--------------------------|----------------------------------------------| | `anyid_lora.safetensors` | AnyID LoRA weights | | `lora_config.json` | PEFT LoRA config (rank / alpha / targets) | ## 🚀 Quick Start The inference code lives in the [GitHub repository](https://github.com/JoHnneyWang/AnyID). **1. Get the code and set up the environment** (NVIDIA A100, CUDA 12.1): ```bash git clone https://github.com/JoHnneyWang/AnyID.git cd AnyID conda create -n anyid python=3.10 -y conda activate anyid pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 pip install flash-attn --no-build-isolation pip install -r requirements.txt ``` **2. Download the weights** — the base Wan2.2 TI2V-5B and this AnyID LoRA: ```bash # Base model (T5 + VAE + base DiT) huggingface-cli download Wan-AI/Wan2.2-TI2V-5B --local-dir checkpoints/Wan2.2-TI2V-5B # AnyID LoRA (this repository) huggingface-cli download JonneyWang/AnyID --local-dir checkpoints/AnyID ``` **3. Merge the LoRA into the DiT.** Injecting the LoRA dynamically takes minutes to load, so pre-merge it into the DiT once (the merged weights are written into the LoRA directory): ```bash PYTHONPATH=. python trainer/models/wan22/merge_lora.py \ --ckpt_dir checkpoints/Wan2.2-TI2V-5B \ --lora_path checkpoints/AnyID ``` **4. Run inference** — T5/VAE are loaded from the base folder, the merged DiT from the AnyID folder: ```bash CKPT_DIR=checkpoints/Wan2.2-TI2V-5B \ MERGED_DIT=checkpoints/AnyID \ bash scripts/infer.sh ``` Or call the generator directly: ```bash PYTHONPATH=. torchrun --nproc_per_node=1 \ trainer/models/wan22/generate.py \ --task ti2v-5B --size 1280*704 \ --ckpt_dir checkpoints/Wan2.2-TI2V-5B \ --merged_dit checkpoints/AnyID \ --prompt prompts/example.json \ --frame_num 121 \ --sample_guide_scale 4.0 --sample_shift 5.0 \ --convert_model_dtype --offload_model False \ --out_dir outputs ``` ## 📥 Input Format The prompt file is a JSON list of items. Each item carries a **differential prompt** and a single unified **`ref`** field — a path or a list of paths — that works for both image and video references. The **first** reference is the primary reference; the rest are auxiliary. Use **either** up to **five images** **or** **one video** (they cannot be mixed). See [`prompts/example.json`](https://github.com/JoHnneyWang/AnyID/blob/main/prompts/example.json) in the GitHub repo for a runnable example. ```json [ { "ref": ["person_primary.png", "person_auxiliary.png"], "prompt": "..." } ] ``` ## 📚 Citation If you find AnyID useful in your research, please consider citing: ```bibtex @InProceedings{Wang_2026_CVPR, author = {Wang, Jiahao and Sheng, Hualian and Cai, Sijia and Yang, Yuxiao and Zhang, Weizhan and Yan, Caixia and Deng, Bing and Ye, Jieping}, title = {AnyID: Ultra-Fidelity Universal Identity-Preserving Video Generation from Any Visual References}, booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, month = {June}, year = {2026}, pages = {12808-12817} } ``` ## 🙏 Acknowledgements We would like to express our sincere thank to [Wan Team](https://github.com/Wan-Video) for their support. ## 📄 License This model is released under the [CC BY-NC-SA 4.0](LICENSE) license. You are free to share and adapt this work for **non-commercial** purposes only, with proper attribution and under the same license.