# Image Upscaler API — Upscale Images 2x/4x, Pay per Image (`sherwood/image-upscaler-batch`) Actor

Upscale images 2x or 4x with AI super-resolution: send one or many image URLs, get for each a dataset item with the upscaled image URL, width and height. Increase image resolution or enhance low-res photos in batch, no API key, pay per image.

- **URL**: https://apify.com/sherwood/image-upscaler-batch.md
- **Developed by:** [Sherwood](https://apify.com/sherwood) (community)
- **Categories:** AI, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.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 API — batch 2x/4x, pay per image

Give it one image URL or a thousand, or the dataset of another Actor, and get every image upscaled 2x, 4x or to a target size in pixels with an AI super-resolution model (SeedVR2), one dataset item per image: the upscaled file URL, its width and height, or a clear error. No API key, no GPU, no subscription. **$0.012 per image** delivered, failures are free.

Built for automation and AI agents: send a list in `imageUrls`, or a single URL (or a comma-separated string) in `imageUrl`; every alias (`imageUrls`, `imageUrl`, `urls`, `images`, `startUrls`) is merged, nothing is required, and the default input runs on its own so you can see the output shape before sending your own files.

### What you get

One item per image, in your dataset:

```json
{
  "index": 0,
  "inputUrl": "https://example.com/product-small.jpg",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/upscaled-0000.jpg",
  "width": 2048,
  "height": 2048,
  "megapixels": 4.19,
  "scale": "2",
  "factor": 2,
  "format": "jpg",
  "model": "fal-ai/seedvr/upscale/image",
  "durationMs": 9120,
  "status": "ok",
  "error": null
}
```

A failed image (unreachable URL, not an image, over 25 MB) comes back with `"status": "error"` and the reason in `error`. It is never charged.

An image already large enough for `targetLongEdge` or `skipIfLongEdgeAtLeast` comes back with `"status": "skipped"` and its original URL in `outputUrl`, so the next step of a workflow still gets a usable file. It is never charged either.

Transparent images, such as cutouts from a background remover, keep their transparency in PNG and WebP output. JPG has no transparency: transparent areas become white.

### Use cases

- Upscale e-commerce product photos for listings and marketplaces in bulk.
- Restore blurry, compressed or low-resolution pictures before print.
- Enlarge AI-generated images (Midjourney, Flux, Stable Diffusion) to usable sizes.
- Sharpen thumbnails and avatars pulled from a scraper, in the same workflow.
- Give an AI agent or an n8n / Make / Zapier flow a single call that handles a whole list.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `imageUrls` | array | two sample images | Public JPG, PNG or WebP URLs. For a single URL or a comma-separated string, use `imageUrl`. |
| `imageUrl`, `urls`, `images`, `startUrls` | aliases | — | Merged with `imageUrls`, duplicates removed. `startUrls` accepts `{"url": "..."}` objects. |
| `datasetId` | string | — | Read the image URLs from an Apify dataset instead (see below). |
| `urlField` | string | auto | Field holding the image URL in each dataset item: `images[].url`, `photo.thumbnails[0].url`... |
| `maxImagesPerItem` | integer | `1` | Image URLs taken from each dataset item. |
| `keepFields` | array | — | Fields copied from each dataset item into its result, under `source` (SKU, ASIN, listing URL). |
| `scale` | `"2"` or `"4"` | `"2"` | 2 doubles width and height, 4 quadruples them. |
| `targetLongEdge` | integer | — | Longest side to reach, in pixels, instead of 2x/4x (at most 4x). Images already this large are skipped. |
| `skipIfLongEdgeAtLeast` | integer | — | Skip, without charge, images whose longest side is already this large. |
| `outputFormat` | `jpg`, `png`, `webp` | `jpg` | PNG and WebP keep transparency. |
| `maxOutputMegapixels` | integer | `16` | Cap on output size; larger results are upscaled to this size instead. 4 MP ≈ 2000×2000. |
| `maxImages` | integer | `100` | Stop after this many images. |

Minimal call:

```json
{ "imageUrls": ["https://example.com/a.jpg", "https://example.com/b.png"] }
```

### Chain it after another Actor

Give `datasetId` (a dataset ID or name) and the Actor reads the image URLs from its items: the output of a scraper, of [Background Remover API](https://apify.com/sherwood/background-remover-batch) or of [AI Image Generator](https://apify.com/sherwood/image-generator-batch). The image field is detected automatically (`outputUrl`, `highResolutionImages`, `imageUrls`, `images`, `displayUrl`, `thumbnailImage`...), or set it with `urlField`.

```json
{
  "datasetId": "YOUR_DATASET_ID",
  "urlField": "images[].url",
  "keepFields": ["sku", "url"],
  "targetLongEdge": 2048
}
```

To run it automatically after another Actor, add it on that Actor's **Integrations** tab with this input; the platform fills in the dataset of each finished run:

```json
{ "datasetId": "{{resource.defaultDatasetId}}", "outputFormat": "png" }
```

Each result carries `sourceItemIndex`, the position of the item it came from, and the fields listed in `keepFields`, so a spreadsheet or a store import can match every upscaled image with its product.

### Pricing

- **Image upscaled** — $0.012 per image delivered, output up to 4 MP included.
- **Extra megapixel** — $0.002 per started megapixel above 4 MP (a 4x upscale of a 1000×1000 photo is 16 MP, so 12 extra).
- Failed, unreachable or non-image URLs: free.

Set a maximum cost per run in Apify and the Actor stops cleanly when it is reached; remaining images are reported, not processed.

### Via API, n8n, Make or MCP

Call it like any Apify Actor: `POST https://api.apify.com/v2/actors/sherwood~image-upscaler-batch/run-sync-get-dataset-items` with the JSON input above, or add it as a tool through the Apify MCP server. Results are plain dataset items, so `get-dataset-items` returns the URLs directly.

### Limits

- Input images up to 25 MB each, served over public http(s) URLs.
- Output files live in the run's key-value store and follow your account's data retention.
- Processing time is typically 5 to 25 seconds per image; 4 images are processed in parallel.

# Actor input Schema

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

Public URLs of the images to upscale (JPG, PNG, WebP), as a list. One dataset item is returned per URL, with an index matching the input order. For a single URL, or several URLs in one comma- or newline-separated string, use imageUrl instead. Aliases merged into this list: imageUrl, urls, images, startUrls.

## `datasetId` (type: `string`):

Read the image URLs from an Apify dataset: the output of a scraper, of sherwood/background-remover-batch or of sherwood/image-generator-batch. When this Actor runs as an integration after another Actor, leave it empty: the dataset of the run that triggered it is used. The sample imageUrls are ignored when a dataset is given.

## `urlField` (type: `string`):

Field of each dataset item that holds the image URL. Dots for nested fields, \[] for every element of a list, \[0] for the first one: outputUrl, highResolutionImages, images\[].url, photo.thumbnails\[0].url. Several fields separated by commas are tried in order. Empty: detected automatically (outputUrl, highResolutionImages, imageUrls, images, imageUrl, image, photos, displayUrl, mainImage, thumbnailImage...).

## `maxImagesPerItem` (type: `integer`):

How many image URLs to take from each dataset item, in order. Default 1: the first one, usually the main image.

## `keepFields` (type: `array`):

Fields copied from each dataset item into its result, under source: asin, sku, url, title... Same path syntax as urlField.

## `imageUrl` (type: `string`):

A single image URL, or several URLs in one comma- or newline-separated string (they are split). Merged with imageUrls.

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

Alias of imageUrls.

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

Alias of imageUrls.

## `startUrls` (type: `array`):

Alias of imageUrls. Accepts plain strings or {"url": "..."} objects.

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

2 doubles width and height (4x the pixels). 4 quadruples them (16x the pixels). Output is capped by maxOutputMegapixels. Ignored when targetLongEdge is set.

## `targetLongEdge` (type: `integer`):

Upscale each image until its longest side reaches this many pixels, for example 2048 for a Shopify product image or 3508 for an A4 print at 300 DPI. At most 4x per image, within maxOutputMegapixels. Images already this large are returned unchanged (status skipped) and not charged.

## `skipIfLongEdgeAtLeast` (type: `integer`):

Images whose longest side is already at least this many pixels are returned unchanged (status skipped, outputUrl = the original URL) and not charged. Useful when a dataset mixes thumbnails and full-size photos.

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

File format of the upscaled image. Transparent inputs (cutouts from a background remover) keep their transparency in PNG and WebP; in JPG, transparent areas become white.

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

Safety cap on the output size, in megapixels (width × height / 1,000,000). Images whose upscaled size would exceed it are upscaled to this size instead. 4 MP ≈ 2000×2000. Default 16.

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

Stop after this many images. Protects against oversized lists. Default 100.

## Actor input object example

```json
{
  "imageUrls": [
    "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png",
    "https://storage.googleapis.com/falserverless/example_inputs/dog.png"
  ],
  "maxImagesPerItem": 1,
  "scale": "2",
  "outputFormat": "jpg",
  "maxOutputMegapixels": 16,
  "maxImages": 100
}
```

# Actor output Schema

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

One item per input image: inputUrl, outputUrl (the upscaled file), width, height, megapixels, status and error. Sort by index to match the input order.

## `files` (type: `string`):

The upscaled image files referenced by outputUrl.

# 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://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png",
        "https://storage.googleapis.com/falserverless/example_inputs/dog.png"
    ],
    "scale": "2",
    "outputFormat": "jpg",
    "maxOutputMegapixels": 16,
    "maxImages": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("sherwood/image-upscaler-batch").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://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png",
        "https://storage.googleapis.com/falserverless/example_inputs/dog.png",
    ],
    "scale": "2",
    "outputFormat": "jpg",
    "maxOutputMegapixels": 16,
    "maxImages": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("sherwood/image-upscaler-batch").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://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png",
    "https://storage.googleapis.com/falserverless/example_inputs/dog.png"
  ],
  "scale": "2",
  "outputFormat": "jpg",
  "maxOutputMegapixels": 16,
  "maxImages": 100
}' |
apify call sherwood/image-upscaler-batch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sherwood/image-upscaler-batch"
        }
    }
}
```

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/EFKU3WqKV3q1owKCQ/builds/L5UrzluyxgZ4ZRzZ7/openapi.json
