We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Black Forest Labs: FLUX.2 Max
black-forest-labs/flux.2-maxTry Black Forest Labs: FLUX.2 Max now
Runs on your balance at the prices above. New accounts start with free usage.
Settings
Black Forest Labs: FLUX.2 Max at a glance
- Context window of 46,864 tokens, enough for long documents and multi-turn conversations.
About Black Forest Labs: FLUX.2 Max
FLUX.2 Max is an image generation model from Black Forest Labs, the lab behind the FLUX family of image models. It sits at the top tier of that family, positioned by the provider as its highest level of image quality, prompt understanding and editing consistency. On api14 it appears under the model id black-forest-labs/flux.2-max and is listed in the image category.
The model accepts text and image inputs and produces image output. Its context window is 46,864 tokens, with a maximum output of 42,177. Generation is controlled through image parameters rather than a broad set of sampling options: aspect_ratio accepts one of 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9 or auto; output_format accepts png or jpeg; and n has a fixed range of 1 to 1, so each request returns a single image. The model also accepts up to 8 input references, which is what makes image-to-image work and editing against supplied images possible, and seed is exposed as a boolean parameter.
Those capabilities point to a fairly specific set of uses. Text to image generation covers the usual product, editorial and concept work where you describe a scene and pick an aspect ratio to match the placement. Because image inputs are supported alongside text, the model also fits editing and reference driven workflows: passing one or more of the up to 8 input references lets you steer a generation toward an existing image, restyle it, or keep a subject consistent across outputs. The aspect ratio list covers square, portrait, landscape, wide and ultra wide framing, so assets can be generated close to their final crop instead of being cut down afterwards. The choice between png and jpeg is useful when you need either lossless output or smaller files.
You call it through api14's OpenAI-compatible API using the model id black-forest-labs/flux.2-max. Requests follow the same shape as other models on the gateway, with the model id in the request and your prompt as input. The parameters the model supports are seed, plus the image parameters aspect_ratio, output_format, n and input_references. Aspect ratio and output format are enums with the values listed above, n is fixed at 1, input_references takes between 0 and 8 images, and seed is a boolean.
A few constraints are worth noting before you commit. Output is image only, so if you need text back from the same call, this is not the model for that. Each request returns exactly one image, so batches have to be issued as separate calls. If your task is text generation, classification or anything that does not end in an image, a text model on api14 will fit better.
How to call the Black Forest Labs: FLUX.2 Max API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "black-forest-labs/flux.2-max".
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.images.generate({
"model": "black-forest-labs/flux.2-max",
"prompt": "A minimalist product photo of a ceramic mug on a wooden table",
"n": 1,
"aspect_ratio": "1:1"
});
import { writeFile } from "node:fs/promises";
await writeFile("image.png", Buffer.from(result.data[0].b64_json, "base64"));
Supported parameters
seedSpecifications
- Context length
- 46,864
- Max output
- 42,177
- Input
- text, image
- Output
- image
Requests on api14 · last 7 days
Black Forest Labs: FLUX.2 Max: frequently asked questions
- How much does the Black Forest Labs: FLUX.2 Max API cost?
- Black Forest Labs: FLUX.2 Max costs Image output $0.25 / megapixel. It is charged from your USD balance only for successful requests; failed requests are free.
- What is the context window of Black Forest Labs: FLUX.2 Max?
- Black Forest Labs: FLUX.2 Max reads up to 46,864 tokens per request: prompt, history and documents together. It writes up to 42,177 output tokens per response.
- What can Black Forest Labs: FLUX.2 Max do?
- Black Forest Labs: FLUX.2 Max accepts text, image and returns image.
- How do I call Black Forest Labs: FLUX.2 Max from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "black-forest-labs/flux.2-max". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Black Forest Labs: FLUX.2 Max?
- Comparable Image models at a similar price: SpaceXAI: Grok Imagine Image Quality, Black Forest Labs: FLUX.2 Flex, Recraft: Recraft V4.1 Vector. Each runs through the same API key, so switching is one string.
Black Forest Labs: FLUX.2 Max community
New topicThis community has no topics yet. Open the first one about Black Forest Labs: FLUX.2 Max.