Skip to content

wyhsirius/LIA-X

Repository files navigation

LIA-X: Interpretable Latent Portrait Animator

Yaohui Wang, Di Yang, Xinyuan Chen, François Brémond, Yu Qiao, Antitza Dantcheva

arXiv Project Page Hugging Face Spaces Static Badge

This is the official PyTorch codebase for LIA-X. LIA-X has developped original LIA into a new level, where now it supports interpretable and fine-grained control of head, mouth and eyes.

News

2025.08.20: LIA-X is selected as Spaces of the Week on HuggingFace!

2025.08.13: We release paper, model and inference code!

Setup

git clone https://github.com/wyhsirius/LIA-X
cd LIA-X

Setting up the environment and download pre-trained model to ./model.

conda create -n liax python=3.10
conda activate liax
pip install -r requirements.txt

Gradio UI

Run following command to launch Gradio UI locally. For online interface, visit HF Space.

python app.py
Instruction

We provide three tabs Image Animation, Image Editing and Video Edting, they all support fine-grained manipulation for head, mouth and eyes using the Control Panel.

  • Image Animation
    • Upload Source Image and Driving Video
    • Use Control Panel to edit source image and Edit button to display the Edited Source Image
    • Use Animate button to obtain Animated Video
  • Image Editing
    • Upload Source Image
    • Use Control Panel to edit source image and Edit button to display the Edited Source Image
  • Video Editing
    • Upload Video
    • Use Control Panel to edit first frame of video and Edit button to display the Edited Image
    • Use Generate button to obtain Edited Video

Command Line Inference

You can use inference.py to run the demo. Use --mode flag to choose the setting from animation, img_edit, vid_edit and manipulation. The --cfg flag indicates the path of corresponding configuration files. The --chunk_size flag indicates how many frames the model will process at each iteration, larger value brings faster inference speed. You should adjust this value based on your GPU.

Play with motion_id and motion_value in configuration file to obtain different results. The following are some examples generated by using the provided configurations.

1. Image Animation

python inference.py --mode animation --cfg 'config/animation/animation1.yaml'
python inference.py --mode animation --cfg 'config/animation/animation6.yaml'

2. Video Editing

python inference.py --mode vid_edit --cfg 'config/vid_edit/demo1.yaml' # yaw
python inference.py --mode vid_edit --cfg 'config/vid_edit/demo2.yaml' # closing eyes

3. Image Editing

python inference.py --mode img_edit --cfg 'config/img_edit/demo1.yaml' # yaw
python inference.py --mode img_edit --cfg 'config/img_edit/demo2.yaml' # pout
python inference.py --mode img_edit --cfg 'config/img_edit/demo3.yaml' # close eyes
python inference.py --mode img_edit --cfg 'config/img_edit/demo4.yaml' # move eyeballs

4. Linear Manipulation

python inference.py --mode manipulation --cfg 'config/manipulation/demo1.yaml' # yaw
python inference.py --mode manipulation --cfg 'config/manipulation/demo2.yaml' # pitch
python inference.py --mode manipulation --cfg 'config/manipulation/demo5.yaml' # close & open eyes
python inference.py --mode manipulation --cfg 'config/manipulation/demo6.yaml' # move eyeballs

5. Animating Your Own Data

  1. Data preperation (image & video cropping)
python utils/crop.py --mode img --data_path <YOUR_IMG_PATH> # crop image
python utils/crop.py --mode vid --data_path <YOUR_VID_PATH> # crop video

You can use increase_scale and increase_top_scale flags to adjust bounding box scales. Results will be saved at ./data/source and ./data/driving

  1. Set correct source_path, driving_path and save_dir in your configuration file
  2. Play with motion_value in configuration and run following command. By default (motion_value=0), the source image will not be edited.
python inference.py --mode animation --cfg <YOUR_CONFIG_FILE_PATH>

Citation

@article{wang2025lia,
  title={LIA-X: Interpretable Latent Portrait Animator},
  author={Wang, Yaohui and Yang, Di and Chen, Xinyuan and Bremond, Francois and Qiao, Yu and Dantcheva, Antitza},
  journal={arXiv preprint arXiv:2508.09959},
  year={2025}
}

About

LIA-X: Interpretable Latent Portrait Animator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published