image-to-image (denoising) · vision · WASM · ~75 MB
Give this model a noisy or grainy photo — high-ISO shots, low-light grain, sensor noise — and it removes the noise while keeping real detail: clean flats, crisp edges, no smeared texture. SCUNet (Swin-Conv-UNet) is a strong blind image denoiser. It's not a blur — it learned to tell noise apart from structure and strip only the noise. Runs entirely on your device via ONNX Runtime Web; the photo never leaves the tab.
| Model | Heliosoph/scunet-onnx — SCUNet (Swin-Conv-UNet), blind real-world variant (scunet_color_real_psnr) |
|---|---|
| Task | image-to-image (image denoising) — run via raw ONNX Runtime Web (see note below) |
| Runtime | onnxruntime-web 1.21 (transformers.js has no SCUNet class / no denoising task) |
| Input | image [1, 3, H, W] float32 in 0–1 — the noisy image, plain RGB (no normalisation), H/W rounded to a multiple of 64 |
| Output | denoised [1, 3, H, W] float32 in 0–1 — the cleaned image, resized back to your photo's aspect |
| Quantization | fp32 ONNX (weights in an external-data sidecar) — runs on the plain WASM execution provider, no WebGPU needed |
| Backend | WebAssembly (single-threaded on GitHub Pages) — a 320-px pass takes several seconds (a heavy model) |
| Download | ~75 MB (3.7 MB graph + 71 MB weights), cached after first load (auto-inits on return) |
| License | Apache-2.0 · SCUNet (based on cszn/SCUNet) |
| Web APIs | WebAssembly, Web Workers, OffscreenCanvas, ImageBitmap — all Baseline widely available |
Pick a photo and add a known amount of noise so you can watch SCUNet remove it — or drop your own genuinely grainy/low-light photo. Drag the divider to compare noisy vs cleaned.
The wipe above is the real evidence — slide it to watch the grain vanish. “HF energy” is the mean high-frequency (Laplacian) energy before → after; noise pumps it up and denoising brings it back down toward a clean image, while real edges survive.
Everything runs on your device — the photo and every denoised pixel never leave the tab. Gallery images are rights-cleared samples (see each caption for the source).
Where did the model actually do something? This is the noise-removed map: the per-pixel difference between the noisy input and the cleaned output, amplified. It glows across the noisy regions the model smoothed — and, crucially, stays comparatively quiet along real edges, because SCUNet preserves structure while stripping noise. A plain blur would light up the edges too.
Bright green = big change (noise removed); dark = untouched. Notice the glow fills the flat, noisy areas but eases off along strong edges — SCUNet removes the grain and keeps the structure, which is exactly what separates a denoiser from a blur.
Noise is the price of low light and small sensors. On-device denoising rescues those shots privately, with no upload and no per-image cloud cost:
SCUNet removes plausible noise; extreme noise cleans only partially, and the blind variant stays faithful rather than inventing texture (the GAN variant, not shipped here, does the opposite).
Add noise to a photo, then watch SCUNet remove it — wipe between noisy and cleaned and see the HF energy drop.
Clean up a real grainy low-light photo, then download the denoised image.
Push it: crank the noise to a blizzard and find where denoising starts smoothing away real detail.
Denoise → upscale: clean a noisy photo, then run Real-ESRGAN 4× so the upscaler sharpens signal, not grain.
transformers.js has no SCUNet class and no denoising task, so we run the ONNX graph directly with ONNX Runtime Web. In goes the noisy image, out comes the cleaned one:
import * as ort from "onnxruntime-web";
// the .onnx graph references its weights in an external-data sidecar (.onnx.data)
const session = await ort.InferenceSession.create(graphBytes, {
executionProviders: ["wasm"],
externalData: [{ path: "scunet_color_real_psnr.onnx.data", data: weightBytes }],
});
// noisy image → [1,3,H,W] float32 in [0,1] (plain RGB, no normalisation)
const input = new ort.Tensor("float32", toNCHW(noisy, W, H), [1, 3, H, W]);
const { denoised } = await session.run({ image: input });
// denoised is [1,3,H,W] in [0,1] → clamp to RGBA and resize back to the original aspect
const clean = tensorToImage(denoised.data, W, H);
Inference and the whole output composite run in a Web Worker so the UI never blocks, and the ~75 MB model is fetched through Cache Storage, so a returning visit auto-initialises with no re-download.