2xParimgCompact

Tiny, very fast 2× photo upscaler.

A compact 2× photo model trained on Microsoft's ImagePairs dataset. At 2.4 MB it upscales a tile in about a quarter of a second on CPU, which makes it the quick option in our apps.

Scale
2×
Parameters
0.6M
CPU time per 256 px tile
0.26s
ONNX file
2.4MB

Example output

Drag the handle to compare. Produced by running this model.

After: Input: a 240 px photo, enlarged with bicubic resizing. Output: the model's 2× result.
Before: Input: a 240 px photo, enlarged with bicubic resizing. Output: the model's 2× result.
BeforeAfter
Input: a 240 px photo, enlarged with bicubic resizing. Output: the model's 2× result.

Technical details

Architecture
SRVGGNetCompact (Real-ESRGAN compact, 64 features, 16 convs)
Fine-tuned from
2x-Compact-Pretrain
Training data
Microsoft ImagePairs
Training
100,000 iterations
ONNX build
FP32, opset 17, any image size
Input
RGB, NCHW, values 0–1
Benchmark
ONNX Runtime CPU, Apple M2 Pro
Original release
5 May 2023

Good for

  • Quick previews
  • Everyday photos
  • Large batches

Run it in Flutter

This model runs as-is with our open-source flutter_super_resolution package (MIT), which tiles large images and uses Core ML on Apple devices when available. It works on iOS, Android (ARM devices), macOS and Windows.

pubspec.yaml · Dartgeneral2xlow.onnx
dependencies:
  flutter_super_resolution: ^1.1.1

// Load the model, then upscale a ui.Image
final upscaler = FlutterUpscaler(tileSize: 128, overlap: 8);
await upscaler.initializeModel('assets/models/general2xlow.onnx');

final result = await upscaler.upscaleImage(
  image,
  scale: 2,
  onProgress: (progress, message) => print('$message ${(progress * 100).round()}%'),
);

upscaler.dispose();

Files in our release

The same model can ship under more than one name. Check the SHA-256 to confirm a download.

FileSizeSHA-256
general2xlow.onnx2.4 MB3036e9e42202b0ba…
portrait2xlow.onnx2.4 MB3036e9e42202b0ba…

Related models

All models

Credits and license

Original model
2xParimgCompact
Created by
Philip Hofmann (Helaman)
License
CC-BY-4.0
Changes
Converted from PyTorch to an FP32 ONNX file

Check the license terms before using this model in a product. More permissive models

Building with AI?

Our models are available as APIs for teams who want to build on them. Tell us what you're working on.

Get in touch