51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import type { AuthProfileStore } from "../agents/auth-profiles.js";
|
|
import type { OpenClawConfig } from "../config/config.js";
|
|
|
|
export type GeneratedImageAsset = {
|
|
buffer: Buffer;
|
|
mimeType: string;
|
|
fileName?: string;
|
|
revisedPrompt?: string;
|
|
metadata?: Record<string, unknown>;
|
|
};
|
|
|
|
export type ImageGenerationResolution = "1K" | "2K" | "4K";
|
|
|
|
export type ImageGenerationSourceImage = {
|
|
buffer: Buffer;
|
|
mimeType: string;
|
|
fileName?: string;
|
|
metadata?: Record<string, unknown>;
|
|
};
|
|
|
|
export type ImageGenerationRequest = {
|
|
provider: string;
|
|
model: string;
|
|
prompt: string;
|
|
cfg: OpenClawConfig;
|
|
agentDir?: string;
|
|
authStore?: AuthProfileStore;
|
|
count?: number;
|
|
size?: string;
|
|
resolution?: ImageGenerationResolution;
|
|
inputImages?: ImageGenerationSourceImage[];
|
|
};
|
|
|
|
export type ImageGenerationResult = {
|
|
images: GeneratedImageAsset[];
|
|
model?: string;
|
|
metadata?: Record<string, unknown>;
|
|
};
|
|
|
|
export type ImageGenerationProvider = {
|
|
id: string;
|
|
aliases?: string[];
|
|
label?: string;
|
|
defaultModel?: string;
|
|
models?: string[];
|
|
supportedSizes?: string[];
|
|
supportedResolutions?: ImageGenerationResolution[];
|
|
supportsImageEditing?: boolean;
|
|
generateImage: (req: ImageGenerationRequest) => Promise<ImageGenerationResult>;
|
|
};
|