Black Forest Labs
FLUX image generation with async polling.
BlackForestLabsImageModel conforms to ImageModel and works with
generateImage. It reads BFL_API_KEY
(sent as the x-key header) and uses https://api.bfl.ai/v1.
let result = try await generateImage(
model: BlackForestLabsImageModel("flux-pro-1.1"),
prompt: "A tiny observatory on a snowy mountain",
size: "1024x768"
)The model submits the job, polls until the render is Ready, then downloads
the result. size maps to width/height, aspectRatio to aspect_ratio,
and extra fields go under the black-forest-labs provider key. Tune polling
with pollInterval: and pollTimeout:.
Models
As of July 2026:
| Model ID | Notes |
|---|---|
flux-pro-1.1 | General generation |
flux-pro-1.1-ultra | High resolution |
flux-pro-1.0-fill | Inpainting / fill |
flux-kontext-pro / flux-kontext-max | Context editing |
See the BFL API docs for endpoint-specific fields.