# AI Image Upscaler: 2x & 4x Super Resolution (CPU) (`data-done-right/image-upscaler`) Actor

Upscale images 2x or 4x with AI super-resolution (Real-ESRGAN) on CPU: image URLs in, PNG, JPG or WebP out with download links. Small images only (up to 0.35 megapixels, about 640x480). No GPU, no API key. Sharpens and removes JPEG blocks; it invents texture, not real detail.

- **URL**: https://apify.com/data-done-right/image-upscaler.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Developer tools, Automation, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.60 / 1,000 image upscaleds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: 2x & 4x Super Resolution (CPU)

This **AI image upscaler** takes a list of direct image URLs, enlarges each image **2x or 4x** with the open-source **Real-ESRGAN** super-resolution model (general x4v3, BSD-3-Clause) running on CPU, and gives you a download link for every result as **PNG, JPG or WebP**. No GPU, no API key, nothing to install.

> **What it does not do.** It only accepts **small inputs: up to 0.35 megapixels (about 640x480)**. Bigger images are rejected, free, with a clear message; the limit cannot be raised, because CPU time grows with image size and the price is per image. It is **not a restoration or face-enhancement tool**: there is no face model, no colourisation, no scratch repair, no 8x. It **invents plausible texture** instead of recovering real detail, so edges look sharper and JPEG blocks disappear, but text, faces and fine patterns can look smoothed or "painted". It scores **lower PSNR than plain Lanczos resizing** on clean test images (see "Quality and limits"), so do not use it where pixel-exact fidelity matters (science, evidence, medical). It reads **direct image files** only (JPEG, PNG, WebP, BMP, GIF first frame, TIFF), not web pages, social media posts, HEIC or SVG. Use it on images you own or have the right to edit.

**What you get**

- One dataset row per image: your source URL, a signed download link to the upscaled file, width and height before and after, file size, processing time, and a clear error if it failed.
- 2x or 4x, as PNG (lossless, keeps transparency), WebP (small, keeps transparency) or JPG.
- Failed, rejected, oversized and robots.txt-blocked images are free; one bad link never stops the run.

### How to upscale an image from a URL

1. Paste one or more **direct image URLs** in `imageUrls`, for example `https://example.com/thumb.jpg`.
2. Leave the defaults (`scale` 4, PNG) and run.
3. Open the dataset: the `url` column links to each upscaled image. The files are also in the key-value store of the run.

### How to upscale images 2x instead of 4x

Set `"scale": 2`. The model works at 4x natively; for 2x the Actor runs it and reduces the result by half with Lanczos. The cost is the same as 4x, so choose 2x only when you want the smaller file.

### How to get small files out of a 4x upscale

A 4x PNG is large (several MB for a 640x480 input). Set `"outputFormat": "webp"` (quality 90) or `"jpg"` (quality 92). WebP and PNG keep transparency; JPG does not (the result is placed on white and the `note` of the row says so).

### How to upscale many images in a pipeline

Feed the list in `imageUrls` (up to 2000 per run with `maxImagesPerRun`), set `outputStoreName` to keep the result files in a named store that outlives the run, and read the dataset rows through the API. Duplicate URLs are processed once, failures are listed in the dataset and in the `FAILED` record.

### Input

| Field | Default | What it does |
|---|---|---|
| `imageUrls` | one sample photo | Direct image links (strings, or objects with a `url`). Required. |
| `scale` | `4` | `2` or `4`. Same price. |
| `outputFormat` | `png` | `png`, `jpg` (quality 92) or `webp` (quality 90). |
| `maxImagesPerRun` | 100 | Hard cap per run (max 2000). Extra images are listed as skipped, free. |
| `maxImageSizeMb` | 10 | Larger downloads are rejected (max 50). |
| `maxInputMegapixels` | 0.35 | Larger inputs are rejected before decoding. Can be lowered, not raised. |
| `imageTimeoutSecs` | 180 | Download plus processing time per image. |
| `outputStoreName` | empty | Keep the result files in a named store until you delete it. |

Input example:

```json
{
  "imageUrls": ["https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg"],
  "scale": 4,
  "outputFormat": "webp"
}
```

Output example (from a real local run of this input):

```json
{
  "index": 1,
  "sourceUrl": "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg",
  "status": "ok",
  "url": "https://api.apify.com/v2/key-value-stores/832zZd76HB45xHhDy/records/0001-grapefruit-slice-332-332.webp",
  "key": "0001-grapefruit-slice-332-332.webp",
  "scale": 4,
  "format": "webp",
  "width": 1328,
  "height": 1328,
  "originalWidth": 332,
  "originalHeight": 332,
  "bytes": 126004,
  "originalBytes": 18122,
  "processingMs": 1367,
  "error": null,
  "note": null
}
```

The run also writes a `SUMMARY` record (images requested, delivered, failed, skipped, seconds of upscaling) and, when something failed, a `FAILED` record.

### Quality and limits

Measured by us on three Kodak test photos (downscaled by 2 or 4, some also JPEG-compressed at quality 75, then upscaled again):

- **Looks better than Lanczos** to the eye: edges and brick or hair strands are much sharper, JPEG block noise is smoothed away. Laplacian variance (a sharpness proxy) was about 525 against 19 for Lanczos on one JPEG-degraded 4x test.
- **Scores lower than Lanczos on PSNR** on every test image (about 0.6 to 3 dB lower). The model draws texture that was not in the original, and PSNR punishes that. Treat the result as "enhanced", not "recovered".
- Textures can look smoothed or painted; text, logos and faces are not specially handled.
- Two other small models we tried (ESPCN and EDSR from OpenCV) were either no better than Lanczos or far too slow on CPU, which is why this Actor uses Real-ESRGAN general x4v3.
- Transparent images: colour is upscaled on a white background and the alpha channel is resized with Lanczos; a faint light edge can remain.
- Animated GIFs: only the first frame is used.
- Speed on one desktop CPU core: about 1 second for a 332x332 input and about 3 to 4 seconds for 640x480 (4x). Apify machines may be slower.
- The Actor fetches only public http and https addresses, refuses private and internal network addresses, follows at most 5 redirects, honours the robots.txt of the image host (a disallowed image is skipped and free) and sends an honest ImageUpscaler user agent. It does not use proxies and does not work around blocks: a 403 or 429 is reported as it is.

### How much does it cost

**$0.012 per image delivered** (event `image-upscaled`), the same for 2x and 4x and for every output format. Failed, skipped, rejected and robots.txt-blocked images are free. There is no start fee.

| Images | Price |
|---|---|
| 1,000 | $12 |
| 10,000 | $120 |
| 100,000 | $1,200 |

Platform compute is included in the per-image price. Set a maximum cost per run in the Apify console and the Actor stops cleanly when it is reached.

### Use cases

- Enlarge small product thumbnails for shop listings.
- Make low-resolution social or blog images usable at a larger size.
- Clean up compressed JPEG avatars or logos before printing small.
- Add an upscale step to a scraping or content pipeline that handles lists of image URLs.
- Prepare small training images at a larger size for later processing.

### FAQ

**Why only 0.35 megapixels?** The model costs CPU time in proportion to pixels. Above about 640x480 the cost per image would be higher than the per-image price allows, so larger inputs are rejected, free, instead of being priced differently.

**Can it upscale 1024x1024 or phone photos?** No. Resize them down first (for example with the Image Compressor & Resizer) if you accept losing detail, or use a GPU service.

**Is the result real detail?** No. It is plausible texture drawn by a neural network. Do not use it as evidence or for measurements.

**Does it keep transparency?** PNG and WebP: yes, the alpha channel is resized with Lanczos. JPG: no, the result is on white.

**Is it GPU-grade?** No. It uses a small model (1.2 million parameters) so it can run on CPU. Large GPU models give finer results on faces and textures.

**What happens to links that are not images?** They are reported as errors, free. Pages, HEIC and SVG are rejected with a message saying what to use instead.

### Use with the Apify API, MCP, n8n or Make

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<your-username>/image-upscaler").call(run_input={
    "imageUrls": ["https://example.com/thumb.jpg"], "scale": 4, "outputFormat": "webp"})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["status"], row["url"], row["width"], row["height"])
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<your-username>/image-upscaler').call({
  imageUrls: ['https://example.com/thumb.jpg'], scale: 4, outputFormat: 'webp' });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].url);
```

The same input works in the Apify MCP server, n8n and Make through their Apify integrations.

### Related tools

- Image Compressor & Resizer: Compress Images in Bulk
- Background Remover for Images (rembg, CPU)
- HEIC to JPG Converter: Convert HEIC/HEIF to JPG & PNG

# Actor input Schema

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

Direct links to image files (JPEG, PNG, WebP, BMP, GIF, TIFF), each up to 0.35 megapixels (about 640x480). Example: https://example.com/thumb.jpg. Duplicate links are processed once. Page links, HEIC and SVG are rejected without charge.

## `scale` (type: `integer`):

Use 2 or 4 (3 is rejected). How many times wider and taller the result is. Example: 4 turns 320x240 into 1280x960. 2x runs the same 4x model and shrinks the result, so it costs the same.

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

File type of each result. A 4x PNG is large (several MB); WebP or JPG are much smaller. Example: webp.

## `maxImagesPerRun` (type: `integer`):

Hard cap on images processed in one run (1 to 2000). Images beyond the cap are listed as skipped and are free. Example: 100.

## `maxImageSizeMb` (type: `number`):

Larger downloads are rejected (free). Example: 10.

## `maxInputMegapixels` (type: `number`):

Input images with more pixels are rejected before decoding (free). The limit cannot be raised above 0.35 (about 640x480) because CPU time grows with image size and the price is per image. Example: 0.2.

## `imageTimeoutSecs` (type: `integer`):

Download plus processing time allowed for one image before it is reported as failed. Example: 180.

## `outputStoreName` (type: `string`):

Optional name of a key-value store that keeps the result files until you delete it, instead of the run's default store (which expires with the run's data retention). Example: my-upscaled-images.

## Actor input object example

```json
{
  "imageUrls": [
    "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg"
  ],
  "scale": 4,
  "outputFormat": "png",
  "maxImagesPerRun": 100,
  "maxImageSizeMb": 10,
  "maxInputMegapixels": 0.35,
  "imageTimeoutSecs": 180
}
```

# Actor output Schema

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

One row per image with its download link, sizes and status, as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the upscaled images, the run summary and notes on any failed images.

# 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://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/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://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/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://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg"
  ]
}' |
apify call data-done-right/image-upscaler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/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/YbcvFIjGf8rKmXyda/builds/nHiORH5edcFw82CaB/openapi.json
