Member Junction
    Preparing search index...

    Class BaseImageGeneratorAbstract

    Base class for all image generation models. Each AI provider will have a sub-class implementing the abstract methods. Not all sub-classes will support all methods - use GetSupportedMethods() to determine what methods are available for a specific provider.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    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

    • Get the list of methods supported by this provider. Use this to check capabilities before calling methods that may not be implemented.

      Returns Promise<string[]>

      Array of supported method names

    • 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