AI Gateway

FLUX.1 Kontext Pro

bfl/flux-kontext-pro

FLUX.1 Kontext creates images from text prompts with unique capabilities for character consistency and advanced editing. It also edits images using simple text prompts. No complex workflows or fine-tuning needed. This provider gives the option to change the moderation level for inputs and outputs. The control is under safety tolerance and is by default 2 on a range from 0 (more strict) through 6 (more permissive).

index.ts
import { experimental_generateImage as generateImage } from 'ai';
const result = await generateImage({
model: 'bfl/flux-kontext-pro',
prompt: 'A red balloon on a wooden table.'
});