Skip to main content
black-forest-labs avatar

FLUX.2 [pro] API

Generate production-grade images from a text prompt with maximum fidelity and top prompt adherence, no tuning knobs required.

Priced by megapixels

Model Input

Input

The text prompt describing the image to generate.

The size of the generated image. Use a preset string (e.g. 'landscape_16_9') or a custom {width, height} object.

Additional Settings

Customize your input with more control.

The same seed and the same prompt given to the same version of the model will output the same image every time.

The safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive.

Safety checker can only be disabled on API call

The format of the generated image.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Generated image output
Generated in 8.231 seconds
Logs (1 lines)

Model Example Requests

Examples

Example output 1Example output 2Example output 3Example output 4Example output 5

Model Pricing

Pricing

Model pricing varies by the megapixel count of your output image.

Up to 1 MP
$0.0300
per megapixel of image
or around 33 megapixels for $1
Up to 2 MP
$0.0450
per megapixel of image
or around 22 megapixels for $1
Up to 3 MP
$0.0600
per megapixel of image
or around 17 megapixels for $1
Up to 4 MP
$0.0750
per megapixel of image
or around 13 megapixels for $1
Up to 5 MP
$0.0900
per megapixel of image
or around 11 megapixels for $1

FLUX.2 [pro] API

FLUX.2 [pro] is a text-to-image AI model by black-forest-labs. On ModelRunner it runs through a REST API or via MCP from any AI assistant with pay-per-use pricing.

POST https://queue.modelrunner.run/black-forest-labs/flux-2/pro

cURL

# Submit a request to the queue
curl -X POST https://queue.modelrunner.run/black-forest-labs/flux-2/pro \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "An architectural magazine photograph of a minimalist concrete cliffside villa at golden hour, floor-to-ceiling glass …",
      "image_size": "landscape_16_9",
      "output_format": "jpeg",
      "safety_tolerance": "2",
      "enable_safety_checker": true
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/black-forest-labs/flux-2/pro/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/black-forest-labs/flux-2/pro/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("black-forest-labs/flux-2/pro", {
  input: {
    "prompt": "An architectural magazine photograph of a minimalist concrete cliffside villa at golden hour, floor-to-ceiling glass …",
    "image_size": "landscape_16_9",
    "output_format": "jpeg",
    "safety_tolerance": "2",
    "enable_safety_checker": true
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/black-forest-labs/flux-2/pro",
    headers=headers,
    json={"input": {
      "prompt": "An architectural magazine photograph of a minimalist concrete cliffside villa at golden hour, floor-to-ceiling glass …",
      "image_size": "landscape_16_9",
      "output_format": "jpeg",
      "safety_tolerance": "2",
      "enable_safety_checker": true
    }},
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
promptstringyesThe text prompt describing the image to generate.
image_sizeenumnoThe size of the generated image. Use a preset string (e.g. 'landscape_16_9') or a custom {width, height} object. Default: "landscape_4_3".
seedintegernoThe same seed and the same prompt given to the same version of the model will output the same image every time.
safety_toleranceenumnoThe safety tolerance level for the generated image. 1 being the most strict and 5 being the most permissive. Default: "2".
enable_safety_checkerbooleannoIf set to true, the safety checker will be enabled. Default: true.
output_formatenumnoThe format of the generated image. Default: "jpeg".

Machine-readable: OpenAPI schema · llms.txt

Use FLUX.2 [pro] from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and FLUX.2 [pro] becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint black-forest-labs/flux-2/pro.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run black-forest-labs/flux-2/pro on ModelRunner to generate image”. MCP setup guide.

Model Details

Model Details

FLUX.2 [pro] turns a text prompt into a production-grade image from Black Forest Labs. It is the top FLUX.2 tier, built for maximum fidelity, photorealism, and prompt adherence with a fixed, tuned pipeline — you write the prompt and pick a size, and it handles the rest. There are no guidance, step-count, or acceleration knobs to tune: the model targets consistent, high-quality output straight from the description, which makes it a strong default for final assets, brand-consistent visuals, and high-volume production pipelines rather than throwaway drafts.

## Best for - Final, production-quality images where fidelity and prompt adherence matter more than cost per image - Photorealistic scenes, product and editorial shots, and detailed illustrations from a single description - High-volume and API-driven generation where a fixed pipeline gives consistent results across prompts - Brand-consistent marketing and campaign visuals that need to look polished on the first pass

## Choose another model when - You want fast, cheap iteration and are happy to trade some fidelity — use FLUX.2 [dev] (`black-forest-labs/flux-2`), which is lower cost and exposes guidance/step/acceleration knobs for experimentation - You want to edit, restyle, or modify an existing image rather than generate one from scratch — use an image-editing / image-to-image model - You want video or animation from your prompt — use a text-to-video model

## Tips - Be specific about subject, composition, lighting, and style; [pro] follows detailed prompts closely - Pick `image_size` to match the layout: `landscape_16_9` or `landscape_4_3` for wide scenes, `portrait_4_3` / `portrait_16_9` for vertical, `square` / `square_hd` for social, or pass a custom `{width, height}` object - `safety_tolerance` runs from `"1"` (most strict) to `"5"` (most permissive), default `"2"`; raise it only if benign prompts are being blocked

To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("black-forest-labs/flux-2/pro", { input: { prompt: "a serene mountain lake at golden hour, mist over the water, photorealistic", image_size: "landscape_4_3", output_format: "jpeg", }, }); ```