← All models

image-to-image (cartoonization / stylization) Β· vision Β· WASM Β· ~8 MB / style

AnimeGANv2 β€” turn a photo into anime

Give this model any photo and it repaints it in a learned anime style β€” smoothed shading, bold outlines, painterly skies. AnimeGANv2 is a GAN trained to convert real photographs into the look of specific animators: Hayao (Ghibli-ish), Shinkai (Makoto Shinkai's luminous scenery), and Paprika (Satoshi Kon). It's not a colour filter β€” it re-draws the scene. Runs entirely on your device via ONNX Runtime Web; the photo never leaves the tab.

At a glance

Modelvumichien/AnimeGANv2_{Hayao,Shinkai,Paprika} β€” AnimeGANv2, one ONNX per style
Taskimage-to-image (cartoonization / photo→anime style transfer) — run via raw ONNX Runtime Web (see note below)
Runtimeonnxruntime-web 1.21 (transformers.js has no AnimeGAN class / no stylization task)
Inputgenerator_input:0 [1, H, W, 3] float32 in βˆ’1…1 β€” NHWC (channels-last, TensorFlow export), H/W rounded to a multiple of 32
Output…/out_layer/Tanh:0 [1, H, W, 3] float32 in βˆ’1…1 β€” the anime repaint, mapped back to RGB
Quantizationfp32 ONNX (single file per style) β€” runs on the plain WASM execution provider, no WebGPU needed
BackendWebAssembly (single-threaded on GitHub Pages) β€” ~1.3 s @256-px to ~5 s @512-px
Download~8.4 MB per style, cached after first load (styles load lazily; auto-inits on return)
LicenseApache-2.0
Web APIsWebAssembly, Web Workers, OffscreenCanvas, ImageBitmap β€” all Baseline widely available

Run it

Pick a photo, choose an anime style, and repaint it. Drag the divider to compare the photo with its anime version.

β—€ photoanime β–Ά
Drop / choose your own photo (landscapes and portraits both work)

Everything runs on your device β€” the photo and every stylized pixel never leave the tab. Gallery images are rights-cleared samples (see each caption for the source).

See inside

Style is a learned repaint, not a preset. The three styles were each trained on a different animator's films, so the same photo comes out differently: Hayao softens into gentle Ghibli pastels, Shinkai pushes saturated, luminous skies and rim-light, Paprika flattens into bold graphic colour. Switch styles below and re-run the same image to see how differently each model paints it.

Anime-fy a photo, then switch styles and run again to compare.

Why it matters

Stylizing a photo on-device turns any picture into shareable art, privately and free per image:

AnimeGANv2 renders a stylistic interpretation β€” it's an artistic redraw, not a faithful reproduction, and fine text or faces may be simplified.

Use cases

Basics

Pick a photo and a style, then anime-fy it β€” wipe between the photo and its anime version.

Practical

Make an anime avatar from your own photo and download it as a PNG.

Wild

Style-off: run all three styles on the same photo side by side and compare how each animator paints it.

Multi-model

Matte β†’ anime: cut out the subject with background removal, then anime-fy just the subject onto a clean backdrop.

How the API works

transformers.js has no AnimeGAN class and no stylization task, so we run the ONNX graph directly with ONNX Runtime Web. Note the NHWC (channels-last) layout and the βˆ’1…1 tanh range:

import * as ort from "onnxruntime-web";

const session = await ort.InferenceSession.create(styleBytes, { executionProviders: ["wasm"] });

// photo β†’ [1,H,W,3] float32 in [-1,1] (NHWC, channels-last β€” it's a TensorFlow export)
const input = new ort.Tensor("float32", toNHWC(photo, H, W), [1, H, W, 3]);
const { ["…/out_layer/Tanh:0"]: out } = await session.run({ ["generator_input:0"]: input });

// out is [1,H,W,3] in [-1,1] β†’ map (v+1)/2 back to RGB
const anime = tanhToImage(out.data, H, W);

Inference and the whole output composite run in a Web Worker so the UI never blocks; each ~8 MB style is fetched through Cache Storage the first time you pick it, so a returning visit auto-initialises with no re-download.

References