# AI Image Upscaler — Real-ESRGAN 2x/4x, Bulk, Cheap (`robinsiacreation/ai-image-upscaler`) Actor

Upscale and sharpen photos, product images and illustrations 2x or 4x with Real-ESRGAN. Paste image URLs, get high-resolution PNG/JPG/WebP links back. No GPU, no subscription, pay per image.

- **URL**: https://apify.com/robinsiacreation/ai-image-upscaler.md
- **Developed by:** [Robin](https://apify.com/robinsiacreation) (community)
- **Categories:** AI, Integrations, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$15.00 / 1,000 upscaled image (per 0.25 mp of input)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AI Image Upscaler — Real-ESRGAN 2x / 4x

Upscale photos, product images, old pictures and illustrations **2x or 4x** with the Real-ESRGAN AI model. Paste image URLs, get sharp high-resolution images back — in bulk, through the API, or from your AI agent.

- **Cheap:** pay only per successfully upscaled image, priced by output size. Failed URLs are never charged.
- **Bulk:** hundreds of images in one run. One broken link doesn't stop the batch.
- **Real AI super-resolution:** recovers edges, texture and text instead of just blowing up pixels.
- **Keeps transparency:** PNG/WebP logos and cut-outs keep their alpha channel.
- **Size-safe:** set a maximum output size in megapixels so you never get a 200 MB file.
- **No GPU, no subscription, no sign-up to another service.** Runs entirely on Apify.

### What is it good for?

| Use case | Example |
|---|---|
| E-commerce | Upscale supplier product photos to meet Amazon/Shopify minimum sizes |
| Print | Turn a 1000 px image into 4000 px for posters and merch |
| Real estate & listings | Sharpen small, compressed listing photos |
| Old photos | Enlarge scanned or low-res family pictures |
| AI art | Upscale Midjourney / Stable Diffusion / DALL·E outputs |
| Data pipelines | Chain after any scraper to enlarge every image it finds |

### How to use it

1. Paste one or more **image URLs** (JPG, PNG, WebP, BMP).
2. Choose **2x or 4x**.
3. Choose the output format: **PNG** (lossless), **JPG** or **WebP** (smaller).
4. Click **Start**. Each result row has a direct link to the upscaled image.

#### Input example

```json
{
  "imageUrls": [
    "https://example.com/product-small.jpg",
    "https://example.com/logo.png"
  ],
  "scale": "4",
  "outputFormat": "png",
  "maxOutputMegapixels": 16
}
```

#### Output example

```json
{
  "sourceUrl": "https://example.com/product-small.jpg",
  "status": "ok",
  "error": null,
  "inputWidth": 500,
  "inputHeight": 500,
  "outputWidth": 2000,
  "outputHeight": 2000,
  "outputUrl": "https://api.apify.com/v2/key-value-stores/…/records/upscaled-00001.png",
  "outputKey": "upscaled-00001.png",
  "outputBytes": 1442736
}
```

Download results as JSON, CSV or Excel from the Output tab, or fetch them through the Apify API.

### Pricing

You pay per upscaled image, **one unit per started 0.25 megapixels of input** — that's what the AI actually processes (see the Pricing tab). A 500×500 web image is one unit; a 1000×1000 photo is four units. 2x and 4x cost the same because the model does the same work; each result row shows `billedUnits`. Images that fail to download or decode are free. You can set a maximum cost per run in the run options.

### Limits

- Input: up to 40 MB and 25 megapixels per image.
- Output: capped by `maxOutputMegapixels` (default 16 MP ≈ 4000×4000). Larger inputs are shrunk first so the result fits.
- Upscaled files stay in the run's key-value store for your Apify data-retention period — download them if you need them longer.
- Animated GIFs: only the first frame is processed.

### Use it from code or AI agents

Call it via the [Apify API](https://docs.apify.com/api/v2), the Python/JavaScript clients, Make, Zapier, n8n, or as a tool through the Apify MCP server.

### Model & license

Uses `realesr-general-x4v3` from [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) (BSD-3-Clause) by Xintao Wang et al. Only process images you have the right to use.

### Feedback

Found a bug or need a feature (face restoration, 8x, batch from a dataset)? Open an issue on the Issues tab — it gets answered.

# Actor input Schema

## `imageUrls` (type: `array`):

Direct links to the images you want to upscale (JPG, PNG, WebP, BMP, GIF first frame). One URL per line.

## `scale` (type: `string`):

2x or 4x. The model always runs at 4x; 2x is downsampled from it with a high-quality filter, which is sharper than a native 2x.

## `outputFormat` (type: `string`):

PNG is lossless. JPG and WebP are much smaller files (quality 92).

## `maxOutputMegapixels` (type: `integer`):

Images whose result would exceed this are pre-shrunk so the output fits. Protects you from huge files. 16 MP ≈ 4000×4000.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/320px-Cat03.jpg"
  ],
  "scale": "4",
  "outputFormat": "png",
  "maxOutputMegapixels": 16
}
```

# Actor output Schema

## `results` (type: `string`):

One row per input URL with status, metadata and download links.

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/320px-Cat03.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("robinsiacreation/ai-image-upscaler").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/320px-Cat03.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("robinsiacreation/ai-image-upscaler").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/320px-Cat03.jpg"
  ]
}' |
apify call robinsiacreation/ai-image-upscaler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,robinsiacreation/ai-image-upscaler"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/erqkQJeuMy14KBQod/builds/TEw6H2lsiRDkASY8O/openapi.json
