SwinIR: the enlargement baseline everyone measures against, and where to run it
Apache 2.0, weights free, and the model file is under 12 megabytes, which is small enough that hardware is not part of the decision. Self-hosting needs PyTorch 1.8 or newer, with a GPU making it quick rather than making it possible. In your browser it runs on CNAPS Studio, included in the basic plan.
This is the model the rest of the field measured itself against for years. It enlarges a photograph by reconstructing detail rather than duplicating pixels, and it does so by reading the picture at two levels at once: small windows of a few pixels for texture, and the whole composition for structure. That combination is what keeps a reconstructed brick wall from turning into mush.
The cost is written into its own published numbers, which is unusually candid. It reports scores at four enlargement factors, and the decline from 2x to 8x is steep. Four image upscalers sit in the CNAPS Studio catalog, and this is the well-understood original.
What it actually is
A transformer built for restoration in four stages. A shallow layer extracts basic features, a stack of residual transformer blocks with shifted-window attention does the reconstruction work, an upsampling stage produces the target size, and a final stage sharpens the result.
The shifted-window idea is the core of it. Attention over every pixel pair in a large photograph would be impossibly expensive, so the model attends within small windows, then shifts those window boundaries and attends again. Information crosses between windows over successive layers, giving a view of the whole picture at a fraction of the cost.
Training used DIV2K, a set of 3,450 high-quality photographs, degraded by standard downsampling to create training pairs. The loss combines pixel accuracy with a perceptual term, and training took about 1.6 days. One detail matters in practice: there is a separate trained model per enlargement factor rather than one model covering all of them.
ArchitectureSwin Transformer for image restorationModel sizeAbout 11.8 megabytes of weightsScale factors2x, 3x, 4x and 8x, one model per factorTraining dataDIV2K, 3,450 high-quality photographsLossPixel accuracy plus a perceptual termRequirementsPyTorch 1.8 or newer; GPU optionalInputAny colour photograph, any sizePublished2021, at a major computer vision conferenceLicenseApache 2.0
The published numbers
Four scores on the same test set at four different enlargement factors, measured in decibels of peak signal-to-noise ratio. That metric compares the reconstruction against the true high-resolution original and higher is better; there is no maximum, so the figures matter relative to each other rather than on their own.
On Set5, a standard set of five photographs: 38.47 at 2x, 34.91 at 3x, 32.92 at 4x, and 27.65 at 8x.
That progression is the most useful thing in this post. Each doubling costs you sharpness, and the fall is not linear: going from 2x to 4x loses about five and a half decibels, while going from 4x to 8x loses another five and a quarter on top. By 8x the model is inventing most of what you see. If you need eight times the size, two passes of 2x through a cleanup step will often serve you better than one pass of 8x, and it is worth testing that on your own material.
The numbers come from the authors, and the paper was peer reviewed at a major conference and nominated for its best paper award, which is stronger provenance than a vendor blog post. The datasets are public and standard, so anyone can reproduce them.
How it compares to the other upscalers here
SwinIRSwin2SRPiSA-SRSMFANet+Scale factors2x, 3x, 4x, 8x, one model per factor2x, 3x, 4x, 8x from one modelSee its own postSee its own postSet5 at 2x38.47 dBNot published for this scaleSee its own postSee its own postSet5 at 4x32.92 dB32.93 dBSee its own postSee its own postSet5 at 8x27.65 dBNot published for this scaleSee its own postSee its own postTraining timeAbout 1.6 days2 to 3 days, converging about a third fasterSee its own postSee its own postLicenseApache 2.0Apache 2.0See its own postSee its own post
The 4x row is the only direct head-to-head, and the answer is that there is nothing in it: 32.92 against 32.93 is a hundredth of a decibel, which no eye will see. Anyone claiming one of these is sharper than the other at four-times enlargement is reading noise as signal.
So choose on everything else. Reach for SwinIR when you want the heavily cited baseline, or when you want published numbers at 2x and 8x specifically, since it is the only one here that reports them. Reach for Swin2SR when you would rather have a single model covering every factor. Reach for PiSA-SR or SMFANet+ when their own posts fit your material, and for SeedVR2 3B when the input is video rather than a still.
What to chain it with
One image in, a larger image out, which makes it a finishing step rather than a starting point.
Two chains matter. For generated pictures, FLUX Schnell and FLUX.2 KLEIN 4B stop at 1024 pixels, and a 2x or 4x pass here is what turns that into something you can print or use as a banner. For archives, order matters: run JPEG Quality Restoration or Image Denoiser first to remove compression damage and noise, then enlarge, because enlarging first magnifies the damage into something no later step can remove.
For documents specifically, a 2x pass in front of DeepSeekOCR or PaddleOCR often turns unreadable small text into readable text, which is a cheaper fix than rescanning.
Open SwinIR in CNAPS Studio, run one photo at 8x and the same photo twice at 2x, and compare the two before deciding which route your archive deserves.
Sources
- github.com/JingyunLiang/SwinIR and arXiv:2108.10257 for the Apache 2.0 license, the architecture and shifted-window design, the model size, the DIV2K training set and schedule, the per-scale model structure, and the four PSNR scores quoted above.
- github.com/mv-lab/swin2sr for Swin2SR's 4x score and its faster convergence.
- docs.cnaps.ai/ai-model-hub for the CNAPS Studio input and output and the other upscalers in the catalog.