# AI Image Generator: FLUX Text to Image in Bulk (`bulkleads/ai-image-generator-flux`) Actor

Turn text prompts into images with FLUX.1-schnell and get each one back as a file with a download link. Paste prompts, up to 100,000 a run, 1-4 images each, any size from 512 to 1440 pixels, JPG, PNG or WebP. Product shots, ads, blog art. $0.0038 per image.

- **URL**: https://apify.com/bulkleads/ai-image-generator-flux.md
- **Developed by:** [bulkleads](https://apify.com/bulkleads) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.85 / 1,000 images generated

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/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 Generator** turns text prompts into images with **FLUX.1-schnell**, the fast open text-to-image model, and gives each image back as a file with a download link, in your order. Paste prompts, one per line, click Start, and get a dataset with a link to every image. It costs **$0.0038 per image**, and prompts that cannot be used are free.

### What can I use an AI image generator for?

- **Product and marketing images**: lifestyle shots, backgrounds and mockups for Shopify, Amazon and ads.
- **Blog and social media art**: a header image for every post, made from its title.
- **Ad creative testing**: many variations of one idea (up to 4 images per prompt) to test which one wins.
- **Illustrations and icons**: flat vector-style art, scenes and concepts.
- **Bulk image pipelines**: thousands of prompts in one run, through the Console or the API.

### What does each result include?

- `id` (your id, or the prompt's line number) and `prompt`
- `image_url`: a link to the first image's file in the run's storage
- `images`: every image made from the prompt, each with `image_url`, `image_key` (its file name in the storage), `width`, `height`, `seed`, `bytes` and `format`
- `num_images`, `width`, `height`, `format` and `seeds`
- `status`: `generated` or `failed` (with an `error`); `input_problem: true` means the prompt itself could not be used (empty, over 2,000 characters, or not allowed). Failed prompts are free.

### How to generate images in bulk

1. Put your prompts in **Prompts**, one per line. Through the API you can also send a list of objects: `{"id": "hero-1", "prompt": "...", "width": 1440, "height": 816, "num_images": 2, "seed": 42, "format": "png"}`.
2. Pick the **Width** and **Height** (512 to 1440 pixels), **Images per prompt** (1 to 4) and the **File format** (JPG, PNG or WebP). Give a **Seed** to get the same image again later.
3. Click **Start**. Each prompt's images appear in the results as soon as they are done.

### Output example

```json
{
  "id": "1",
  "prompt": "Studio product photo of a white ceramic coffee mug on a light oak table, soft morning light, minimal background",
  "status": "generated",
  "image_url": "https://api.apify.com/v2/key-value-stores/<store id>/records/00001-1-1.jpg?signature=...",
  "images": [
    { "image_url": "https://api.apify.com/v2/key-value-stores/<store id>/records/00001-1-1.jpg?signature=...", "image_key": "00001-1-1.jpg", "width": 1024, "height": 1024, "seed": 1873420961, "bytes": 98213, "format": "jpg" }
  ],
  "num_images": 1,
  "width": 1024,
  "height": 1024,
  "format": "jpg",
  "seeds": [1873420961],
  "notes": null,
  "error": null,
  "input_problem": false
}
```

### How much does it cost?

**$0.0038 per image**, less on higher Apify plans, plus a small start fee per run (it pays for starting the image model's GPU server when it is idle). An image up to about 1 megapixel (1024x1024 or smaller, e.g. 1216x832) counts as one image; a larger one (e.g. 1440x1440) counts as 2, because it takes more than twice the GPU time. Prompts that could not be used or failed are free. 100 prompts at 1024x1024 cost about 100 x $0.0038 plus the start fee, so put many prompts in one run rather than one prompt per run. Set a maximum cost per run in Apify and the run stops there.

### Which model is it?

**FLUX.1-schnell** by Black Forest Labs (Apache-2.0 licence, so the images can be used commercially), run on our own GPUs in 4 steps. It follows prompts closely and renders short text in images well.

### FAQ

**How do I download the images?** Each row's `image_url` (and each entry in `images`) opens the file. To get them all at once, open the run's **Storage**, then **Key-value store**, or read the store through the Apify API.

**Why is the first image of a run sometimes slow?** When nobody has used the model for a while, the first prompt waits for its GPU server to start (up to about 2 minutes). After that an image takes about 4 seconds, two batches at a time.

**Which prompts are refused?** Empty prompts, prompts over 2,000 characters and prompts asking for sexual content or nudity come back `failed` with `input_problem: true` and are never charged.

**Can I get the same image again?** Yes: the same prompt, size and seed give the same image. Each row's `seeds` lists the seed of every image.

**What does `failed` without `input_problem` mean?** The image failed on our side this time: run that prompt again. It is not charged.

**How long are the files kept?** As long as Apify keeps the run's storage on your plan. Download or copy them where you need them.

### Related actors

Make images bigger and sharper: [AI Image Upscaler & Image Enhancer](https://apify.com/bulkleads/ai-image-upscaler). Prompts in bulk on an open model: [OpenRouter Alternative: Bulk LLM Prompts](https://apify.com/bulkleads/openrouter-alternative-bulk-llm).

# Actor input Schema

## `prompts` (type: `array`):

One prompt per line, up to 100,000 a run: a sentence describing the image you want. Each prompt comes back with its images as files in the run's storage, with a link to each, in your order. Through the API a prompt can also be an object with its own id, width, height, seed and num_images.

## `width` (type: `integer`):

Image width in pixels, 512 to 1440 (rounded down to a multiple of 16). Images up to about 1 megapixel (1024x1024) are charged once; larger ones count as 2 images.

## `height` (type: `integer`):

Image height in pixels, 512 to 1440 (rounded down to a multiple of 16).

## `imagesPerPrompt` (type: `integer`):

How many different images to make from each prompt, 1 to 4. Each image is charged.

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

JPG (smallest), PNG (lossless) or WebP.

## `seed` (type: `integer`):

The same prompt, size and seed give the same image again (optional). Leave empty for a new image each time.

## `maxPrompts` (type: `integer`):

Make images for at most this many prompts from the list (optional).

## Actor input object example

```json
{
  "prompts": [
    "Studio product photo of a white ceramic coffee mug on a light oak table, soft morning light, minimal background",
    "Flat lay of running shoes, a water bottle and earbuds on a pastel blue background, top-down, clean marketing photo",
    "Modern open-plan office with plants and large windows, people working at laptops, bright natural light, wide angle",
    "A cozy coffee shop storefront on a city street at dusk, warm lights in the windows, photorealistic",
    "Minimalist illustration of a rocket launching from a laptop screen, flat vector style, orange and navy colors"
  ],
  "width": 1024,
  "height": 1024,
  "imagesPerPrompt": 1,
  "format": "jpg"
}
```

# Actor output Schema

## `results` (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 = {
    "prompts": [
        "Studio product photo of a white ceramic coffee mug on a light oak table, soft morning light, minimal background",
        "Flat lay of running shoes, a water bottle and earbuds on a pastel blue background, top-down, clean marketing photo",
        "Modern open-plan office with plants and large windows, people working at laptops, bright natural light, wide angle",
        "A cozy coffee shop storefront on a city street at dusk, warm lights in the windows, photorealistic",
        "Minimalist illustration of a rocket launching from a laptop screen, flat vector style, orange and navy colors"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bulkleads/ai-image-generator-flux").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 = { "prompts": [
        "Studio product photo of a white ceramic coffee mug on a light oak table, soft morning light, minimal background",
        "Flat lay of running shoes, a water bottle and earbuds on a pastel blue background, top-down, clean marketing photo",
        "Modern open-plan office with plants and large windows, people working at laptops, bright natural light, wide angle",
        "A cozy coffee shop storefront on a city street at dusk, warm lights in the windows, photorealistic",
        "Minimalist illustration of a rocket launching from a laptop screen, flat vector style, orange and navy colors",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("bulkleads/ai-image-generator-flux").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 '{
  "prompts": [
    "Studio product photo of a white ceramic coffee mug on a light oak table, soft morning light, minimal background",
    "Flat lay of running shoes, a water bottle and earbuds on a pastel blue background, top-down, clean marketing photo",
    "Modern open-plan office with plants and large windows, people working at laptops, bright natural light, wide angle",
    "A cozy coffee shop storefront on a city street at dusk, warm lights in the windows, photorealistic",
    "Minimalist illustration of a rocket launching from a laptop screen, flat vector style, orange and navy colors"
  ]
}' |
apify call bulkleads/ai-image-generator-flux --silent --output-dataset

```

## MCP server setup

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

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/fNZwwq9IqFku0hUHv/builds/Why4p9Lv2YnIflyNN/openapi.json
