Cartoon Diffusion
Turn a photo into a cartoon. Diffusion model and Python library, both published.
- Python
- MIT
- PyPI
- Hugging Face
What it does
A image-to-cartoon pipeline built on Stable Diffusion techniques and fine-tuned on the Google Cartoon Set avatar dataset from Kaggle. Published as two things: the trained model, and a Python library that wraps it so converting an image is a two-line call rather than a training setup.
- Good for
- Turning photographs into cartoon avatars from Python, without standing up a training pipeline first.
How do I install it?
Cartoon Diffusion is published to PyPI and Hugging Face. Install it with one command:
pip install cartoon-diffusionUsage
A complete, runnable example — nothing elided.
from cartoon_diffusion import CartoonifyDiffusionPipeline
# Load the pipeline
pipeline = CartoonifyDiffusionPipeline.from_pretrained("wizcodes12/image_to_cartoonify")
# Convert an image to a cartoon
cartoon = pipeline("path/to/selfie.jpg")
cartoon.save("cartoon_output.png")
# Or pass a PIL Image
from PIL import Image
image = Image.open("selfie.jpg")
cartoon = pipeline(image)
cartoon.save("cartoon_output.png")Built with
- Python
- Stable Diffusion
- Diffusers
- PyTorch
- Computer Vision