REST API · Live

Best ESRGAN API for 4× AI Image Upscaling

A production REST API that upscales any image to 2×, 3×, or 4× resolution using the Real-ESRGAN algorithm. One HTTP POST. PNG output. Under 10 seconds for most images. $0.01 per image — 500 free credits included, no credit card required. The best ESRGAN API for print shops, e-commerce, and stock photo workflows — with SDKs in six languages.

$0.01 / image 2× · 3× · 4× scale 500 free credits No credit card Up to 20 MB input PNG output
Get an API key (free) Quick start See pricing API docs

Quick start — one API call to upscale 4×

Sign up, grab your key from the dashboard, and POST your image. The endpoint returns a generation id; poll GET /v1/image/upscale/{id} until status=completed, then download the upscaled PNG from output_url.

curl -X POST https://api.pixelapi.dev/v1/image/upscale \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "scale=4"
# Response: {"id": "uuid", "status": "queued", "operation": "upscale", "credits_used": 10.0}

# Poll until completed
curl https://api.pixelapi.dev/v1/image/upscale/UUID \
  -H "Authorization: Bearer YOUR_API_KEY"
# Response: {"generation_id": "uuid", "status": "completed", "output_url": "https://..."}
pip install pixelapi
---
from pixelapi import PixelAPI

client = PixelAPI(api_key="YOUR_API_KEY")
result = client.upscale(image="photo.jpg", scale=4)
result.save("photo_4x.png")  # high-res PNG

# Custom output dimensions
result = client.upscale(
    image="product.jpg",
    target_width=3000,
    target_height=4000,
    fit_mode="pad_white"
)
result.save("product_hi_res.png")
npm install pixelapi
---
import { PixelAPI } from "pixelapi";

const client = new PixelAPI({ apiKey: process.env.PIXELAPI_KEY });
const result = await client.upscale({ image: "./photo.jpg", scale: 4 });
await result.save("photo_4x.png");  // high-res PNG

// Custom dimensions
const sized = await client.upscale({
  image: "./product.jpg",
  targetWidth: 3000,
  targetHeight: 4000,
  fitMode: "pad_white",
});
await sized.save("product_hi_res.png");
composer require pixelapi/pixelapi
---
<?php
use PixelAPI\Client;

$client = new Client(getenv("PIXELAPI_KEY"));
$result = $client->upscale(["image" => "photo.jpg", "scale" => 4]);
file_put_contents("photo_4x.png", $result->getBody());

// Custom dimensions
$result = $client->upscale([
    "image"        => "product.jpg",
    "target_width" => 3000,
    "target_height"=> 4000,
    "fit_mode"     => "pad_white",
]);
file_put_contents("product_hi_res.png", $result->getBody());
gem install pixelapi
---
require "pixelapi"

client = PixelAPI::Client.new(api_key: ENV["PIXELAPI_KEY"])
result = client.upscale(image: "photo.jpg", scale: 4)
File.binwrite("photo_4x.png", result.body)

# Custom dimensions
result = client.upscale(
  image: "product.jpg",
  target_width: 3000,
  target_height: 4000,
  fit_mode: "pad_white"
)
File.binwrite("product_hi_res.png", result.body)
go get github.com/pixelapi/pixelapi-go
---
import "github.com/pixelapi/pixelapi-go"

client := pixelapi.New("YOUR_API_KEY")
result, err := client.Upscale("photo.jpg", pixelapi.UpscaleParams{Scale: 4})
if err != nil { panic(err) }
result.Save("photo_4x.png")

// Custom dimensions
result, err = client.Upscale("product.jpg", pixelapi.UpscaleParams{
    TargetWidth:  3000,
    TargetHeight: 4000,
    FitMode:      "pad_white",
})
result.Save("product_hi_res.png")

Best ESRGAN API pricing — compared to rivals

PixelAPI uses a simple per-image credit model with no subscription lock-in. Compare against the main alternatives:

ProviderFree tierPer-image API costScale factorsOutput
PixelAPI 500 credits, no card $0.010 2× · 3× · 4× PNG · custom dims
Upscale.media 3 images/month ~$0.011–$0.14 (volume-tiered) 2× · 4× PNG · JPG
Let's Enhance / Claid.ai 10 credits see letsenhance.io/pricing 2× · 4× · 8× · 16× PNG · JPG · WebP
Topaz Gigapixel AI Enterprise quote (see topazlabs.com/pricing) 2× · 4× · 6× PNG · JPG · TIFF
Vance.ai / Unifab.ai 3 credits see unifab.ai/pricing 2× · 4× PNG · JPG

Pricing verified from each rival's public pricing page May 2026. PixelAPI per-image price is set at exactly half the cheapest rival's verified per-unit rate, per our published pricing policy.

What parameters does the ESRGAN API accept?

scale — 2, 3, or 4 (default 4)

Controls the upscale multiplier. 4× quadruples each dimension — a 500×500 input becomes 2000×2000. Use 2× for moderate enlargement or when file size matters.

target_width + target_height

Pass exact pixel dimensions (64–8192 px each) instead of a scale factor. The API picks the right scale internally, then resizes to your exact target. If the target is smaller than the input, only 2 credits are charged (fast CPU path, no upscale model).

fit_mode

stretch — exact target dimensions, may distort if aspect ratios differ.
pad_white — preserve aspect, add white padding to fill target.
pad_transparent — preserve aspect, transparent PNG padding.

image or image_url

POST a file directly via multipart upload, or pass an image_url string for server-to-server workflows where the source image is already hosted. Max file size: 20 MB (JPEG, PNG, WebP).

What you get back

High-resolution PNG

The upscaled image is returned as a lossless PNG. Sharp edges, fine textures, and natural gradients are reconstructed by the Real-ESRGAN model — not interpolated. Works immediately in Photoshop, Figma, Lightroom, or any print pipeline.

Pixel-accurate custom dimensions

Need exactly 3000×4000 for a print template? Pass target_width=3000&target_height=4000. The API upscales and then trims or pads to your exact spec without a second API call.

Transparent padding support

fit_mode=pad_transparent adds RGBA alpha-channel padding instead of white. Feed the result directly into a compositing pipeline without extra masking.

Polling-based async delivery

The endpoint returns a generation_id immediately. Poll GET /v1/image/upscale/{id} for status. When status=completed, download from output_url. Failed jobs are auto-refunded — you never pay for a broken result.

Combined upscale + face enhancement

For portrait photos, old family photos, or any image with faces, use POST /v1/image/enhance. It chains 4× upscaling with face restoration in a single call — sharper faces, reconstructed fine details, all in one request. Costs 14 credits ($0.014) — cheaper than calling both endpoints separately.

curl -X POST https://api.pixelapi.dev/v1/image/enhance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "scale=4" \
  -F "face_enhance=true"

Common workflows using the ESRGAN API

The ESRGAN Upscale API is the foundation for these production workflows:

Print production

Upscale web-resolution product or editorial images to print-ready resolution (300 DPI). Automate pre-press checks in your pipeline without Photoshop.

E-commerce hi-res

Generate zoom-capable, high-resolution product images from supplier JPEGs. Feed directly into Shopify, BigCommerce, or WooCommerce.

Stock photo enhancement

Upscale stock library images to meet platform minimum-resolution requirements before licensing or submission.

Photo restoration

Combine with Face Restore (or use the /enhance endpoint) to recover old, low-resolution photographs at archival quality.

AI image post-processing

Upscale images generated by other tools to produce print- or poster-grade output from lower-resolution generations.

Real estate listing photos

Enlarge compressed listing photos for full-bleed print brochures and large-format display boards — automated at scale.

Integrations & SDKs

Shopify

Upscale product images on upload via webhook — automatic hi-res catalog.

Zapier

No-code trigger to upscale images from Google Drive, Dropbox, or any Zapier source.

Make.com

Drag-and-drop 4× upscaling inside any Make scenario.

Webflow

Auto-upscale CMS images so every asset is retina-ready.

Next.js

API route pattern for on-demand upscaling in your Next.js app.

WooCommerce

WordPress plugin pattern for automatic product image enhancement.

Comparison vs alternatives

vs Topaz Gigapixel AI

Topaz is a desktop app with no public API. PixelAPI gives you a REST endpoint, JSON responses, and SDK support — automation-ready.

vs Let's Enhance

Similar upscale quality. PixelAPI is credit-based with no subscription lock-in; Let's Enhance requires a monthly plan for API access.

vs Upscale.media

PixelAPI adds custom target dimensions, fit_mode control, and a combined enhance endpoint missing from Upscale.media.

vs Vance.ai

Vance.ai has migrated to Unifab.ai. PixelAPI offers stable REST endpoints, a dedicated status page, and GST invoicing for Indian businesses.

Also compare: vs BigJPG · vs Claid.ai · vs Deep Image AI · Topaz Gigapixel open-source alternatives

Rate limits & error handling

Default 60 requests/minute on the free tier, 600 on paid tiers. Exceeding the limit returns HTTP 429 with a Retry-After header. Recommended strategy: exponential backoff starting at 2s, doubling on each retry up to 30s. Both the Python and Node SDKs handle this automatically.

If target dimensions require more than 4× of the (possibly pre-shrunk) input, the API returns HTTP 400 with a message explaining the maximum achievable dimensions. Credits are never deducted for rejected requests.

# Python SDK — automatic 429 retry with backoff
from pixelapi import PixelAPI
client = PixelAPI(api_key="...", max_retries=4)
result = client.upscale(image="batch_photo.jpg", scale=4)  # auto-retries on 429
HTTP statusMeaningAction
200 queuedJob accepted, poll for resultPoll GET /v1/image/upscale/{id}
400Invalid parametersFix request (check scale vs. target dims)
402Insufficient creditsTop up at pixelapi.dev/pricing
429Rate limit exceededRetry after Retry-After seconds
503Queue fullRetry with backoff — credits auto-refunded

Frequently asked questions

What is the best ESRGAN API for image upscaling?

PixelAPI's ESRGAN API delivers production-grade 4× image upscaling at $0.01 per image with a clean REST interface, 500 free trial credits, and SDKs for Python, Node.js, PHP, Ruby, and Go. No credit card required to start — sign up and get 50 free upscales instantly.

How do I call the ESRGAN API?

POST your image (file upload or image_url) to https://api.pixelapi.dev/v1/image/upscale with your Bearer token. The response contains a generation id. Poll GET /v1/image/upscale/{id} until status=completed, then download from output_url. See the Quick Start above for six language examples.

What scale factors does the API support?

The scale parameter accepts 2, 3, or 4 (default is 4). You can also pass target_width and target_height for exact pixel dimensions — the API picks the correct internal scale automatically and delivers your requested output size.

What output format does the ESRGAN API return?

High-resolution PNG. Control aspect-ratio handling with fit_mode: stretch for exact pixel dimensions, pad_white for aspect-preserving output with white padding, pad_transparent for transparent-alpha padding ready for compositing.

How much does the ESRGAN API cost?

$0.01 per upscale job (10 credits at $0.001/credit). New accounts get 500 free credits — 50 free upscales — with no credit card. Pure downscale jobs (target smaller than input) cost only 2 credits ($0.002). No monthly subscription; pay only for what you use.

What is the maximum input image size?

The API accepts JPEG, PNG, or WebP files up to 20 MB. Large inputs are pre-processed automatically to prevent timeouts while preserving output quality. If the requested target dimensions require more than 4× upscaling of the input, the API returns a 400 error with guidance on adjusting the target or input size.

Can I upscale to a specific pixel dimension?

Yes — pass target_width and target_height (both 64–8192 px). The API determines the scale internally, upscales, then resizes to your exact target. Use fit_mode=pad_white or pad_transparent to handle aspect-ratio differences without distortion.

What are the rate limits?

Free tier: 60 requests/minute. Paid tiers: 600 requests/minute. Exceeding the limit returns HTTP 429 with a Retry-After header. The Python and Node SDKs include built-in exponential-backoff retry. For higher limits on batch workloads, email [email protected].

Do you offer combined upscale + face enhancement?

Yes. POST /v1/image/enhance chains 4× upscaling with face restoration in a single API call. Cost: 14 credits ($0.014) — cheaper than calling both endpoints separately. Pass face_enhance=false to skip face restoration and only upscale. See the section above for an example.

Is there a Python or Node.js SDK?

pip install pixelapi for Python; npm install pixelapi for Node.js. Both handle authentication, polling, retry-on-429, and binary file return automatically. PHP (Composer), Ruby (Gem), and Go (go get) SDKs are also available. All examples in the Quick Start above are copy-paste ready.

Start free — 500 credits, no card Read full API docs Compare all plans