langchain.js
    Preparing search index...

    Interface ImageGenerationOptions

    Options for the Image Generation tool.

    interface ImageGenerationOptions {
        background?: "auto" | "transparent" | "opaque";
        inputFidelity?: "low" | "high";
        inputImageMask?: ImageGenerationInputMask;
        model?: "gpt-image-1" | "gpt-image-1-mini";
        moderation?: "low" | "auto";
        outputCompression?: number;
        outputFormat?: "png" | "webp" | "jpeg";
        partialImages?: number;
        quality?: "low" | "medium" | "high" | "auto";
        size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
    }
    Index

    Properties

    background?: "auto" | "transparent" | "opaque"

    Background type for the generated image.

    • transparent: Generate image with transparent background
    • opaque: Generate image with opaque background
    • auto: Let the model decide based on the prompt
    "auto"
    
    inputFidelity?: "low" | "high"

    Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for gpt-image-1. Unsupported for gpt-image-1-mini.

    • high: Higher fidelity to input images
    • low: Lower fidelity to input images
    "low"
    
    inputImageMask?: ImageGenerationInputMask

    Optional mask for inpainting. Use this to specify areas of an image that should be regenerated.

    model?: "gpt-image-1" | "gpt-image-1-mini"

    The image generation model to use.

    "gpt-image-1"
    
    moderation?: "low" | "auto"

    Moderation level for the generated image.

    • auto: Standard moderation
    • low: Less restrictive moderation
    "auto"
    
    outputCompression?: number

    Compression level for the output image (0-100). Only applies to JPEG and WebP formats.

    100
    
    outputFormat?: "png" | "webp" | "jpeg"

    The output format of the generated image.

    "png"
    
    partialImages?: number

    Number of partial images to generate in streaming mode (0-3). When set, the model will return partial images as they are generated, providing faster visual feedback.

    0
    
    quality?: "low" | "medium" | "high" | "auto"

    The quality of the generated image.

    • low: Faster generation, lower quality
    • medium: Balanced generation time and quality
    • high: Slower generation, higher quality
    • auto: Let the model decide based on the prompt
    "auto"
    
    size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024"

    The size of the generated image.

    • 1024x1024: Square format
    • 1024x1536: Portrait format
    • 1536x1024: Landscape format
    • auto: Let the model decide based on the prompt
    "auto"