Unlimited Open Source Models

Get Plan
Skip to main content
Imagen

Real-ESRGAN API for AI Image Upscaling

Last updated · By ModelsLab Engineering

Upscale images 4x with Real-ESRGAN via REST API. Detail restoration, noise reduction, face enhancement, and batch processing on dedicated GPU infrastructure.

What is the Real-ESRGAN API?

Real-ESRGAN as a developer API

Real-ESRGAN (Real-World Enhanced Super-Resolution GAN) is a deep-learning model for upscaling photos and AI-generated images while preserving fine detail. It is the industry default for 4x super-resolution on real-world inputs that include compression artifacts, sensor noise, and low-detail regions.

The ModelsLab Real-ESRGAN API exposes the model as a single REST endpoint so developers can ship upscaling features inside SaaS apps, e-commerce catalogs, and creative tools without provisioning a GPU, downloading the model weights, or managing CUDA dependencies.

When to use the Real-ESRGAN API

Real-ESRGAN is the right choice when you need realistic upscaling on photos, AI-generated outputs, or scanned media. It outperforms generic bicubic upscaling and traditional deconvolution methods on textured surfaces, hair, and small text. For purely anime/illustration content, Real-ESRGAN-Anime is also exposed via the same endpoint.

  • 4x super-resolution on photos, screenshots, and AI-generated images
  • Specialized face enhancement on portraits via GFPGAN integration
  • Noise reduction and JPEG artifact removal during upscaling
  • Real-ESRGAN-Anime variant for illustration and 2D art
  • Chain it after image generation: pass the output URL as init_image

Real-ESRGAN models: photo vs anime

Pick the model with model_id. All four run on the same endpoint at the same price; scale defaults to 2 and is capped at 8.

model_idTrained forUse it on
RealESRGAN_x4plusReal-world photos with noise and JPEG artifactsPhotos, AI-generated images, screenshots
RealESRGAN_x4plus_anime_6BAnime and line artIllustration, manga, flat-shaded 2D art
RealESRGAN_x2plus2x photo upscalingImages that only need to double in size
realesr-general-x4v3General scenes (default)Mixed inputs when you do not set model_id

Real-ESRGAN vs running it on Replicate

On Replicate, nightmareai/real-esrgan is billed by GPU time at the rate of the hardware it runs on. On ModelsLab each upscale is a flat $0.0047 against your plan, with no per-upscale charge on the $149 Open Source Unlimited plan, and the same key covers image generation, editing and video. More on the switch: Replicate alternatives.

Run Real-ESRGAN without installing it (GitHub → API)

The GitHub release (xinntao/Real-ESRGAN) needs Python, PyTorch, CUDA drivers and a GPU. The API runs the same model family: send an image URL as init_image and get a hosted URL back. Docs: super-resolution API.

Trusted by

Google logo
Salesforce logo
Amazon logo
IBM logo
Adobe logo
Sony logo
Google logo
Salesforce logo
Amazon logo
IBM logo
Adobe logo
Sony logo
Google logo
Salesforce logo
Amazon logo
IBM logo
Adobe logo
Sony logo
Google logo
Salesforce logo
Amazon logo
IBM logo
Adobe logo
Sony logo
500M+

API Requests Processed

400K+

Registered Users

5K+

Discord Community Members

300+

Available AI APIs

500

GPUs in Our Own Datacenter

Real-ESRGAN API quick start

Upscale an image 4x in three lines of code using the super_resolution endpoint.

Python — 4x photo upscale

Python
1import requests
2
3response = requests.post(
4 "https://modelslab.com/api/v6/image_editing/super_resolution",
5 json={
6 "key": "YOUR_API_KEY",
7 "init_image": "https://example.com/low-res.jpg",
8 "scale": 4,
9 "model_id": "RealESRGAN_x4plus",
10 "face_enhance": False
11 }
12)
13
14print(response.json()["output"][0])

JavaScript — face-enhanced portrait

JavaScript
1const response = await fetch(
2 'https://modelslab.com/api/v6/image_editing/super_resolution',
3 {
4 method: 'POST',
5 headers: { 'Content-Type': 'application/json' },
6 body: JSON.stringify({
7 key: 'YOUR_API_KEY',
8 init_image: 'https://example.com/portrait.jpg',
9 scale: 4,
10 model_id: 'RealESRGAN_x4plus',
11 face_enhance: true,
12 }),
13 },
14);
15
16const data = await response.json();
17console.log(data.output[0]);

cURL — anime upscaling

bash
1curl -X POST 'https://modelslab.com/api/v6/image_editing/super_resolution' \
2 -H 'Content-Type: application/json' \
3 -d '{
4 "key": "YOUR_API_KEY",
5 "init_image": "https://example.com/anime.png",
6 "scale": 4,
7 "model_id": "RealESRGAN_x4plus_anime_6B"
8 }'

Real-ESRGAN super-resolution capabilities

Enhance image resolution by 4x while preserving fine detail and reducing compression artifacts.

4x image upscaling

Enhance resolution by 4x while preserving detail and sharpness. Real-ESRGAN transforms low-resolution images into high-quality assets suitable for print, displays, and professional use without losing critical visual information.

Noise reduction and artifact removal

Remove compression artifacts, grain, and sensor noise during upscaling. The model intelligently identifies and eliminates unwanted visual noise while enhancing genuine image details for cleaner, more professional results.

Face enhancement (GFPGAN)

Dedicated face restoration for portrait upscaling with natural results. Pass face_enhance=true to invoke the GFPGAN face-restoration pass for sharper eyes, teeth, and skin texture without artificial smoothing.

Anime / illustration mode

Switch to the Real-ESRGAN-Anime variant by passing model_id=RealESRGAN_x4plus_anime_6B. Optimized for line art, flat shading, and 2D illustration where the photo-trained model would over-smooth.

4x image upscaling
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result
Example of AI outpainting result

From web images to print-ready assets — Real-ESRGAN handles resolution enhancement at scale via REST API.

Real-ESRGAN API vs alternatives

How a hosted Real-ESRGAN API compares to running the model locally or using generic upscalers.

CapabilityModelsLab Real-ESRGAN APISelf-hosted Real-ESRGANGeneric upscaler API
Setup timeMinutes (sign up + API key)Hours (CUDA + weights)Minutes
Real-ESRGAN model variantsx4plus, x4plus_anime, x2plusWhatever you downloadOften single model
GFPGAN face enhancementface_enhance flagCustom pipelineRarely
Batch upscalingArray of URLsBuild it yourselfVaries
Cold-start latencyAlways-on upscale workersDepends on hosting5–60s on serverless
GDPR + auto-deletionYesYour responsibilityRead the docs
Pricing$0.0047 per upscale on a monthly planGPU + DevOps costPer-second or subscription

Comparison based on public Real-ESRGAN, Replicate, and self-hosted GPU pricing as of 2026.

How Real-ESRGAN image upscaling works

Enhance your images in three simple steps.

STEP 01
STEP 01

Step 1: Submit your image URL

POST to the super_resolution endpoint with the source image URL, scale (2x or 4x), and optional model_id (photo or anime variant). JPEG, PNG, and WebP are all supported.

STEP 02
STEP 02

Step 2: Real-ESRGAN enhances resolution

The API loads the appropriate Real-ESRGAN variant on a warm GPU, runs super-resolution, optionally applies GFPGAN face restoration, and removes compression artifacts in a single pass.

STEP 03
STEP 03

Step 3: Download the upscaled result

Receive a hosted URL to the 4x-upscaled image within seconds. Output is delivered as a PNG or JPEG depending on your input, ready to ship to your CDN or storage layer.

Why teams pick the ModelsLab Real-ESRGAN API

Key advantages that set us apart

Real-ESRGAN x4plus, x4plus_anime_6B, x2plus and general-x4v3 on one endpoint
GFPGAN face enhancement via face_enhance=true
scale from 2 to 8 in one request
Plans from $21/month (3,250 calls); no per-upscale charge on the $149 Open Source Unlimited plan
Same API key as image generation, editing and video
Webhook callbacks for async jobs

Our Popular Use Cases

Real-ESRGAN upscaling powers:

Upscale supplier photos for high-resolution product detail pages and print catalogs. Transform low-resolution images into professional assets that showcase product details clearly.

E-commerce product images

Related developer APIs

Your Data is Secure: GDPR Compliant AI Services

ModelsLab GDPR Compliance Certification Badge

GDPR Compliant

Plans from $21 a month

Basic is $21/month and Standard $47/month; self-hosted image models cost $0.0047 per image from that allowance. Open Source Unlimited is $149/month with no per-image charge on self-hosted models. Every plan covers Flux, SDXL and 10,000+ community models. Cancel anytime.

100% refund policy on monthly & yearly plans — cancel anytime

Contact Sales
Best Value

Open Source Unlimited

Mission-Critical

$149/month

100% refund policy · cancel anytime

Unlimited Open Source Models
100% refund policy
24x7 Support
15 parallel generations
Access to all APIs
Unlimited generations on all open-source models
For mission critical workloads
Add Team Members
Priority GPU Clusters
Most Popular

Standard

Production

$47/month

100% refund policy · cancel anytime

Moderate Traffic
100% refund policy
Priority Developer Support
10 concurrent API requests
For Production workloads
API access to all models
Prototype

Basic

Prototype

$21/month

100% refund policy · cancel anytime

Moderate Traffic
100% refund policy
Developer Support via Discord/Email
5 concurrent API requests
API access to all models
Shared GPU

Get Expert Support in Seconds

We're Here to Help.

Want to know more? You can email us anytime at support@modelslab.com

View Docs

Real-ESRGAN is an open-source image upscaling model from Tencent ARC Lab (2021). It is trained on degraded real-world images with sensor noise and JPEG compression, so it restores detail on real photos instead of producing a crisp but artificial result.

POST https://modelslab.com/api/v6/image_editing/super_resolution with `key`, `init_image` (an image URL), `model_id` and `scale`. `model_id` is one of RealESRGAN_x4plus, RealESRGAN_x4plus_anime_6B, RealESRGAN_x2plus or realesr-general-x4v3 (the default). `scale` defaults to 2 and is capped at 8. Set `face_enhance` to true to restore faces.

Use RealESRGAN_x4plus for photos, AI-generated images and screenshots. Use RealESRGAN_x4plus_anime_6B for anime, line art and flat-shaded illustration: it keeps clean edges where the photo model over-smooths.

Each upscale is $0.0047, counted against your plan: Basic is $21/month for 3,250 API calls and Standard is $47/month for 10,000. Real-ESRGAN is self-hosted, so the $149/month Open Source Unlimited plan has no per-upscale charge. ModelsLab is paid-only.

On Replicate, nightmareai/real-esrgan is billed by GPU time at the hardware rate of the machine it runs on. On ModelsLab the same model is a flat $0.0047 per call against a monthly plan, on the same API key as image generation, editing and video.

Yes. xinntao/Real-ESRGAN on GitHub runs locally with Python and a CUDA GPU. The API runs the same model family without the install, the CUDA drivers or the GPU.

Yes. Generate at 1024px with the image API, then pass the output URL as `init_image` with `scale` 4 to get a 4096px image.
Plugins

Explore Plugins for Pro

Our plugins are designed to work with the most popular content creation software.

API

Build Apps with
ML
API

Use our API to build apps, generate AI art, create videos, and produce audio with ease.