Table of contents
SwinIR is very good at upscaling small and low quality images. Like Real-ESRGAN, it is fast and cheap to run.
SwinIR is a great choice for incorporating fast upscaling into web development pipelines. For example, at Replicate we used SwinIR as part of our SDXL fine-tuning API to make sure input images were big enough for the model to work with.
It is very good at:
It does not:
In this landscape example a low quality image of mountains with plenty of JPEG compression artefacts is upscaled 4x to 1400px in 4.5 seconds. The output is much sharper and the compression artefacts are removed. The trees and grass have more detail.
In this portrait example a poorly compressed 350px portrait photo is upscaled 4x to 1400px in 4 seconds. All the compression artefacts are removed, and the face has a consistent likeness with the original. Edges are sharper and hair detail is especially good. The eyes need work.
If we compare SwinIR to Real-ESRGAN (without any face enhancements), we can see just how much better SwinIR is at upscaling. SwinIR has much better textures, particularly in the facial hair and skin detail.
SwinIR takes longer to run, 4s vs Real-ESRGAN’s 1.4s. But it is still very fast.
If you want to incorporate SwinIR into your own web development pipeline, you can use our API to run it in the cloud.
For a 4x upscale use the Real-World Image Super-Resolution-Large
task. For a 2x upscale use Real-World Image Super-Resolution-Medium
.
Try our official JavaScript client to run SwinIR with Node.js:
Set the REPLICATE_API_TOKEN
environment variable:
Run jingyunliang/swinir:
SwinIR takes an image as input. You can use URLs or base 64 strings.
To learn more, take a look at the guide on getting started with Node.js.
You can also use our official Python client. Read our getting started with Python docs.
Run jingyunliang/swinir:
You can also run SwinIR using Golang, Swift, Elixir, and others.