Frontier photorealism
It produces realistic lighting and physics that reduce the typical "AI look," making it strong for commercial-grade imagery.
Generate high-quality AI images with Black Forest Labs' Flux 2 Pro through one unified API. A single REST endpoint, async jobs, and webhooks, with no separate provider account to manage.
Integrate Flux 2 Pro with a single API call — one key, one unified endpoint, and shared billing across every model on Apiframe.
model: "flux-2-pro"
It produces realistic lighting and physics that reduce the typical "AI look," making it strong for commercial-grade imagery.
It can take up to 10 reference images at once and hold a consistent character, product, or style across every output.
A 32k-token context lets it follow long, detailed, multi-part prompts without losing the thread.
It renders clean, legible typography even at small sizes, which makes it dependable for posters, infographics, and UI.
The same model both creates images from text and edits existing ones at up to 4MP while preserving detail.
It generates in under 10 seconds with automatic prompt enhancement, at 6 credits ($0.06) per image at 1MP, scaling up to 14 credits ($0.14) at 4MP.
A few outputs generated through the Flux 2 Pro API on Apiframe.
Using these reference images of our mascot, show the same character waving, working at a desk, and holding a coffee cup, in a consistent style.
A photorealistic electric SUV on a coastal highway at golden hour, cinematic lighting, sharp reflections.
An event poster reading 'SUMMER SOUND FESTIVAL' with modern type, date and venue beneath, bold gradient background.
A matte black ceramic mug on sunlit marble, morning light through linen curtains, editorial product style.
Replace the plain background in this product photo with a soft studio gradient, keeping the product identical.
A cozy home office: wooden desk with a laptop, a steaming mug on the left, a potted monstera on the right, warm afternoon light.
Send a single POST /v2/images/generate request with your API key to
generate with Flux 2 Pro. The call returns a jobId you can poll or
receive via webhook.
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "flux-2-pro",
"fluxParams": {
"resolution": "2MP",
"image_prompt": "https://example.com/input.jpg",
"image_prompt_strength": 0.5,
"output_format": "jpg"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "flux-2-pro",
"fluxParams": {
"resolution": "2MP",
"image_prompt": "https://example.com/input.jpg",
"image_prompt_strength": 0.5,
"output_format": "jpg"
}
},
)
print(response.json()) # { "jobId": "...", "status": "QUEUED" }const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "a sleek silver sports car on a coastal highway at sunset, hyper-realistic",
"model": "flux-2-pro",
"fluxParams": {
"resolution": "2MP",
"image_prompt": "https://example.com/input.jpg",
"image_prompt_strength": 0.5,
"output_format": "jpg"
}
}),
});
const { jobId } = await response.json();
console.log(jobId);Generation is asynchronous. A successful submission returns 202 Accepted with a jobId. Poll GET /v2/jobs/{id} (or supply a webhook_url) until the status is COMPLETED; the result field then holds the output URL(s).
{
"jobId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"status": "QUEUED"
}curl https://api.apiframe.ai/v2/jobs/JOB_ID \
-H "X-API-Key: afk_your_api_key_here"import requests, time
while True:
job = requests.get(
"https://api.apiframe.ai/v2/jobs/JOB_ID",
headers={"X-API-Key": "afk_your_api_key_here"},
).json()
if job["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(job["result"])let job;
do {
await new Promise((r) => setTimeout(r, 2000));
job = await fetch("https://api.apiframe.ai/v2/jobs/JOB_ID", {
headers: { "X-API-Key": "afk_your_api_key_here" },
}).then((r) => r.json());
} while (job.status !== "COMPLETED" && job.status !== "FAILED");
console.log(job.result);Request parameters accepted by the Flux 2 Pro endpoint. Model-specific options are nested under the params object shown below.
| Parameter | Type | Required | Default | Allowed / range | Description |
|---|---|---|---|---|---|
| prompt | string | required | — | — | Text description of what to generate. |
| model | string | required | "flux-2-pro" | "flux-2-pro" | The model identifier for this endpoint. |
| fluxParams.resolution | string | optional | "2MP" | "0.5MP", "1MP", "2MP", "4MP" | Resolution |
| fluxParams.image_prompt | string (URL) | optional | — | — | Reference image (URL) |
| fluxParams.image_prompt_strength | number | optional | 0.5 | min 0, max 1, step 0.05 | How closely to follow the reference image (0–1). |
| fluxParams.output_format | string | optional | "jpg" | "jpg", "png", "webp" | Output format |
| fluxParams.output_quality | number | optional | 90 | min 0, max 100, step 1 | Output quality |
| fluxParams.prompt_upsampling | boolean | optional | false | — | Let the model rewrite your prompt for better quality. |
| fluxParams.seed | number | optional | — | step 1 | Reuse a number to reproduce the same result. |
Common questions about the Flux 2 Pro API.
No. On Apiframe it is a paid production model priced from 6 credits ($0.06) per image at 1MP up to 14 credits ($0.14) at 4MP, scaling with image size. The open-weight Dev variant is the free, local option.
Pro is the everyday production workhorse. Flex offers more control and typography quality at a higher price, Dev is the open-weight model for local use, and Klein is the fastest, lightest variant.
Up to 10 at once, for consistent characters, products, and styles.
Yes. It handles both text-to-image generation and image editing at up to 4MP in a single model.
Not Pro itself, but the open-weight Dev and Klein variants are built for local and on-device use.
Through Apiframe, as well as the BFL API and major hosting partners.
Still have questions?
Get your API key and integrate Flux 2 Pro in minutes — Pay-as-you-go.
Questions? Join our Discord or contact sales.