@imgly/plugin-ai-image-generation-web
Version:
AI image generation plugin for the CE.SDK editor
35 lines (34 loc) • 1.32 kB
TypeScript
import { CommonProviderConfiguration, type Provider } from '@imgly/plugin-ai-generation-web';
import CreativeEditorSDK from '@cesdk/cesdk-js';
import { type StyleId } from './Recraft20b.constants';
type Recraft20bOutput = {
kind: 'image';
url: string;
};
type Recraft20bInput = {
prompt: string;
image_size?: 'square_hd' | 'square' | 'portrait_4_3' | 'portrait_16_9' | 'landscape_4_3' | 'landscape_16_9' | {
width: number;
height: number;
};
style?: StyleId;
colors?: Array<{
r: number;
g: number;
b: number;
}>;
};
interface ProviderConfiguration extends CommonProviderConfiguration<Recraft20bInput, Recraft20bOutput> {
/**
* Base URL used for the UI assets used in the plugin.
*
* By default, we load the assets from the IMG.LY CDN You can copy the assets.
* from the `/assets` folder to your own server and set the base URL to your server.
*/
baseURL?: string;
}
export declare function Recraft20b(config: ProviderConfiguration): (context: {
cesdk: CreativeEditorSDK;
}) => Promise<Provider<'image', Recraft20bInput, Recraft20bOutput>>;
declare function getProvider(cesdk: CreativeEditorSDK, config: ProviderConfiguration): Provider<'image', Recraft20bInput, Recraft20bOutput>;
export default getProvider;