import { default as OpenAI } from 'openai'; import { RequestOptions } from 'openai/core'; import { APIResource } from '../../resource'; export declare class Images extends APIResource { /** * Creates an image given a prompt. */ generate(params: ImageGenerateParams, options?: RequestOptions): Promise; protected waitTask(taskId: string, options?: RequestOptions): Promise; } declare namespace ImageTask { type Image = { url: string; }; type FailedError = { code: string; message: string; }; type Status = 'PENDING' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'UNKNOWN'; type Metrics = { TOTAL: number; SUCCEEDED: number; FAILED: number; }; } export type ImageModel = Images.ImageModel; export type ImageGenerateParams = Images.ImageGenerateParams; export declare namespace Images { type ImageModel = (string & NonNullable) | 'wanx-v1' | 'stable-diffusion-v1.5' | 'stable-diffusion-xl'; interface ImageGenerateParams { /** * The model to use for image generation. * * @defaultValue wanx-v1 */ model?: ImageModel | null; /** * A prompt is the text input that guides the AI in generating visual content. * It defines the textual description or concept for the image you wish to generate. * Think of it as the creative vision you want the AI to bring to life. * Crafting clear and creative prompts is crucial for achieving the desired results with Imagine's API. * For example, A serene forest with a river under the moonlight, can be a prompt. */ prompt: string; /** * The negative_prompt parameter empowers you to provide additional * guidance to the AI by specifying what you don't want in the image. * It helps refine the creative direction, ensuring that the generated * content aligns with your intentions. */ negative_prompt?: string | null; /** * The size of the generated images. * * @defaultValue 1024*1024 */ size?: (string & NonNullable) | '1024*1024' | null; /** * The style of the generated images. * * - \ 摄影 * - \ 人像写真 * - \<3d cartoon\> 3D卡通 * - \ 动画 * - \ 油画 * - \水彩 * - \ 素描 * - \ 中国画 * - \ 扁平插画 * - \ 默认 * * 仅 wanx-v1 模型支持 * * @defaultValue */ style?: '' | '' | '<3d cartoon>' | '' | '' | '' | '' | '' | '' | '' | null; /** * The number of images to generate. Must be between 1 and 4. * * @defaultValue 1 */ n?: number | null; /** * The steps parameter defines the number of operations or iterations that the * generator will perform during image creation. It can impact the complexity * and detail of the generated image. * * Range: 30-50 * * 仅 StableDiffusion 模型支持 * * @defaultValue 40 */ steps?: number | null; /** * The cfg parameter acts as a creative control knob. * You can adjust it to fine-tune the level of artistic innovation in the image. * Lower values encourage faithful execution of the prompt, * while higher values introduce more creative and imaginative variations. * * Range: 1 - 15 * * @defaultValue 10 */ cfg?: number | null; /** * The seed parameter serves as the initial value for the random number generator. * By setting a specific seed value, you can ensure that the AI generates the same * image or outcome each time you use that exact seed. * * range: 1-Infinity */ seed?: number | null; /** * The format in which the generated images are returned. */ response_format?: 'url' | null; } } export {};