Self-hosted Real-ESRGAN model
Real-ESRGAN General x4v3
A compact SRVGGNetCompact network trained for real-world degradation: restores photographs, illustrations, and screenshots instead of merely enlarging clean bicubic sources.
Model specifications
- Scale factor
- 4x
- Precision
- fp32
- Parameters
- 1.21M · fp32
- Exact size
- 4,866,417 bytes
- Best for
- Photos, screenshots, JPEGs
- License
- BSD-3-Clause
SHA-256
1940a93ee08283a0a7286183186357b1688fe9fa8ede74604b424586aaddf112 Model architecture and pretrained weights are attributed to xinntao/Real-ESRGAN. The ONNX conversion is hosted at CoderViking/realesr-general-x4v3-onnx. Distributed under the BSD-3-Clause license.
Use the self-hosted file
This is the same same-origin asset requested by WKO AI's studio. Remote model fallback is disabled, so a missing mirror fails explicitly.
import * as ort from 'onnxruntime-web';
// Raw ONNX Runtime Web checkpoint (NCHW, opset 17, dynamic H/W).
const session = await ort.InferenceSession.create('/models/CoderViking/realesr-general-x4v3-onnx/realesr-general-x4v3.onnx');
const input = new ort.Tensor('float32', nchwRgbData, [1, 3, height, width]);
const results = await session.run({ [session.inputNames[0]]: input });
// results[session.outputNames[0]] -> [1, 3, 4*height, 4*width]
// Floats are not clamped; clamp to [0,1] before converting to u8.