# GPT-Image-2 | 1K/2K/4K AI Image Generator (`ai_stuffapi/gpt-image-2-generator`) Actor

Generate stunning AI images at 1K, 2K, and 4K resolution. Up to 76% cheaper than official pricing.  New GPT Image 2 model - limited time pricing

- **URL**: https://apify.com/ai\_stuffapi/gpt-image-2-generator.md
- **Developed by:** [Ai Stuff](https://apify.com/ai_stuffapi) (community)
- **Categories:** AI, Automation, Social media
- **Stats:** 174 total users, 3 monthly users, 85.5% runs succeeded, 6 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $40.00 / 1,000 image generateds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## GPT-Image-2 | 1K/2K/4K AI Image Generator

Generate stunning, high-fidelity AI images using the GPT-Image-2 model family. This Actor provides a unified interface for Standard, Professional (2K), and Cinematic (4K) resolutions at a fraction of the cost of mainstream providers.

### 🌟 Key Features

- **High Resolution**: Choose between 1024px (1K), 2048px (2K), and 3840px+ (4K).
- **Multiple Aspect Ratios**: Supports Square (1:1), Widescreen (16:9), Mobile (9:16), and more.
- **Image-to-Image**: Provide reference URLs to guide the AI generation.
- **Failover Protection**: Built-in redundancy across global endpoints ensures maximum uptime.

### 💰 Pricing & Tiered Limits

This Actor uses Apify's native **Pay-Per-Event (PPE)** model. We support both Free and Paid Apify users with different access levels:

#### ⚡ Paid Apify Users (Starter, Scale, etc.)

Unlock the full premium experience:

- **Unlimited generations** (no lifetime limit).
- **Ultra-High-Definition Resolutions** (Fully unlock **2K** and **4K**).
- **High-Speed Execution** (No artificial delay or throttling).
- **Multiple Reference Images** (Use up to platform limits).

#### 🔒 Free Apify Users

- **Strictly limited to 5 lifetime generations** across all runs.
- **Locked to Standard Resolution** (1K only; 2K/4K requests are automatically downgraded).
- **1 Reference Image max** is accepted.
- **Throttled execution speed** (standard 3-second delay).

*To unlock unlimited high-speed generations, multiple reference images, and ultra-high-definition 4K resolution, please upgrade your Apify account to a paid subscription.*

### 🚀 How to Use

1. Enter your **Image Prompt**.
2. Select your desired **Resolution** (1K, 2K, or 4K).
3. (Optional) Choose an **Aspect Ratio** and **Quality** level.
4. Run the Actor and get your image URL in the dataset results.

### 🛠 Integration

Perfect for automation pipelines:

- **Zapier / Make / n8n**: Batch generate social media content or e-commerce assets.
- **API**: Trigger programmatically and receive results via webhooks or polling.

# Actor input Schema

## `prompt` (type: `string`):

Describe the image you want to generate. Be as detailed as possible for best results.

## `resolution` (type: `string`):

Output resolution tier. Higher resolution takes longer to generate.

## `aspectRatio` (type: `string`):

Output image dimensions ratio.

## `quality` (type: `string`):

Rendering quality level. High quality produces the most detailed results.

## `referenceImageUrls` (type: `array`):

Provide publicly accessible image URLs to use as visual references (image-to-image generation).

## Actor input object example

```json
{
  "prompt": "A futuristic city with flying cars and neon lights, cinematic lighting, 8k resolution, highly detailed",
  "resolution": "1K",
  "aspectRatio": "1:1",
  "quality": "high"
}
```

# 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 = {
    "prompt": "A futuristic city with flying cars and neon lights, cinematic lighting, 8k resolution, highly detailed"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ai_stuffapi/gpt-image-2-generator").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 = { "prompt": "A futuristic city with flying cars and neon lights, cinematic lighting, 8k resolution, highly detailed" }

# Run the Actor and wait for it to finish
run = client.actor("ai_stuffapi/gpt-image-2-generator").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 '{
  "prompt": "A futuristic city with flying cars and neon lights, cinematic lighting, 8k resolution, highly detailed"
}' |
apify call ai_stuffapi/gpt-image-2-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ai_stuffapi/gpt-image-2-generator"
        }
    }
}

```

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/kmZV3TniJToV0cvsV/builds/j2vX1VMlULCyZdwI9/openapi.json
