@n8n/n8n-nodes-langchain
Version:

88 lines (83 loc) • 2.98 kB
text/typescript
/**
* OpenAI Node - Version 2.1
* Discriminator: resource=image, operation=generate
*/
interface Credentials {
openAiApi: CredentialReference;
}
/** Creates audio from a text prompt */
export type LcOpenAiV21ImageGenerateParams = {
resource: 'image';
operation: 'generate';
/**
* The model to use for image generation
* @default dall-e-3
*/
model?: 'dall-e-2' | 'dall-e-3' | 'gpt-image-1' | Expression<string>;
/**
* A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
*/
prompt?: string | Expression<string> | PlaceholderValue;
/**
* Options
* @default {}
*/
options?: {
/** Number of images to generate
* @displayOptions.show { /model: ["dall-e-2"] }
* @default 1
*/
n?: number | Expression<number>;
/** The quality of the image that will be generated, HD creates images with finer details and greater consistency across the image
* @displayOptions.show { /model: ["dall-e-3"] }
* @default standard
*/
dalleQuality?: 'hd' | 'standard' | Expression<string>;
/** The quality of the image that will be generated, High creates images with finer details and greater consistency across the image
* @displayOptions.show { /model: [{"_cnd":{"includes":"gpt-image"}}] }
* @default medium
*/
quality?: 'high' | 'medium' | 'low' | Expression<string>;
/** Resolution
* @displayOptions.show { /model: ["dall-e-2"] }
* @default 1024x1024
*/
size?: '256x256' | '512x512' | '1024x1024' | Expression<string>;
/** Resolution
* @displayOptions.show { /model: ["dall-e-3"] }
* @default 1024x1024
*/
size?: '1024x1024' | '1792x1024' | '1024x1792' | Expression<string>;
/** Resolution
* @displayOptions.show { /model: [{"_cnd":{"includes":"gpt-image"}}] }
* @default 1024x1024
*/
size?: '1024x1024' | '1024x1536' | '1536x1024' | Expression<string>;
/** Style
* @displayOptions.show { /model: ["dall-e-3"] }
* @default vivid
*/
style?: 'natural' | 'vivid' | Expression<string>;
/** Whether to return image URL(s) instead of binary file(s)
* @displayOptions.hide { /model: [{"_cnd":{"includes":"gpt-image"}}] }
* @default false
*/
returnImageUrls?: boolean | Expression<boolean>;
/** Put Output in Field
* @hint The name of the output field to put the binary file data in
* @displayOptions.show { returnImageUrls: [false] }
* @default data
*/
binaryPropertyOutput?: string | Expression<string> | PlaceholderValue;
};
};
export interface LcOpenAiV21ImageGenerateSubnodeConfig {
tools?: ToolInstance[];
memory?: MemoryInstance;
}
export type LcOpenAiV21ImageGenerateNode = {
type: '@n8n/n8n-nodes-langchain.openAi';
version: 2.1;
credentials?: Credentials;
config: NodeConfig<LcOpenAiV21ImageGenerateParams> & { subnodes?: LcOpenAiV21ImageGenerateSubnodeConfig };
};