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 IDNotes
flux-pro-1.1General generation
flux-pro-1.1-ultraHigh resolution
flux-pro-1.0-fillInpainting / fill
flux-kontext-pro / flux-kontext-maxContext editing

See the BFL API docs for endpoint-specific fields.

On this page