# AI Image Upscaler 2x/4x (Real-ESRGAN, no GPU) (`fontom.ai.plus/ai-image-upscaler`) Actor

Upscale and sharpen low-resolution photos, product images, screenshots and art 2x or 4x with Real-ESRGAN. Bulk URLs, PNG/JPG/WebP, transparency kept. Pay per image, no GPU, no subscription.

- **URL**: https://apify.com/fontom.ai.plus/ai-image-upscaler.md
- **Developed by:** [FONTOM AI](https://apify.com/fontom.ai.plus) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 images

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 2x / 4x — Real-ESRGAN on CPU, no GPU, pay per image

Make small, blurry or compressed images bigger and cleaner. Give a list of image URLs, get back **2x or 4x upscaled files** (PNG, JPG or WebP) as links. Runs the open-source **Real-ESRGAN (general x4v3)** model on CPU inside the Actor: **no GPU, no subscription, no API key, no third-party service.**

### Good for

- Product and marketplace photos that are too small for a store's size requirement
- Old photos, scans, screenshots, memes, social-media images that were compressed
- Illustrations, anime/manga art, game assets, logos with soft edges
- Batches: hundreds of images in one run from a list of URLs

### How it works

The image is cut into overlapping tiles, each tile is enlarged 4x by the neural network, and the tiles are stitched back together without visible seams. For **2x**, the 4x result is reduced with a high-quality filter, which usually looks crisper than a plain 2x enlargement. **Transparency (alpha) is kept.** EXIF rotation is respected.

### Input

| Field | Meaning |
|---|---|
| `urls` | Public image URLs (up to 500 per run). |
| `images` | Optional inline files: `[{"name": "a.jpg", "base64": "..."}]`. |
| `scale` | `2` or `4` (default 4). |
| `outputFormat` | `png` (default), `jpg`, `webp`; `quality` for JPG/WebP. |
| `maxInputMegapixels` | Larger inputs are reduced to this size first (default 4 MP ≈ 2000×2000, maximum 8 MP). |

### Output (one row per image)

```json
{ "ok": true, "source": "https://example.com/small.jpg", "outputUrl": "https://api.apify.com/v2/key-value-stores/…/records/upscaled-0001.png",
  "inputWidth": 640, "inputHeight": 480, "outputWidth": 2560, "outputHeight": 1920, "format": "png", "seconds": 9.4, "warnings": [] }
```

### Pricing

Pay per event: one `result` event per **successfully upscaled image**. Unreachable URLs, unreadable files and blocked addresses return an `ok: false` row and are free.

### What it does and does not do (read before you buy)

- It is a **fast, general-purpose upscaler** (a 1.2-million-parameter network). It sharpens edges, removes compression blocking and mild noise, and adds plausible fine detail. It does **not** invent faces or text that are not in the picture, and it will not rescue a 30×30-pixel thumbnail.
- The result is visibly sharper than a plain bicubic/Lanczos enlargement, but it is a perceptual model: pixel-accuracy scores (PSNR) are about the same as or slightly below a plain enlargement, and fine textures such as foliage can look slightly painted. Judge by eye on your own images.
- **Heavily damaged photos** (severe blur, very strong noise) improve less than with large diffusion-based upscalers that need a GPU.
- No face-specific restoration, no colourisation, no object removal.
- Run time grows with input size: about 5–10 seconds per input megapixel on the default 4 GB Actor (a 160×120 or 640×480 image takes well under a few seconds).
- Only images you have the right to process: you are responsible for the files you submit.

### Credits and licence

Model: Real-ESRGAN `realesr-general-x4v3` by Xintao Wang et al., BSD-3-Clause (https://github.com/xinntao/Real-ESRGAN), distributed through Qualcomm AI Hub Models as an ONNX export (BSD-3-Clause). The Actor code is MIT.

# Actor input Schema

## `urls` (type: `array`):

Public http(s) image URLs, up to 500 per run. Private/internal addresses are blocked.

## `images` (type: `array`):

Images you already have, as \[{"name": "photo.jpg", "base64": "..."}].

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

Output size relative to the input. 2x runs the 4x model and reduces the result, which usually looks cleaner than a plain enlargement.

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

PNG is lossless. Images with transparency are always written as PNG when JPG is chosen.

## `quality` (type: `integer`):

Used for JPG and WebP output only.

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

Larger inputs are reduced to this size before upscaling, which keeps run time and memory bounded (4 MP is about 2000x2000 pixels). At 4x the output has 16 times as many pixels.

## Actor input object example

```json
{
  "urls": [
    "https://thumb.wikimedia.org/wikipedia/commons/thumb/3/36/Hopetoun_falls.jpg/330px-Hopetoun_falls.jpg"
  ],
  "scale": "4",
  "outputFormat": "png",
  "quality": 92,
  "maxInputMegapixels": 4
}
```

# Actor output Schema

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

Converted documents in the default dataset.

# 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 = {
    "urls": [
        "https://thumb.wikimedia.org/wikipedia/commons/thumb/3/36/Hopetoun_falls.jpg/330px-Hopetoun_falls.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fontom.ai.plus/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 = { "urls": ["https://thumb.wikimedia.org/wikipedia/commons/thumb/3/36/Hopetoun_falls.jpg/330px-Hopetoun_falls.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("fontom.ai.plus/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 '{
  "urls": [
    "https://thumb.wikimedia.org/wikipedia/commons/thumb/3/36/Hopetoun_falls.jpg/330px-Hopetoun_falls.jpg"
  ]
}' |
apify call fontom.ai.plus/ai-image-upscaler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fontom.ai.plus/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/l8baj9QKpplb3ZqJm/builds/DLxIeP4McdqPd2zjQ/openapi.json
