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! 🎬

⚠️ 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 video diffusion backbone. It does not contain the base model β€” download Wan2.2 TI2V-5B separately (see Quick Start).

Item Value
Version Preview (subject to future updates)
Model type LoRA adapter (PEFT)
Base model 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.

1. Get the code and set up the environment (NVIDIA A100, CUDA 12.1):

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:

# 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):

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:

CKPT_DIR=checkpoints/Wan2.2-TI2V-5B \
MERGED_DIT=checkpoints/AnyID \
bash scripts/infer.sh

Or call the generator directly:

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 in the GitHub repo for a runnable example.

[
  {
    "ref": ["person_primary.png", "person_auxiliary.png"],
    "prompt": "..."
  }
]

πŸ“š Citation

If you find AnyID useful in your research, please consider citing:

@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 for their support.

πŸ“„ License

This model is released under the CC BY-NC-SA 4.0 license. You are free to share and adapt this work for non-commercial purposes only, with proper attribution and under the same license.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for JonneyWang/AnyID

Adapter
(18)
this model

Paper for JonneyWang/AnyID