# Image Upscaler: 2x and 4x AI super resolution in bulk (`examsens.ai/image-upscaler`) Actor

Enlarges every image URL you list by 2x or 4x with Real-ESRGAN, running inside the actor with no outside API. Three noise levels, PNG, JPEG or WebP output, transparency kept. Returns a download link for each file.

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

## Pricing

from $30.00 / 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.

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

## Image Upscaler: 2x and 4x AI super resolution in bulk

Give it a list of image URLs and it enlarges each one by 2x or 4x with Real-ESRGAN, an open super resolution model. The model runs inside the actor, so your images go to no outside API and there is no key to set up. Every enlarged file goes into the run's key value store, and the dataset gives you a direct download link with the size before and after.

### What it does

- Upscales by 2x or 4x. A 550 by 368 photo comes out at 1100 by 736 or 2200 by 1472.
- Sharpens while it enlarges. The model rebuilds edges and texture instead of stretching pixels, so the result is crisper than a plain resize.
- Three noise levels. Low keeps the most texture and grain. High smooths away noise. Medium sits between them. On a photo with added noise, high left 29% less fine noise than low.
- Keeps transparency in PNG and WebP output. The alpha channel is enlarged with Lanczos. JPEG output fills transparent areas with white.
- Turns photos upright from their EXIF orientation first, so portrait photos stay portrait.
- Handles many images in one run. Each image gets its own result, and one bad link never stops the run.

Reads JPEG, PNG, WebP, GIF, BMP, TIFF and the other formats Pillow reads. An animated GIF is upscaled from its first frame, and the item says so in `note`.

### Example

A 400 by 301 PNG with a transparent background came out at 1600 by 1204 at 4x, with its transparency kept. A 1024 by 772 WebP photo came out at 4096 by 3088.

### Input

- Image URLs (required)
- Scale: 2x (default) or 4x
- Noise removal: low, medium (default) or high
- Output format: PNG (default), WebP or JPEG
- Quality (default 90), for JPEG and WebP
- Largest source image in megapixels (default 1, ceiling 4). A larger source gets an error item and is not charged. 1 megapixel is about 1000 by 1000 pixels.
- Maximum file size in MB (default 25)

### Output

Dataset: one item per URL with `outputUrl` (download link), `outputKey` (the file name in the key value store), `scale`, `denoise`, `inputFormat`, `inputWidth`, `inputHeight`, `outputFormat`, `outputWidth`, `outputHeight`, `outputBytes`, `hasTransparency`, `processingSeconds`, `sourceMegapixels` and `chargedEvent`. Files are named by their position in your list, the source file name and the scale, such as `0001-photo-x4.png`.

A URL that cannot be upscaled gets `ok: false` and an `error`, such as `HTTP 404`, an unknown host, a file over the size limit, a source over the megapixel limit, or "the file is not an image format this actor can read" for a web page.

### Speed

The model runs on the CPU, so time grows with the number of source pixels. At the default 4 GB of memory, a 550 by 368 photo took 6 seconds at 4x and a 400 by 301 PNG with transparency took 4 seconds.

### Model and license

Real-ESRGAN, model `realesr-general-x4v3`, by Xintao Wang and contributors, released under the BSD 3-Clause License. The three noise levels blend its two published weight files the same way the official Real-ESRGAN inference script does. For 2x, the 4x result is scaled down with Lanczos, as that script also does.

### Pricing

Pay per event, one event per image upscaled, set by the size of the source image:

- `image-upscaled` for a source of 0.5 megapixels or less, such as 800 by 600
- `large-image-upscaled` for a source above 0.5 megapixels, up to the megapixel limit you set

Each item shows its `sourceMegapixels` and the `chargedEvent`. URLs that fail are not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

Only the URLs you supply are downloaded. The actor does not log in anywhere and uses no proxies. Upscale images you have the right to use. An upscaled image adds detail the model predicts, so do not treat it as evidence of what the original showed.

### Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.

# Actor input Schema

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

Direct links to image files (JPEG, PNG, WebP, GIF, BMP, TIFF and other formats Pillow reads).

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

2 doubles the width and height. 4 makes them four times larger.

## `denoise` (type: `string`):

Low keeps the most fine texture and grain. High smooths away JPEG blocks and sensor noise. Medium sits between them.

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

PNG is lossless and keeps transparency. WebP keeps transparency and gives smaller files. JPEG fills transparent areas with white.

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

1 to 100 for JPEG and WebP. PNG ignores this.

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

Source images with more pixels than this get an error item and are not charged. 1 megapixel is about 1000 by 1000. The ceiling is 4.

## `maxFileSizeMb` (type: `integer`):

Skip source files larger than this, with an error item.

## Actor input object example

```json
{
  "imageUrls": [
    {
      "url": "https://www.gstatic.com/webp/gallery/1.jpg"
    }
  ],
  "scale": "2",
  "denoise": "medium",
  "outputFormat": "png",
  "quality": 90,
  "maxInputMegapixels": 1,
  "maxFileSizeMb": 25
}
```

# 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": [
        {
            "url": "https://www.gstatic.com/webp/gallery/1.jpg"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.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": [{ "url": "https://www.gstatic.com/webp/gallery/1.jpg" }] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.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": [
    {
      "url": "https://www.gstatic.com/webp/gallery/1.jpg"
    }
  ]
}' |
apify call examsens.ai/image-upscaler --silent --output-dataset

```

## MCP server setup

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