Member Junction
    Preparing search index...

    Black Forest Labs FLUX Image Generator implementation. Supports FLUX.2 Pro, FLUX 1.1 Pro, and other FLUX models via the BFL API.

    BFL uses an async task-based API:

    1. Submit generation request -> get task ID
    2. Poll for result until ready
    3. Retrieve generated image URL

    A request's CancellationToken is handed to every fetch (submit, poll and download), and the wait between polls ends as soon as it aborts, so cancelling a request stops it at once. The call then resolves as cancelled, never as a failure to fail over.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get apiKey(): string

      Only sub-classes can access the API key

      Returns string

    Methods

    • The result for a request its CancellationToken ended, before or during the provider call. A caller cancellation is classified Cancelled, Fatal and never failed over; an abort caused by a timeout reads as a retriable network error.

      Parameters

      • signal: AbortSignal

        The request's cancellation signal, read for why it was aborted.

      • Optionalerror: unknown

        The error the abort raised, if any.

      Returns ImageGenerationResult

    • Helper method to convert image input (Buffer, base64, or URL) to the format required by the specific provider. Subclasses can override as needed.

      Parameters

      • input: string | Buffer<ArrayBufferLike>

        Image as Buffer, base64 string, or URL

      Returns Promise<{ base64: string; buffer: Buffer }>

      Normalized image data

    • Configure polling behavior for async task completion

      Parameters

      • config: Partial<BFLPollingConfig>

      Returns void