https://github.com/ToonCrafter/ToonCrafter
[SIGGRAPH Asia 2024, Journal Track] ToonCrafter: Generative Cartoon Interpolation
https://github.com/ToonCrafter/ToonCrafter
Last synced: about 2 months ago
JSON representation
[SIGGRAPH Asia 2024, Journal Track] ToonCrafter: Generative Cartoon Interpolation
- Host: GitHub
- URL: https://github.com/ToonCrafter/ToonCrafter
- Owner: Doubiiu
- License: apache-2.0
- Created: 2024-05-28T19:17:40.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-09-09T00:10:21.000Z (7 months ago)
- Last Synced: 2025-02-19T01:03:40.504Z (about 2 months ago)
- Language: Python
- Homepage: https://doubiiu.github.io/projects/ToonCrafter/
- Size: 67.3 MB
- Stars: 5,631
- Watchers: 60
- Forks: 471
- Open Issues: 51
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-llm-projects - ToonCrafter - trained image-to-video diffusion priors. (Projects / π Image)
- ai-game-devtools - ToonCrafter
- awesome-acg - ToonCrafter - Generative Cartoon Interpolation. [English] (Image Generation)
- AiTreasureBox - ToonCrafter/ToonCrafter - 04-07_5748_0](https://img.shields.io/github/stars/ToonCrafter/ToonCrafter.svg)|a research paper for generative cartoon interpolation| (Repos)
README
## ___***ToonCrafter: Generative Cartoon Interpolation***___
![]()
_**[Jinbo Xing](https://doubiiu.github.io/), [Hanyuan Liu](https://github.com/hyliu), [Menghan Xia](https://menghanxia.github.io), [Yong Zhang](https://yzhang2016.github.io), [Xintao Wang](https://xinntao.github.io/), [Ying Shan](https://scholar.google.com/citations?hl=en&user=4oXBp9UAAAAJ&view_op=list_works&sortby=pubdate), [Tien-Tsin Wong](https://ttwong12.github.io/myself.html)**_
From CUHK and Tencent AI Lab.at SIGGRAPH Asia 2024, Journal Track
## π Introductionβ οΈ Please check our [disclaimer](#disc) first.
π€ ToonCrafter can interpolate two cartoon images by leveraging the pre-trained image-to-video diffusion priors. Please check our project page and paper for more information.
### 1.1 Showcases (512x320)
Input starting frame
Input ending frame
Generated video
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
### 1.2 Sparse sketch guidance
Input starting frame
Input ending frame
Input sketch guidance
Generated video
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
### 2. Applications
#### 2.1 Cartoon Sketch Interpolation (see project page for more details)
Input starting frame
Input ending frame
Generated video
![]()
![]()
![]()
![]()
![]()
![]()
#### 2.2 Reference-based Sketch Colorization
Input sketch
Input reference
Colorization results
![]()
![]()
![]()
![]()
![]()
![]()
## π Changelog
- [ ] Add sketch control and colorization function.
- __[2024.05.29]__: π₯π₯ Release code and model weights.
- __[2024.05.28]__: Launch the project page and update the arXiv preprint.## π§° Models
|Model|Resolution|GPU Mem. & Inference Time (A100, ddim 50steps)|Checkpoint|
|:---------|:---------|:--------|:--------|
|ToonCrafter_512|320x512| ~24G & 24s (`perframe_ae=True`)|[Hugging Face](https://huggingface.co/Doubiiu/ToonCrafter/blob/main/model.ckpt)|We get the feedback from issues that the model may consume about 24G~27G GPU memory in this implementation, but the community has lowered the consumption to ~10GB.
Currently, our ToonCrafter can support generating videos of up to 16 frames with a resolution of 512x320. The inference time can be reduced by using fewer DDIM steps.
## βοΈ Setup
### Install Environment via Anaconda (Recommended)
```bash
conda create -n tooncrafter python=3.8.5
conda activate tooncrafter
pip install -r requirements.txt
```## π« Inference
### 1. Command lineDownload pretrained ToonCrafter_512 and put the `model.ckpt` in `checkpoints/tooncrafter_512_interp_v1/model.ckpt`.
```bash
sh scripts/run.sh
```### 2. Local Gradio demo
Download the pretrained model and put it in the corresponding directory according to the previous guidelines.
```bash
python gradio_app.py
```## π€ Community Support
1. ComfyUI and pruned models (fp16): [ComfyUI-DynamiCrafterWrapper](https://github.com/kijai/ComfyUI-DynamiCrafterWrapper) (Thanks to [kijai](https://twitter.com/kijaidesign))|Model|Resolution|GPU Mem. |Checkpoint|
|:---------|:---------|:--------|:--------|
|ToonCrafter|512x320|12GB |[Hugging Face](https://huggingface.co/Kijai/DynamiCrafter_pruned/blob/main/tooncrafter_512_interp-fp16.safetensors)|2. ComfyUI. [ComfyUI-ToonCrafter](https://github.com/AIGODLIKE/ComfyUI-ToonCrafter) (Thanks to [Yorha4D](https://github.com/Yorha4D))
3. Colab. [Code](https://github.com/camenduru/ToonCrafter-jupyter) (Thanks to [camenduru](https://github.com/camenduru)), [Code](https://gist.github.com/0smboy/baef995b8f5974f19ac114ec20ac37d5) (Thanks to [0smboy](https://github.com/0smboy))
4. Windows platform support: [ToonCrafter-for-windows](https://github.com/sdbds/ToonCrafter-for-windows) (Thanks to [sdbds](https://github.com/sdbds))
5. Sketch-guidance implementation: [ToonCrafter_with_SketchGuidance](https://github.com/mattyamonaca/ToonCrafter_with_SketchGuidance) (Thanks to [mattyamonaca](https://github.com/mattyamonaca))
## π Citation
Please consider citing our paper if our code is useful:
```bib
@article{xing2024tooncrafter,
title={ToonCrafter: Generative Cartoon Interpolation},
author={Xing, Jinbo and Liu, Hanyuan and Xia, Menghan and Zhang, Yong and Wang, Xintao and Shan, Ying and Wong, Tien-Tsin},
journal={arXiv preprint arXiv:2405.17933},
year={2024}
}
```## π Acknowledgements
We would like to thank [Xiaoyu](https://engineering.purdue.edu/people/xiaoyu.xiang.1) for providing the [sketch extractor](https://github.com/Mukosame/Anime2Sketch), and [supraxylon](https://github.com/supraxylon) for the Windows batch script.
## π’ Disclaimer
We have not set up any official profit-making projects or web applications. Please be cautious.Calm down. Our framework opens up the era of generative cartoon interpolation, but due to the variaity of generative video prior, the success rate is not guaranteed.
β οΈThis is an open-source research exploration, instead of commercial products. It can't meet all your expectations.
This project strives to impact the domain of AI-driven video generation positively. Users are granted the freedom to create videos using this tool, but they are expected to comply with local laws and utilize it responsibly. The developers do not assume any responsibility for potential misuse by users.
****