FlexiClip: Locality-Preserving Free-Form Character Animation
Given a still image in vector format and a text prompt describing a desired action, our method automatically animates the drawing with respect to the prompt
git clone https://github.com/kingnobro/FlexiClip.git
cd FlexiClip
To set up our environment, please run:
conda env create -f environment.yml
Next, you need to install diffvg:
git clone https://github.com/BachiLi/diffvg.git
cd diffvg
git submodule update --init --recursive
python setup.py installSingle-layer animation:
bash scripts/run_flexiclip.sh
Multi-layer animation:
bash scripts/run_layer_flexiclip.sh
For humans, we use UniPose. Take a look at our example SVG input. Specifically, we merge 5 points on face (tools.merge_unipose_ske.py) due to the limitations of mesh-based algorithms in altering emotions, alongside the video diffusion model's inability to precisely direct facial expressions.
For broader categories, first install scikit-geometry:
conda install -c conda-forge scikit-geometry
Then put your SVG files under svg_input. For example, if your download SVG from the Internet and its name is cat, then you create the folder svg_input/cat and there is a file cat.svg in this folder.
Then, modify the target in preprocess/keypoint_detection.py and run:
python -m preprocess.keypoint_detection
You can adjust epsilon, max_iter and factor to adjust the complexity of the skeleton.
For SVG downloaded from the Internet, there may exist complex grammars.
For a file cat_input.svg, we first use picosvg to remove grammars like group and transform:
picosvg cat_input.svg > cat.svg
Then you modify the SVG to 256x256 by running:
python -m preprocess.svg_resize
If you find this useful for your research, please cite the following:
@inproceedings{
khandelwal2025flexiclip,
title={FlexiClip: Locality-Preserving Free-Form Character Animation},
author={Anant Khandelwal},
booktitle={Forty-second International Conference on Machine Learning},
year={2025},
url={https://openreview.net/forum?id=xtxCM4XZ82}
}