← All models

image-to-image (denoising) · vision · WASM · ~75 MB

SCUNet — clean the noise from a photo

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.

At a glance

ModelHeliosoph/scunet-onnx — SCUNet (Swin-Conv-UNet), blind real-world variant (scunet_color_real_psnr)
Taskimage-to-image (image denoising) — run via raw ONNX Runtime Web (see note below)
Runtimeonnxruntime-web 1.21 (transformers.js has no SCUNet class / no denoising task)
Inputimage [1, 3, H, W] float32 in 0–1 — the noisy image, plain RGB (no normalisation), H/W rounded to a multiple of 64
Outputdenoised [1, 3, H, W] float32 in 0–1 — the cleaned image, resized back to your photo's aspect
Quantizationfp32 ONNX (weights in an external-data sidecar) — runs on the plain WASM execution provider, no WebGPU needed
BackendWebAssembly (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)
LicenseApache-2.0 · SCUNet (based on cszn/SCUNet)
Web APIsWebAssembly, Web Workers, OffscreenCanvas, ImageBitmap — all Baseline widely available

Run it

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.

◀ noisy inputdenoised ▶
Drop / choose your own noisy photo (a real high-ISO / low-light shot works best)

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).

See inside

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.

Denoise a photo to see where the model cleaned it.

Why it matters

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).

Use cases

Basics

Add noise to a photo, then watch SCUNet remove it — wipe between noisy and cleaned and see the HF energy drop.

Practical

Clean up a real grainy low-light photo, then download the denoised image.

Wild

Push it: crank the noise to a blizzard and find where denoising starts smoothing away real detail.

Multi-model

Denoise → upscale: clean a noisy photo, then run Real-ESRGAN 4× so the upscaler sharpens signal, not grain.

How the API works

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.

References