# AI Image Upscaler: Enlarge Photos 4x (Real-ESRGAN) (`piracema_labs/ai-image-upscaler`) Actor

Upscale photos and images 2x or 4x with AI (Real-ESRGAN). Sharper edges and detail than normal resizing, up to 64 MP output, JPG/PNG/WebP, batch from image URLs. Pay per image, no subscription, no GPU needed.

- **URL**: https://apify.com/piracema_labs/ai-image-upscaler.md
- **Developed by:** [Piracema Labs](https://apify.com/piracema_labs) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 upscaled image (per 4 mp)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: Enlarge Photos 4x with Real-ESRGAN

Make small or low-resolution photos **2x or 4x larger with AI**. Edges, eyes, text and fine structure come out **crisp instead of blurry**, unlike normal resizing in Photoshop, Lightroom or Canva.

- **Up to 64 megapixels** of output (16 MP by default, about 4900×3270)
- **Batch** any number of images from URLs in one run
- **JPG, PNG or WebP** output, transparency kept for PNG/WebP
- **Pay per image**, from **$0.01**, no subscription, no GPU, no software to install
- Powered by **Real-ESRGAN**, the widely used open-source upscaling model

### What can I use it for?

- **Photographers:** enlarge older or cropped photos for prints and portfolios.
- **Print-on-demand and Etsy sellers:** bring artwork and photos up to print resolution (for example 300 DPI posters).
- **E-commerce:** sharpen small supplier product images for your store.
- **Designers and marketers:** upscale assets for banners, slides and social posts.
- **Restoring old images:** give scanned or web-sized pictures a cleaner, sharper look.

### How it compares to normal resizing

Normal resizing (bicubic) only stretches the pixels you already have, so a 4x enlargement looks soft. The AI model has learned what real edges and textures look like and redraws them sharply. It works best on photos and illustrations. Very fine, irregular textures (grass, gravel, fabric) can look slightly smoothed or "painted".

### How to use it

1. Paste direct links to your images in **Image URLs**, one per line. To upscale files on your computer, upload them to Dropbox, Google Drive (public link) or any image host first and paste the direct links.
2. Choose **4x** or **2x**, and the **output format**.
3. Click **Start**.
4. Open the **Output** tab: each row has a **download link** (`outputUrl`) for the upscaled image. Files are also in the run's **Key-value store** tab.

Only upload images you own or have the right to edit.

#### Big images

To keep runs fast and predictable, outputs are capped at **Max output size** (16 MP by default, up to 64 MP). If an image would end up bigger, it's shrunk first so the result fits exactly, and `inputWasReduced` is set to `true`. For example, a 2000×1500 photo at 4x would be 48 MP, so with the default cap it comes out at about 4620×3460 (16 MP).

### Input example

```json
{
    "imageUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Parrot.red.macaw.1.arp.750pix.jpg/500px-Parrot.red.macaw.1.arp.750pix.jpg"
    ],
    "scale": "4",
    "outputFormat": "jpg",
    "quality": 92,
    "maxOutputMegapixels": 16
}
```

### Output example

```json
{
    "sourceUrl": "https://upload.wikimedia.org/.../500px-Parrot.red.macaw.1.arp.750pix.jpg",
    "outputUrl": "https://api.apify.com/v2/key-value-stores/ibmJh92iGZ4wOYO2o/records/0001-500px-Parrot-red-macaw-1-arp-750pix.jpg",
    "outputKey": "0001-500px-Parrot-red-macaw-1-arp-750pix.jpg",
    "scale": 4,
    "format": "jpg",
    "inputWidth": 500,
    "inputHeight": 668,
    "outputWidth": 2000,
    "outputHeight": 2672,
    "outputMegapixels": 5.34,
    "inputWasReduced": false,
    "fileSizeBytes": 1193119,
    "chargedUnits": 2,
    "processingSeconds": 7.41,
    "error": null
}
```

Images that fail (broken link, not an image, larger than 40 MB) get a row with an `error` message and are **not charged**.

### How much does it cost?

You pay **$0.01 per started 4 megapixels of output**, plus a tiny start fee per run ($0.00025 per GB of memory, so $0.001 at the default 4 GB). No platform usage costs.

| Example | Output size | Price |
| --- | --- | --- |
| 480×640 photo, 4x | 1920×2560 (4.9 MP) | $0.02 |
| 400×300 image, 4x | 1600×1200 (1.9 MP) | $0.01 |
| 1000×750 photo, 2x | 2000×1500 (3 MP) | $0.01 |
| 750×1000 photo, 4x | 3000×4000 (12 MP) | $0.03 |
| Any image at the default 16 MP cap | up to 16 MP | $0.04 |

100 typical product photos (about 2–5 MP each) cost **$1–2**. You can set a maximum cost per run in the run options, and the Actor stops before going over it.

### How long does it take?

On the default 4 GB memory, roughly **1.5–3 seconds per output megapixel**: about 7 seconds for a 5 MP result and 45 seconds for 16 MP. Larger memory gives more CPU cores and shorter runs.

### Use it as an API

```bash
curl -X POST "https://api.apify.com/v2/acts/piracema_labs~ai-image-upscaler/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://example.com/photo.jpg"], "scale": "4"}'
```

The response contains the `outputUrl` of each upscaled image. Official Apify clients for [JavaScript](https://docs.apify.com/api/client/js) and [Python](https://docs.apify.com/api/client/python) work too, and you can connect runs to Zapier, Make, Google Drive or Dropbox with Apify [integrations](https://docs.apify.com/platform/integrations).

### FAQ

**Is this the same as Topaz Gigapixel or Photoshop Super Resolution?**
It's a similar AI technique, delivered pay-per-use instead of as desktop software or a subscription. Results differ by image; try a few of yours first.

**Does it add fake detail?**
It sharpens real structure and can invent plausible fine texture, as all AI upscalers do. For legal, medical or forensic images, use the original.

**Is my image data private?**
Your images and results are stored only in your own run's storage on Apify. The download links are long, unguessable URLs. Delete the run's storage when you no longer need it.

**Which model is used?**
Real-ESRGAN's compact general model (`realesr-general-x4v3`), BSD 3-Clause licensed, by Xintao Wang et al.

**Something broke or looks wrong?**
Open an issue on the Issues tab with a link to your run.

***

Made by [Piracema Labs](https://apify.com/piracema_labs). Also see our [Greenhouse, Lever & Ashby Jobs Scraper](https://apify.com/piracema_labs/ats-jobs-monitor) and [Workday Jobs Scraper](https://apify.com/piracema_labs/workday-jobs-monitor).

# Actor input Schema

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

Direct links to the images you want to enlarge (JPG, PNG, WebP, GIF, BMP or TIFF, up to 40 MB each). Use images you own or have the right to edit. Tip: to upscale your own files, upload them to Dropbox, Google Drive (public link) or any image host and paste the direct links.

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

How much larger the output should be. 4x turns a 1000×750 photo into 4000×3000.

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

JPG for photos (small files), PNG for lossless quality or transparency, WebP for the web.

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

Compression quality for JPG and WebP output (50–100). Ignored for PNG.

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

Largest output allowed. If an image would end up bigger, it is shrunk first so the result fits. 16 MP is about 4900×3270. Higher limits take longer and cost more (you pay per 4 MP of output).

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Parrot.red.macaw.1.arp.750pix.jpg/500px-Parrot.red.macaw.1.arp.750pix.jpg"
  ],
  "scale": "4",
  "outputFormat": "jpg",
  "quality": 92,
  "maxOutputMegapixels": 16
}
```

# Actor output Schema

## `results` (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/b/bc/Parrot.red.macaw.1.arp.750pix.jpg/500px-Parrot.red.macaw.1.arp.750pix.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("piracema_labs/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/b/bc/Parrot.red.macaw.1.arp.750pix.jpg/500px-Parrot.red.macaw.1.arp.750pix.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("piracema_labs/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/b/bc/Parrot.red.macaw.1.arp.750pix.jpg/500px-Parrot.red.macaw.1.arp.750pix.jpg"
  ]
}' |
apify call piracema_labs/ai-image-upscaler --silent --output-dataset

```

## MCP server setup

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