FLUX.2 API

FLUX 2 is the next-generation text-to-image model from Black Forest Labs with improved quality and prompt adherence.

Modalities
TextImage
Price
$0.012per Megapixel
Model type
Image generation
Released
Nov 26, 2025

FLUX.2 overview

Sample FLUX.2 image generated through AI/ML API: A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lette

FLUX.2 by Black Forest Labs

FLUX.2 is an advanced text-to-image generative model developed by Black Forest Labs.

FLUX.2 specs

Model ID
flux-2
Developer
Black Forest Labs
Input
Text
Output
Image
Endpoint
POST https://api.aimlapi.com/v1/images/generations

What Is Flux 2?

Flux 2 is a professional visual foundation model from Black Forest Labs that combines a powerful vision‑language backbone with a rectified flow transformer to understand both world knowledge and fine‑grained spatial relationships. It is designed to handle text‑to‑image, image‑to‑image, and complex editing inside one architecture, simplifying pipelines for teams that previously juggled multiple models.​

Core Capabilities

  • Generates photorealistic images and detailed illustrations at resolutions up to roughly 4 megapixels, suitable for print, product pages, and high‑impact advertising.​
  • Natively supports infographics, UI mockups, and complex typography, delivering clean, readable on‑image text and multi‑language layouts.​
  • Handles both new image creation from prompts and transformation of existing assets with the same underlying model, streamlining integration and QA

Architecture Highlights

  • Built on a latent flow‑matching approach that improves learnability and image quality while maintaining strong compression for practical deployment.​
  • Couples a large vision‑language model (Mistral‑3 24B class) with a rectified flow transformer to capture semantics, materials, lighting, and composition more reliably than earlier diffusion systems.​
  • Retrained latent space from scratch to push past the typical “quality vs. compression vs. learnability” trade‑off, resulting in sharper details and more faithful prompt adherence.

Performance Benchmarks

  • Outperforms all other open-weight alternatives in text-to-image generation and image editing tasks.
  • Achieves photorealistic detail, stable lighting, and texture sharpness on par with professional closed-source models.

Flux 2 API For Image Generation

By interpreting narrative intent, motion cues, and stylistic direction directly from text, the model generates videos that feel purposeful rather than procedural. Scenes evolve naturally, transitions remain consistent, and visual identity is preserved from the first frame to the last.

Prompt Adherence & Visual Quality

  • Interprets complex prompts that specify camera angle, lens, materials, mood, and composition, keeping scenes coherent even at high detail.​
  • Produces realistic lighting and physics that avoid the typical “AI look,” with accurate perspective, spatial reasoning, and object placement.​
  • Supports exact color targeting (including HEX codes) so brand palettes and UI themes are reproduced consistently across large batches.

Use cases

  • Product mockups requiring precise text and visual detail
  • Marketing and branding materials with strict adherence to typography and style
  • UI/UX design and infographic generation with high fidelity text rendering
  • Creative workflows needing flexible output control with cost efficiency
  • Research and development via open-weight models for experimentation in image generation and editing

FLUX.2 API pricing

FLUX.2 pricing in US dollars
UsagePriceUnit
Image generation$0.012per Megapixel

The final price depends on request parameters such as resolution or duration.

Prices from the AI/ML API price list, checked on Nov 4, 2026.

FLUX.2 vs other image models: prices

AI/ML API rates for 5 models, per Megapixel.

AI/ML API prices in USD per Megapixel
ModelPer Megapixel
FLUX.2$0.012
FLUX.2 Klein 4B$0.014
FLUX.2 Klein 9B$0.015
FLUX.2 Klein 9B Preview$0.015
FLUX.2 Flex$0.05

How to use the FLUX.2 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/images/generations' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "flux-2",
  "prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo."
}'

Related articles

All posts

FLUX.2 FAQ

What inputs and outputs does FLUX.2 support?

FLUX.2 takes image, text as input and returns image.

How much does FLUX.2 cost?

FLUX.2 costs $0.012 per Megapixel on AI/ML API, billed as you go with no subscription.

How is FLUX.2 billed?

FLUX.2 is billed per generation, a fixed charge per output rather than by prompt length.

Can FLUX.2 take an existing image as input?

Yes, FLUX.2 accepts image input as well as a text prompt.

Who created FLUX.2?

FLUX.2 was built by Black Forest Labs.

How do I call FLUX.2 on AI/ML API?

Send a request to https://api.aimlapi.com/v1/images/generations with flux-2 as the model id.

Is FLUX.2 available through a single API key?

Yes. FLUX.2 is served through AI/ML API, so the same key and endpoint format used for other models applies.

What is FLUX.2's API endpoint?

FLUX.2 is accessed via https://api.aimlapi.com/v1/images/generations.

What is the FLUX.2 model ID?

Use flux-2 as the model parameter. Requests go to https://api.aimlapi.com/v1/images/generations with your AI/ML API key.

Start building with FLUX.2

FLUX.2 API

flux-2

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/images/generations' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "flux-2",
  "prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo."
}'