Class OpenAIImageProvider

Implements

Constructors

Methods

  • Restyles an image after a style reference through /v1/images/edits, which takes "up to 16 images" for the GPT Image models (openai-node, src/resources/images.ts): the source and the reference go as two image[] parts, the source first, with an instruction that names them.

    The endpoint has no strength, seed or negative prompt: strength picks the instruction (see styleTransfer.ts), and the others are not sent. Before the request, the images are checked to be PNG, WebP or JPEG files under 50 MB each, and the prompt as sent to be at most 32,000 characters.

    Parameters

    Returns Promise<ImageGenerationResult>

    Generation result with the restyled image(s).

    Throws

    When the provider is not initialised, the model, an image or the prompt is refused, the API returns an HTTP error status, or the answer holds no image.

Properties

providerId: "openai" = 'openai'
isInitialized: boolean = false
defaultModelId?: string