Initialize the provider with API credentials and optional configuration.
Configuration object. Must include apiKey.
If apiKey is missing or empty.
await provider.initialize({ apiKey: 'bfl_xxx' });
Generate an image using the BFL Flux API.
Submits the generation task, then polls until the result is ready or the timeout is reached.
Image generation request with prompt and optional params.
The generated image result with URL(s).
If the provider is not initialized.
If the API returns an error or times out.
const result = await provider.generateImage({
modelId: 'flux-pro-1.1',
prompt: 'A serene Japanese garden in autumn',
size: '1024x768',
});
List available Flux models on the BFL API.
Static list of known BFL model identifiers.
Readonly providerOptional default
Image generation provider connecting directly to the Black Forest Labs (BFL) API for Flux model access.
Implements the async submit-then-poll pattern: a generation request returns a task ID immediately, and the provider polls until the image is ready or a timeout is reached.
Implements
Example