Skip to content

BlackForestLabsImageModel

Namespace: Vercel.AI.BlackForestLabs

public sealed class BlackForestLabsImageModel : IImageModel, IImageCaller

Black Forest Labs image model. It submits the request, polls polling_url until the task is Ready, then downloads the sample. Model ids pick the legacy, FLUX 3, or latest image API.

Inheritance: object

Implements: IImageModel, IImageCaller

View source

BlackForestLabsImageModel(BlackForestLabsProvider, string, Func<DateTimeOffset>?)

Section titled “BlackForestLabsImageModel(BlackForestLabsProvider, string, Func<DateTimeOffset>?)”
public BlackForestLabsImageModel(BlackForestLabsProvider provider, string modelId, Func<DateTimeOffset>? clock = null)

Creates a model. <code class=“paramref”>clock</code> sets the response timestamp.

Parameters

Name Type Description
provider BlackForestLabsProvider
modelId string
clock Func<DateTimeOffset>

View source

public int? MaxImagesPerCall { get; }

Black Forest Labs returns one image per call.

Value: int?

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

public string SpecificationVersion { get; }

Specification version. Always V4.

Value: string

View source

public bool? SupportsFileInputs { get; }

True when the model takes input images, false when it does not, null when unknown.

Value: bool?

View source

public bool? SupportsMaskInputs { get; }

True when the model takes a mask, false when it does not, null when unknown.

Value: bool?

View source

DoGenerateAsync(ImageModelCall, CancellationToken)

Section titled “DoGenerateAsync(ImageModelCall, CancellationToken)”
public Task<ImageModelResult> DoGenerateAsync(ImageModelCall call, CancellationToken cancellationToken)

Generates images.

Parameters

Name Type Description
call ImageModelCall
cancellationToken CancellationToken

Returns: Task<ImageModelResult>

View source

DoGenerateAsync(ImageCallOptions, CancellationToken)

Section titled “DoGenerateAsync(ImageCallOptions, CancellationToken)”
public Task<ImageGenerationResult> DoGenerateAsync(ImageCallOptions options, CancellationToken cancellationToken)

Generates images. Maps to doGenerate on an image model.

Parameters

Name Type Description
options ImageCallOptions
cancellationToken CancellationToken

Returns: Task<ImageGenerationResult>

View source

ResolveMaxImagesPerCallAsync(CancellationToken)

Section titled “ResolveMaxImagesPerCallAsync(CancellationToken)”
public Task<int?> ResolveMaxImagesPerCallAsync(CancellationToken cancellationToken)

Resolves a functional per-call limit. The default returns MaxImagesPerCall.

Parameters

Name Type Description
cancellationToken CancellationToken

Returns: Task<int?>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product