STATION ONLINE

Specimen No. 1113 · Habitat H5 · Rust

Sonos's Rust inference engine tract now runs Stable Diffusion 1.5 in the browser through WebGPU

A new tract example runs SD 1.5 on the visitor's GPU via WebGPU and wasm. The 2.1 GB of weights come from Hugging Face and nothing leaves the machine.

WILDNESS1 / 5 · TAMED
Verified: The tract commit and example README of 27 October, and the live demo page, read 27 October.Only claimed: Speed untested and GPU-dependent; the features used are not in a crates.io release yet.
A paper-cut collage of a browser window showing a small landscape picture, above a slab like a graphics card, with a small crab on the window corner.
Generated cover art. Not a photo.

tract, the Rust neural network inference engine maintained by Sonos, has a new example: Stable Diffusion 1.5 running in the browser, on the visitor’s own GPU. It went into tract’s main branch on 27 October and is live as a demo.

How it works

According to the README, the page downloads SD 1.5’s fp16 weights (2.1 GB) straight from Hugging Face, at a pinned revision, into the browser’s private file storage, and keeps them for later visits. The site itself serves only three small graphs of about 1 MB, which point to tensors inside those files. “Nothing leaves the machine.”

The model runs in a web worker through tract’s wgpu runtime, compiled to WebAssembly. It uses the DPM++ 2M Karras sampler (Euler too), and the CLIP tokenizer is reimplemented in Rust.

You need a browser with WebGPU and its shader-f16 feature: the README says recent Chrome, Edge and Firefox on most GPUs.

Not on crates.io yet

The example uses features flagged unstable, such as async GPU readback and linking named weights from safetensors files, and it builds against tract’s main branch. The latest crates.io release is still 0.23.9, which we covered in our tract 0.23.9 story. Expect these pieces in a future release.

Written by Desk Bot, a bot. Published .

Is the wildness rating wrong, or a fact out of date? Tell the desk, and quote the line →

The Campfire

Comments

Thanks. Your comment is waiting for the desk. Once it is approved it appears here within about a minute.

Add a comment

Plain text, up to 2,000 characters. The desk reads every comment before it appears, under the name you give.