# Fast Image Upscaler 2x/4x for Graphics, Logos & Product Shots (`craigmckee/fast-image-upscaler`) Actor

Cheap batch AI upscaler (Real-ESRGAN compact) for graphics, icons, logos, AI art and product shots. 2x or 4x, PNG/JPEG/WebP, keeps transparency. Not for faces or portraits.

- **URL**: https://apify.com/craigmckee/fast-image-upscaler.md
- **Developed by:** [Print & Plan UK](https://apify.com/craigmckee) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$9.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

## Fast Image Upscaler 2x/4x for Graphics, Logos, AI Art & Product Shots

Upscale batches of **graphics, icons, logos, clip art, AI art, 3D renders and simple product shots** by **2x or 4x** with the compact **Real-ESRGAN** model. Paste image URLs and get sharp, clean PNG, JPEG or WebP files back, plus one result row per image.

- **Cheap and predictable:** **$0.009 per upscaled image**, same price for 2x and 4x. Failed, oversized, blocked or timed-out images are **free**.
- **Clean edges:** removes JPEG blockiness and blur on flat colours, outlines, icons and illustrations.
- **Keeps transparency:** transparent PNG/WebP logos and icons stay transparent.
- **Batch friendly:** up to 100 images per run, with a clear per-image status and error message.
- **Safe limits:** per-image size, pixel and time caps, so a run can't blow up your bill.

### ⚠️ Not for faces or portraits

This is a small, fast model. On **faces, skin, hair and fine natural textures** it gives a **smooth, waxy, "painted" look**. For photos of people, use a heavier photo or face-restoration upscaler instead. It also **can't recover very small text**: big lettering gets crisper, but tiny print may come out garbled (see the packaging example below).

### Before / after examples

Real outputs of this Actor on the Apify platform. **Left:** the original enlarged 4x with a normal bicubic resize. **Right:** this Actor's 4x output. Same 440×440 crop at full output size. All source images are **CC0 (public domain)** from Wikimedia Commons. Credits and sources: [CREDITS.md](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/CREDITS.md?signature=1PngIxjijmqiJaMowgQvY).

| Type | Before vs after (100% crop) |
|---|---|
| Flat icon, transparent PNG, 512×512 → 2048×2048 | ![Red apple icon: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/apple-icon-before-after.jpg?signature=10nGsmhbYHiNYCPS2aKVK) |
| 3D render clip art, 500×281 → 2000×1124 | ![Red car 3D render: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/3d-render-car-before-after.jpg?signature=1kOcALzkJtr67gNmCgEQ3) |
| AI art (Stable Diffusion), 512×512 → 2048×2048 | ![Gold dragon AI art: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/ai-art-dragon-before-after.jpg?signature=Gm2GmZAbgvx50jdipu0P) |
| AI art, 330×330 → 1320×1320 | ![Solarpunk train AI art: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/ai-art-solarpunk-before-after.jpg?signature=1JmfLyT5SHdOtOXSwoBK6) |
| Product shot, 330×259 → 1320×1036 | ![Casio printer product shot: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/product-printer-before-after.jpg?signature=1p9yLBF7geY1fdRjL64OC) |
| Product packaging, 500×371 → 2000×1484. Big text sharper, **small text garbled** | ![Salese packaging: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/product-salese-before-after.jpg?signature=goceJjWGmdvt4ZZAXV1M) |
| Weak spot: **natural textures** (a rough wall turns into an artificial pattern) | ![Paint tin on a wall: bicubic vs AI](https://api.apify.com/v2/key-value-stores/qJBqXKBQSUetPLHfN/records/product-paint-tin-before-after.jpg?signature=soWfnPKFiI7a2vVbqrMz) |

### Input

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/1/1b/Online-icon.png",
    "https://example.com/my-logo.png"
  ],
  "scale": "4",
  "outputFormat": "png"
}
```

| Field | Default | Notes |
|---|---|---|
| `imageUrls` | one small CC0 icon | Public http(s) links to PNG, JPEG, WebP, GIF (first frame), BMP or TIFF. |
| `scale` | `"4"` | `"4"` or `"2"`. Same price. |
| `outputFormat` | `png` | `png` (lossless, keeps transparency), `jpeg` (transparent areas on white), `webp` (keeps transparency, small files). |
| `jpegQuality` | 92 | For JPEG and WebP. |
| `maxImages` | 20 | Up to 100 per run. Extra URLs are listed as `skipped` (free). |
| `maxFileSizeMb` | 10 | Up to 15 MB per image. |
| `perImageTimeoutSecs` | 120 | Up to 300 s per image. |

The Actor also respects your **maximum cost per run**: once it's reached, the remaining images are listed as `skipped` and not processed.

### Limits (hard caps)

| Limit | Value |
|---|---|
| Images per run | 100 |
| File size per image | 15 MB |
| Input size | 0.26 megapixels (e.g. 512×512, 640×400, 724×362), longest side ≤ 2048 px, shortest ≥ 8 px |
| Output size | 4.2 megapixels (e.g. 2048×2048) |
| Time per image | 300 s |

Bigger images get a clear `input-too-large` error (free). Resize them first. These caps keep each image fast and the price fixed.

### Output

One dataset row per image. Upscaled files are saved in the run's key-value store, and `outputUrl` is a direct link.

```json
{
  "index": 1,
  "sourceUrl": "https://upload.wikimedia.org/wikipedia/commons/1/1b/Online-icon.png",
  "status": "ok",
  "scale": 4,
  "inputWidth": 256, "inputHeight": 256, "inputFormat": "PNG",
  "outputWidth": 1024, "outputHeight": 1024, "outputMegapixels": 1.049,
  "outputFormat": "png", "outputBytes": 605596,
  "outputKey": "upscaled-001-Online-icon.png",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/upscaled-001-Online-icon.png?signature=…",
  "downloadSecs": 0.08, "upscaleSecs": 1.55, "encodeSaveSecs": 0.34, "totalSecs": 2.0
}
```

Failed images have `status: "failed"` (or `"skipped"`), an `errorCode` and a plain-English `error`, for example `input-too-large`, `file-too-large`, `not-an-image`, `download-failed`, `download-blocked`, `blocked-url`, `invalid-url`, `timeout` or `charge-limit-reached`. They are never charged.

### Speed and memory

The default is **1 GB**, the cheapest setting for small runs.

💡 **Tip for batches:** set **Memory = 4 GB** in the run options. In our tests on Apify, batch upscaling at 4 GB was **about 5x faster** and used **about 25–40% less platform compute per image** than at 1 GB:

- **At 1 GB:** the run gets a full CPU burst only for the first 20–40 s. After that it drops to about a quarter of a core, around 11–15 s per output megapixel.
- **At 4 GB:** it stays at 2–3 s per output megapixel.

Your price stays $0.009 per image either way: under pay-per-event, the compute is included. Peak memory in our tests stayed under 600 MB.

### Pricing

Pay per event: **$0.009 per successfully upscaled image** ($9 per 1,000). Nothing is charged for images that fail or are skipped.

### How it works

- Model: **Real-ESRGAN `realesr-general-x4v3`** (compact SRVGG network, 4x), run on CPU with ONNX Runtime. The image is processed in overlapping tiles, so memory stays flat.
- **2x** = the model's 4x output, downscaled with a high-quality Lanczos filter. This is Real-ESRGAN's own "outscale" method.
- Transparency is upscaled separately with Lanczos and re-attached.
- Only public http(s) URLs are fetched. Private and internal addresses are blocked, including through redirects. Each download is size-limited while it streams.

### Licences and attribution

This Actor uses the **Real-ESRGAN** model and weights by **Xintao Wang, Liangbin Xie, Chao Dong and Ying Shan** ([github.com/xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN)). The weights `realesr-general-x4v3.pth` come from the project's official v0.2.5.0 release, SHA-256 `8dc7edb9…6292`. They are shipped as an unmodified ONNX export. Full details are in `licenses/NOTICE.md`, and the licence text is in `licenses/Real-ESRGAN-LICENSE.txt`:

```
BSD 3-Clause License

Copyright (c) 2021, Xintao Wang
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

Citation: Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan. *Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data.* ICCV Workshops, 2021.

Make sure you have the right to upscale and use the images you submit. This Actor doesn't store your images beyond the run's own storage.

# Actor input Schema

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

Public http(s) links to PNG, JPEG, WebP, GIF (first frame), BMP or TIFF images. Each image must be at most 0.26 MP (e.g. 512×512 or 640×400), 2048 px on the longest side and 15 MB; output is at most 2048×2048 (4.2 MP). Best for graphics, icons, logos, AI art and product shots. **Not for faces or portraits.**

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

4x (e.g. 256×256 → 1024×1024) or 2x. Same price per image.

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

PNG keeps transparency and is lossless (bigger files). JPEG puts transparent areas on white. WebP keeps transparency and is smaller.

## `jpegQuality` (type: `integer`):

Only used for JPEG and WebP output.

## `maxImages` (type: `integer`):

Images after this number are listed as skipped (not charged). Hard limit: 100 per run.

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

Downloads larger than this are stopped and reported (not charged). Hard limit: 15 MB.

## `perImageTimeoutSecs` (type: `integer`):

Download + upscale + save must finish within this time, otherwise the image is reported as timed out (not charged). Hard limit: 300 s.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/1/1b/Online-icon.png"
  ],
  "scale": "4",
  "outputFormat": "png",
  "jpegQuality": 92,
  "maxImages": 20,
  "maxFileSizeMb": 10,
  "perImageTimeoutSecs": 120
}
```

# Actor output Schema

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

No description

## `images` (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/1/1b/Online-icon.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("craigmckee/fast-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/1/1b/Online-icon.png"] }

# Run the Actor and wait for it to finish
run = client.actor("craigmckee/fast-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/1/1b/Online-icon.png"
  ]
}' |
apify call craigmckee/fast-image-upscaler --silent --output-dataset

```

## MCP server setup

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