Skip to content
Cutshed
Menu

Image · 19

Image upscaler

Real-ESRGAN’s small general model multiplies each side by four. The long edge is capped at 512 pixels before that, so a phone tab can finish, and the export is at most about 2048 on the long side.

Real-ESRGAN general x4v3 (BSD-3-Clause) is about 4.6 MB. Large photos are scaled down to a 512 px long edge first, then enlarged 4× in tiles, so a phone shot does not try to allocate a poster-sized tensor. Fine type in a screenshot will sharpen; it will not invent a face that was never there.

How to use it

The network is SRVGGNetCompact, input RGB in 0–1, output four times the width and height. The page cuts the picture into 128-pixel tiles so one tensor does not own the whole image. Tiles run on WASM. WebGPU is skipped because this graph’s shapes change with the tile.

A 32×32 icon becomes 128×128. A 4000-pixel photo is reduced to a 512 long edge first, then scaled, so you do not wait on a multi-gigabyte tensor. If you need a specific crop sharp, crop first, then upscale that crop.

The look is a learned guess of edges. Text and faces can look over-sharp or waxy. It will not recover a license plate that was ten pixels tall.

Tips

  • Upscale a thumbnail-sized still, not a 4K frame you already have.
  • PNG output is large. Convert to JPG afterwards if you are posting it.
  • Run it once. A second pass invents more texture than detail.

FAQ

Which Real-ESRGAN file is this?

realesr-general-x4v3, the compact general model, about 4.6 MB. The older x4plus network is much larger and is not shipped.

Why is my photo not 4× the original size?

Sources longer than 512 pixels on the long edge are reduced first. The cap keeps the tab alive.

Is the image uploaded?

No.

License

Real-ESRGAN is BSD-3-Clause (Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan, and contributors). ONNX Runtime Web is MIT. The model license does not cover the photo.