# Bulk Image Upscaler 2x/4x from CSV, Sheet or URL List (`badboxx_newlife/bulk-image-upscaler`) Actor

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

## Pricing

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

## Bulk Image Upscaler: 2x / 4x from CSV, Google Sheet or URL list

Upscale hundreds of images from URLs in one run. AI upscaling (Real-ESRGAN `realesr-general-x4v3`, ONNX, CPU) with an automatic Lanczos fallback. You get every image as PNG or JPG, one ZIP, and a result table. **$0.015 per successfully upscaled image. Failures are free.**

### Input

```json
{ "urls": ["https://example.com/a.jpg", "https://example.com/b.png"], "scale": "2", "format": "png" }
```

```json
{ "sheetUrl": "https://docs.google.com/spreadsheets/d/<id>/edit#gid=0", "csvUrl": "https://example.com/list.csv", "scale": "4", "format": "jpg", "maxImages": 200 }
```

| Field | Default | Meaning |
|---|---|---|
| `urls` / `csvUrl` / `sheetUrl` | - | Merged and deduplicated. CSV/Sheet: column `url` (any case), else the first column. Non-http rows skipped. Sheet must be link-shared. |
| `scale` | "2" | "2" or "4" (a string in API input; an integer is rejected with HTTP 400) |
| `format` | png | `png` or `jpg` (quality 92, transparency flattened to white) |
| `maxImages` | 100 | Cap per run |
| `imageTimeoutSecs` | 180 | Whole-image timeout, download included |
| `modelTimeoutSecs` | 60 | AI time limit per image; on timeout the image is upscaled with Lanczos |
| `useModel` | true | `false` = Lanczos only (fast) |

### Output

- Key-value store: `img-<n>-<name>.png|jpg`, `upscaled.zip` (all successful images), `OUTPUT` (link to the ZIP).
- Dataset row per URL: `url, status, method, inWidth, inHeight, outWidth, outHeight, bytes, kvKey, link, error`.
- `status`: `ok`, `download_error`, `not_image`, `too_large`, `output_too_large`, `timeout`, `error`. `method`: `model` or `lanczos`.

### Pricing

Pay per event: **`image` = $0.015**, charged only after the image is saved. Bad URLs, non-images, too-large and failed images are not charged. The run stops cleanly when your max-charge limit is reached.

### Limits

- Input max **25 MP**, output max **100 MP** (e.g. a 12 MP image at 4x is refused as `output_too_large`).
- Download max **50 MB**, download timeout 30 s.
- AI model runs on CPU only for inputs up to **1 MP** (measured on the platform at 4096 MB: ~0.08 MP in ~1.5 s, ~1 MP close to 60 s). Larger inputs, `useModel=false` or a model timeout use Lanczos resampling (`method=lanczos`).
- If `upscaled.zip` exceeds **1 GB** it is not uploaded; `OUTPUT` then has `zip: null` and a note. Use the per-image links in the dataset.
- Images are processed one at a time; the run fetches only the URLs you give, no crawling.

### Privacy

No personal data collected. Metadata (EXIF, GPS) is stripped from outputs. Images are kept only in your run's storage.

### Run the check

`python3 check.py` (offline; needs numpy, Pillow, onnxruntime). Publish: `APIFY_TOKEN=... python3 publish.py` (`--dry-run` shows the payload).

SEO title: Bulk Image Upscaler 2x/4x from CSV, Sheet or URLs
SEO description: Upscale images in bulk from a URL list, CSV or Google Sheet. Real-ESRGAN AI on CPU with Lanczos fallback. PNG/JPG + ZIP. $0.015 per image.

# Actor input Schema

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

Direct http(s) links to images (JPG, PNG, WebP, GIF, BMP, TIFF). Merged with the CSV and Sheet and deduplicated.

## `csvUrl` (type: `string`):

Public CSV with a 'url' column (case-insensitive), or else the first column is used. Non-http rows are skipped.

## `sheetUrl` (type: `string`):

Public (link-shared) Google Sheet URL, e.g. https://docs.google.com/spreadsheets/d/<id>/edit#gid=0. Same column rule as CSV.

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

Upscale factor: 2 or 4.

## `format` (type: `string`):

png (lossless) or jpg (quality 92, transparency flattened to white).

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

Maximum number of images processed per run.

## `imageTimeoutSecs` (type: `integer`):

Whole-image timeout including download.

## `modelTimeoutSecs` (type: `integer`):

Per-image AI model time limit. On timeout the image is upscaled with Lanczos instead.

## `useModel` (type: `boolean`):

Real-ESRGAN on CPU for images up to 1 MP (platform speed: ~0.08 MP in ~1.5 s, ~1 MP near 60 s); off or larger images use Lanczos resampling.

## Actor input object example

```json
{
  "urls": [
    "https://commons.wikimedia.org/wiki/Special:FilePath/Cat03.jpg?width=320"
  ],
  "scale": "2",
  "format": "png",
  "maxImages": 100,
  "imageTimeoutSecs": 180,
  "modelTimeoutSecs": 60,
  "useModel": true
}
```

# Actor output Schema

## `images` (type: `string`):

No description

## `zip` (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 = {
    "urls": [
        "https://commons.wikimedia.org/wiki/Special:FilePath/Cat03.jpg?width=320"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("badboxx_newlife/bulk-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://commons.wikimedia.org/wiki/Special:FilePath/Cat03.jpg?width=320"] }

# Run the Actor and wait for it to finish
run = client.actor("badboxx_newlife/bulk-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://commons.wikimedia.org/wiki/Special:FilePath/Cat03.jpg?width=320"
  ]
}' |
apify call badboxx_newlife/bulk-image-upscaler --silent --output-dataset

```

## MCP server setup

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