# AI Image Upscaler - Bulk Photos and TSV to 2x or 4x (`tidytools/ai-image-upscaler`) Actor

Upscale public photo and product image URLs by 2x or 4x. Paste a list or spreadsheet TSV; get downloadable JPEG/WebP per source row. Failed rows are free.

- **URL**: https://apify.com/tidytools/ai-image-upscaler.md
- **Developed by:** [Yukai Lin](https://apify.com/tidytools) (community)
- **Categories:** AI, E-commerce, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 upscaled images

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 — bulk 2× / 4× photo and product image URLs

### What it does

Upscale public photos and product images 2× or 4×, one result or free error per source row.

Paste public direct image links as `imageUrls`, or paste a spreadsheet as Tab-separated `pastedTable`. The first TSV line must contain exactly one `imageUrl` header (case insensitive). Other columns such as `sku` and `note` remain in `sourceRow`; they are never image jobs. The two input methods cannot be combined. Each array item or TSV data line is processed in order, including empty TSV lines.

### How to use

Choose `scale` 2 or 4 (default 2) and `format` JPEG or WebP (default JPEG). `quality` is 1–100 (default 85); `maxImages` is at most 100 (default 100) and `maxConcurrency` at most 2. The Actor serializes Dataset saves and billing attempts. Photos and product images work best. Use public HTTP(S) direct links; pages, private links, invalid URLs, oversized files and failed images produce free error rows. Original and result are limited to 10 MB, and output sides to 8,000 px. The input form includes one Unsplash sample with 4× WebP settings. Replace or remove it before processing your own images; running the sample successfully attempts one `image-upscaled` charge.

**Text-heavy pictures and screenshots may contain invented or distorted letter strokes after AI upscaling. Fine details are not guaranteed to match the source. Inspect the image before using it as evidence or publishing it.**

### Input example

```json
{"pastedTable":"sku\timageUrl\tnote\nA-01\thttps://www.gstatic.com/webp/gallery/1.jpg\tfront\nA-02\tnot-a-url\tbad cell\nA-03\t\tmissing","scale":2,"format":"jpeg"}
```

Each TSV data line has one Dataset row with `sourceLine` (physical line, header is line 1) and `sourceRow` (original cell values). The example gives one image plus free `invalid_url` and `missing_image_url` rows. A missing or duplicate `imageUrl` header, both input methods, or no rows gives `NO_RESULTS` and zero charges.

An HTML page or other non-image URL produces a free row with `errorType: unsupported_content`. If the image host rejects Cloudflare's AI transformation fetch, the service enlarges the already downloaded source bytes with standard interpolation. This fallback can look softer than the normal AI result. If both methods fail, the free row has `errorType: image_processing_failed` and suggests another public direct image link or downloading the image and uploading it to a public image host. Internal Cloudflare error codes are not shown.

### Output example

Illustrative Dataset rows (the output URL below is a placeholder, not a live link):

```json
[
  {"sourceId":"tsv:2","input":"https://www.gstatic.com/webp/gallery/1.jpg","sourceLine":2,"sourceRow":{"sku":"A-01","imageUrl":"https://www.gstatic.com/webp/gallery/1.jpg","note":"front"},"outputUrl":"<run-kv-url>","outputKey":"<output-key>","width":1280,"height":960,"bytes":123456,"success":true,"resultStored":true,"chargeEligible":true,"durationMs":1500},
  {"sourceId":"tsv:3","input":"not-a-url","sourceLine":3,"sourceRow":{"sku":"A-02","imageUrl":"not-a-url","note":"bad cell"},"success":false,"errorType":"invalid_url","error":"invalid_url","resultStored":false,"chargeEligible":false,"durationMs":0}
]
```

### Results and billing

A successful row contains `input`, `sourceId`, optional TSV `sourceLine` and `sourceRow`, `outputUrl`, `outputKey`, `width`, `height`, `bytes`, `success:true`, `resultStored:true`, `chargeEligible:true`, and `durationMs`. A failed row contains `input`, `sourceId`, optional TSV source fields, `success:false`, `errorType`, `error`, `resultStored:false`, `chargeEligible:false`, and `durationMs`.

### Pricing

The Actor tries the single `image-upscaled` pay-per-event charge only after the image is in the run key-value store and its Dataset row is confirmed saved. Price: $0.010 per confirmed successful image on FREE/BRONZE, $0.009 on SILVER, and $0.008 on GOLD and above; check Apify's current pricing display. Invalid URLs and failed rows are free. A source that previously failed for free can incur one `image-upscaled` charge if the fallback now saves a successful image. `chargeEligible` means eligible for a charge attempt, **not a receipt**. Dataset rows have no `charged` field. If billing returns zero, reaches a limit, or becomes uncertain, later valid URLs receive a free `not_processed_billing_stop` row without image processing; later invalid or empty URLs retain their specific free error. The run's `SUMMARY` reports `successfulResults`, `freeErrors`, `confirmedChargedCount`, `chargeReturnedZero`, `chargeCallErrors`, `chargeLimitReached`, `chargeUncertainCount`, `datasetStoreFailures`, and `unknownStore`; `billingNote` appears when the bill is uncertain. A definite Dataset save failure reports `STORE_FAILED` and never charges that result; an uncertain save reports `UNKNOWN` and also makes no new charge attempt. A charge error leaves the successful row and image available; the actual bill then needs checking. Resumed runs use a source-row progress record and do not resend a charge event already marked attempted. An interruption between marking and calling can yield a free result; exact once billing across crashes is not promised.

**Download within 7 days of the run. Default Apify run storage expires after 7 days unless configured otherwise; links may then stop working and this is not permanent archival.** The Dataset does not contain base64, so JSON cannot reconstruct an expired image. Download files yourself if you need long-term storage.

### Limitations

Public HTTP(S) direct JPEG/WebP images only. The original and result must each be at most 10 MB; output sides must be at most 8,000 px. Text-heavy images and screenshots can have invented strokes or details. Run storage defaults to 7 days; download the file within 7 days because the link may expire and the Dataset has no base64 backup.

### FAQ

**Can I paste a spreadsheet?** Yes. Paste Tab-separated text with exactly one `imageUrl` header; every source line gets a result or free error row.

**Does `chargeEligible:true` mean I paid?** No. It records eligibility for an attempt. Check `SUMMARY.confirmedChargedCount` and the Apify billing report for charges.

**Can I retrieve the image after the link expires?** No. Download it within 7 days; the Dataset cannot reconstruct it.

# Actor input Schema

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

One public HTTP(S) direct image URL per item. Use this or pastedTable, not both. The prefilled Unsplash image is a working example; replace or remove it before processing your own images. Empty and invalid entries are free.

## `pastedTable` (type: `string`):

First row must have exactly one imageUrl column (case insensitive). Tab-separated rows preserve all source fields. Use this or imageUrls, not both.

## `scale` (type: `integer`):

Enter 2 for 2× or 4 for 4× enlargement (only 2 and 4 are accepted); default is 2×.

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

Choose JPEG or WebP output; default is JPEG.

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

Output quality from 1 to 100; default is 85.

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

Process at most 100 source rows per run; default is 100.

## `maxConcurrency` (type: `integer`):

Maximum allowed is 2. Result saving and charge attempts are serial to preserve billing order.

## Actor input object example

```json
{
  "imageUrls": [
    "https://images.unsplash.com/photo-1500534623283-312aade485b7?w=250&fm=webp"
  ],
  "scale": 4,
  "format": "webp",
  "quality": 85,
  "maxImages": 100,
  "maxConcurrency": 1
}
```

# Actor output Schema

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

Success row: input, sourceId, optional TSV sourceLine/sourceRow, outputUrl, outputKey, width, height, bytes, success=true, resultStored=true, chargeEligible=true, durationMs. Free error row: input, sourceId, optional TSV sourceLine/sourceRow, success=false, errorType, error, resultStored=false, chargeEligible=false, durationMs. No charged field or base64; chargeEligible is not a receipt.

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

No description

## `summary` (type: `string`):

SUMMARY: requested, successfulResults, freeErrors, confirmedChargedCount, chargeReturnedZero, chargeCallErrors, chargeLimitReached, chargeUncertainCount, datasetStoreFailures, unknownStore, status, optional billingNote when charge is uncertain. Definite Dataset save failure gives STORE_FAILED; ambiguous save gives UNKNOWN. Billing stop leaves later input rows as free specific validation errors or not_processed_billing_stop.

# 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://images.unsplash.com/photo-1500534623283-312aade485b7?w=250&fm=webp"
    ],
    "scale": 4,
    "format": "webp"
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidytools/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://images.unsplash.com/photo-1500534623283-312aade485b7?w=250&fm=webp"],
    "scale": 4,
    "format": "webp",
}

# Run the Actor and wait for it to finish
run = client.actor("tidytools/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://images.unsplash.com/photo-1500534623283-312aade485b7?w=250&fm=webp"
  ],
  "scale": 4,
  "format": "webp"
}' |
apify call tidytools/ai-image-upscaler --silent --output-dataset

```

## MCP server setup

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