/**
 * OpenAI Node - Version 2.2
 * Discriminator: resource=image, operation=edit
 */


interface Credentials {
  openAiApi: CredentialReference;
}

/** Edit an image */
export type LcOpenAiV22ImageEditParams = {
  resource: 'image';
  operation: 'edit';
/**
 * The model to use for image generation
 * @default gpt-image-1
 */
    model?: 'dall-e-2' | 'gpt-image-1' | Expression<string>;
/**
 * A text description of the desired image(s). Maximum 1000 characters for dall-e-2, 32000 characters for gpt-image-1.
 */
    prompt: string | Expression<string>;
/**
 * Add one or more binary fields to include images with your prompt. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images.
 * @displayOptions.show { /model: ["gpt-image-1"], /modelId: [{"_cnd":{"includes":"gpt-image"}}] }
 * @default {"values":[{"binaryPropertyName":"data"}]}
 */
    images?: {
        /** Image
     */
    values?: Array<{
      /** The name of the binary field containing the image data
       * @default data
       */
      binaryPropertyName?: string | Expression<string>;
    }>;
  };
/**
 * Name of the binary property which contains the image. It should be a square png file less than 4MB.
 * @hint The name of the input field containing the binary file data to be processed
 * @displayOptions.show { /model: ["dall-e-2"], /modelId: [{"_cnd":{"includes":"dall-e"}}] }
 * @default data
 */
    binaryPropertyName?: string | Expression<string>;
/**
 * The number of images to generate. Must be between 1 and 10.
 * @default 1
 */
    n?: number | Expression<number>;
/**
 * The size of the generated images
 * @default 1024x1024
 */
    size?: '256x256' | '512x512' | '1024x1024' | '1024x1536' | '1536x1024' | 'auto' | Expression<string>;
/**
 * The quality of the image that will be generated
 * @displayOptions.show { /model: ["gpt-image-1"], /modelId: [{"_cnd":{"includes":"gpt-image"}}] }
 * @default auto
 */
    quality?: 'auto' | 'high' | 'medium' | 'low' | 'standard' | Expression<string>;
/**
 * The format in which the generated images are returned. URLs are only valid for 60 minutes after generation.
 * @displayOptions.show { /model: ["dall-e-2"], /modelId: [{"_cnd":{"includes":"dall-e"}}] }
 * @default url
 */
    responseFormat?: 'url' | 'b64_json' | Expression<string>;
/**
 * The format in which the generated images are returned. Only supported for gpt-image-1.
 * @displayOptions.show { /model: ["gpt-image-1"], /modelId: [{"_cnd":{"includes":"gpt-image"}}] }
 * @default png
 */
    outputFormat?: 'png' | 'jpeg' | 'webp' | Expression<string>;
/**
 * The compression level (0-100%) for the generated images. Only supported for gpt-image-1 with webp or jpeg output formats.
 * @displayOptions.show { /model: ["gpt-image-1"], outputFormat: ["webp", "jpeg"], /modelId: [{"_cnd":{"includes":"gpt-image"}}] }
 * @default 100
 */
    outputCompression?: number | Expression<number>;
/**
 * Options
 * @default {}
 */
    options?: {
    /** A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse
     */
    user?: string | Expression<string>;
    /** Allows to set transparency for the background of the generated image(s). Only supported for gpt-image-1.
     * @displayOptions.show { /model: ["gpt-image-1"] }
     * @default auto
     */
    background?: 'auto' | 'transparent' | 'opaque' | Expression<string>;
    /** Control how much effort the model will exert to match the style and features of input images. Only supported for gpt-image-1.
     * @displayOptions.show { /model: ["gpt-image-1"] }
     * @default low
     */
    inputFidelity?: 'low' | 'high' | Expression<string>;
    /** Name of the binary property which contains the image. An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.
     * @hint The name of the input field containing the binary file data to be processed
     * @default data
     */
    imageMask?: string | Expression<string>;
  };
};

export interface LcOpenAiV22ImageEditSubnodeConfig {
  tools?: ToolInstance[];
  memory?: MemoryInstance;
}

export type LcOpenAiV22ImageEditNode = {
  type: '@n8n/n8n-nodes-langchain.openAi';
  version: 2.2;
  credentials?: Credentials;
  isTrigger: true;
  config: NodeConfig<LcOpenAiV22ImageEditParams> & { subnodes?: LcOpenAiV22ImageEditSubnodeConfig };
};