← all repositories
reiinakano/arbitrary-image-stylization-tfjs

Style transfer that doesn't know your secrets

Neural style transfer in the browser, no server required, no style limits.

1.2k stars JavaScript Image · Video · AudioML Frameworks
arbitrary-image-stylization-tfjs
Not currently ranked — collecting fresh signals.
star history

What it does

This project runs arbitrary neural style transfer entirely in your browser using TensorFlow.js. Upload any content image and any style image—Van Gogh, your kid’s crayon drawing, a JPEG from 1997—and the network redraws the content in that style. No pre-selected style list, no server round-trips. Your photos never leave your machine; the model and the code come to you.

The interesting bit

The trick is a two-network architecture: a style network compresses any image into a 100-dimensional “style vector,” and a transformer network applies that vector to your content image. Because style becomes a portable number, you can blend styles like paint, or dial stylization strength up and down by averaging the content image’s own style vector with your chosen style.

Key highlights

  • Arbitrary styles: works with any style image, not just pre-trained ones
  • ~12MB total model download (distilled MobileNet-v2 style network + separable-convolution transformer)
  • Style blending and strength control via weighted vector averaging
  • Knowledge distillation shrank the original Inception-v3 style network from ~36.3MB to ~9.6MB
  • Depthwise separable convolutions cut the transformer from 7.9MB to 2.4MB and “drastically” improved speed

Caveats

  • The distilled MobileNet-v2 style network trades some quality for that 4× size reduction
  • No mention of performance on low-end devices or non-Chrome browsers
  • Project appears to be a demo/learning exercise; last substantive activity unclear from README

Verdict

Worth a look if you want client-side ML with actual privacy, or if you’re building browser-based creative tools and need a reference implementation. Skip if you need production-grade image generation; this is a well-explained proof of concept, not a product.

Frequently asked

What is reiinakano/arbitrary-image-stylization-tfjs?
Neural style transfer in the browser, no server required, no style limits.
Is arbitrary-image-stylization-tfjs open source?
Yes — reiinakano/arbitrary-image-stylization-tfjs is open source, released under the Apache-2.0 license.
What language is arbitrary-image-stylization-tfjs written in?
reiinakano/arbitrary-image-stylization-tfjs is primarily written in JavaScript.
How popular is arbitrary-image-stylization-tfjs?
reiinakano/arbitrary-image-stylization-tfjs has 1.2k stars on GitHub.
Where can I find arbitrary-image-stylization-tfjs?
reiinakano/arbitrary-image-stylization-tfjs is on GitHub at https://github.com/reiinakano/arbitrary-image-stylization-tfjs.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.