Skip to content
runonweb

Imagine: Image generation

Generate images from a text prompt entirely in the tab. Bonsai Image 4B runs on WebGPU. No API key, no upload, nothing leaves the device after the first download.

Try Imagine

Runs in this tab · nothing uploaded

WebGPU required · first download is several GB

Weights

Resolution

Try with

What it does

A picture from a sentence. On your GPU.

  • Bonsai Image 4B (Prism ML, 2026) is a 1-bit / 1.58-bit FLUX.2 Klein deployment. WebGPU only. There is no WASM path.
  • Default binary is the smaller payload (~3.4 GB). Pass size: "ternary" (~3.9 GB) for the quality-oriented weights.
  • Tuned for 4 FlowMatch-Euler steps at guidance 1.0. More steps rarely help and can add artifacts. Negative prompts are not used.
  • Default output is 512×512. Native training resolution is 1024×1024; sides must be multiples of 16 (32 recommended).
  • First download is several gigabytes and is cached in IndexedDB. Chromium + a recent GPU is required.

Specifications

Package
runonweb/image
License
Apache-2.0
Download
~3.4 GB (binary)ternary ~3.9 GB
Quantization
1-bit / 1.58-bit on WebGPU
Backend
WebGPU only
Input
Text

Get started with runonweb/image

pnpm add runonweb
runonweb/imagets
import { ImageGenerator } from 'runonweb/image'

const gen = new ImageGenerator({ size: 'binary' })
await gen.load()

const { image, seed } = await gen.generate(
  'A bonsai tree in a quiet ceramic studio, soft morning light',
)
document.querySelector('img').src = URL.createObjectURL(image)

gen.dispose()

Same shape everywhere: construct, load(), run, dispose(). Pass onProgressto show download progress on first use.

Questions about Imagine

Does Imagine run on device?

Yes. Weights download once and stay in the browser. Nothing is sent to a server.

Which model does Imagine use?

Bonsai Image 4B (FLUX.2 Klein) by Prism ML, under Apache-2.0. runonweb loads the prism-ml/bonsai-image-binary-4B-mlx-1bit weights and runs 1-bit / 1.58-bit on WebGPU.

How big is the Imagine download?

~3.4 GB (binary) · ternary ~3.9 GB, fetched once on first use. The browser caches the weights, so later loads skip the network and keep working offline.

What does Imagine cost?

Nothing. runonweb is free and MIT-licensed, with no device limits, tokens or sign-in. The weights keep their own license: Apache-2.0.

Which browsers support Imagine?

A Chromium browser with WebGPU and a recent GPU. This model has no WebAssembly fallback.

Can I use a different model with runonweb/image?

Yes. See each module’s docs for the options it accepts (model, size, language…). Check the license and test both backends before shipping.