UNPKG

@imgly/plugin-ai-image-generation-web

Version:

AI image generation plugin for the CE.SDK editor

37 lines (36 loc) 1.32 kB
import { type OpenAPIV3 } from 'openapi-types'; import CreativeEditorSDK, { CreativeEngine } from '@cesdk/cesdk-js'; import { ImageOutput, RenderCustomProperty, GetBlockInput, Provider, QuickAction, Middleware } from '@imgly/plugin-ai-generation-web'; type ImageProviderConfiguration = { proxyUrl: string; debug?: boolean; }; /** * Creates a base provider from schema. This should work out of the box * but may be rough around the edges and should/can be further customized. */ declare function createImageProvider<I extends Record<string, any>>(options: { modelKey: string; name?: string; schema: OpenAPIV3.Document; inputReference: string; useFlow?: 'placeholder' | 'generation-only'; initialize?: (context: { cesdk?: CreativeEditorSDK; engine: CreativeEngine; }) => void; renderCustomProperty?: RenderCustomProperty; quickActions?: QuickAction<I, ImageOutput>[]; getBlockInput?: GetBlockInput<'image', I>; getImageSize?: (input: I) => { width: number; height: number; }; middleware?: Middleware<I, ImageOutput>[]; headers?: Record<string, string>; cesdk?: CreativeEditorSDK; }, config: ImageProviderConfiguration): Provider<'image', I, { kind: 'image'; url: string; }>; export default createImageProvider;