/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow } from "@workglow/task-graph"; import type { ImageValue, WithImageValuePorts } from "@workglow/util/media"; import type { DataPortSchema } from "@workglow/util/schema"; import type { ModelConfig } from "../../model/ModelSchema"; import type { AiImageOutput } from "../base/AiImageOutputTask"; import { AiImageOutputTask } from "../base/AiImageOutputTask"; export declare const ImageEditInputSchema: { readonly type: "object"; readonly properties: { readonly aspectRatio: { readonly type: "string"; readonly title: "Aspect Ratio"; readonly description: "Output image aspect ratio. Mapped per-provider to the nearest supported size."; readonly enum: readonly ["1:1", "16:9", "9:16", "4:3", "3:4"]; readonly default: "1:1"; }; readonly quality: { readonly type: "string"; readonly title: "Quality"; readonly description: "Generation quality. Only honored by providers that support it (gpt-image-2)."; readonly enum: readonly ["low", "medium", "high"]; readonly "x-ui-group": "Configuration"; }; readonly seed: { readonly type: "number"; readonly title: "Seed"; readonly description: "Random seed for reproducibility. When unset, results are non-deterministic and the task is treated as not cacheable."; readonly "x-ui-group": "Configuration"; }; readonly negativePrompt: { readonly type: "string"; readonly title: "Negative Prompt"; readonly description: "What the model should avoid. Honored by providers that support it (Imagen, HF diffusion models)."; readonly "x-ui-group": "Configuration"; }; readonly providerOptions: { readonly type: "object"; readonly title: "Provider Options"; readonly description: "Provider-specific options that don't normalize across providers (e.g., DALL-E style, HF guidance scale)."; readonly additionalProperties: true; readonly "x-ui-group": "Advanced"; }; readonly model: { readonly oneOf: readonly [{ readonly title: "Model"; readonly description: `The model ${string}`; } & Record & { readonly format: import("..").TypeModelSemantic; readonly type: "string"; }, { readonly type: "object"; readonly properties: { readonly model_id: { readonly type: "string"; }; readonly capabilities: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly "x-ui-editor": "multiselect"; }; readonly title: { readonly type: "string"; }; readonly description: { readonly type: "string"; readonly "x-ui-editor": "textarea"; }; readonly provider: { readonly type: "string"; }; readonly provider_config: { readonly type: "object"; readonly properties: { readonly credential_key: { readonly type: "string"; readonly format: "credential"; readonly "x-ui-hidden": true; }; readonly native_dimensions: { readonly type: "integer"; readonly description: "Native output vector dimensions for embedding models"; }; readonly mrl: { readonly type: "boolean"; readonly description: "Whether the model supports Matryoshka Representation Learning"; }; }; readonly additionalProperties: true; readonly default: {}; }; readonly metadata: { readonly type: "object"; readonly default: {}; readonly "x-ui-hidden": true; }; }; readonly required: readonly ["provider", "provider_config"]; readonly format: "model"; readonly additionalProperties: true; } & Record & { readonly format: import("..").TypeModelSemantic; }]; } & Record & { readonly format: import("..").TypeModelSemantic; }; readonly prompt: { readonly type: "string"; readonly title: "Prompt"; readonly description: "Text describing the edit to apply"; }; readonly image: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "image:data-uri"; }, { readonly type: "object"; readonly format: "image"; }]; readonly title: "Image"; readonly description: "Image"; readonly format: "image"; }; readonly mask: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "image:data-uri"; }, { readonly type: "object"; readonly format: "image"; }]; readonly title: "Image"; readonly description: "Image"; readonly format: "image"; }; readonly additionalImages: { readonly type: "array"; readonly title: "Additional Images"; readonly description: "Optional reference / composite images. Used by gpt-image-2 and Gemini 2.5 Flash Image for multi-image edits."; readonly items: { readonly oneOf: readonly [{ readonly type: "string"; readonly format: "image:data-uri"; }, { readonly type: "object"; readonly format: "image"; }]; readonly title: "Image"; readonly description: "Image"; readonly format: "image"; }; }; }; readonly required: readonly ["model", "prompt", "image"]; readonly additionalProperties: false; }; export declare const ImageEditOutputSchema: DataPortSchema; type ImageEditSchemaInput = { additionalImages?: (string | { [x: string]: unknown; })[] | undefined; mask?: string | { [x: string]: unknown; } | undefined; aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | undefined; quality?: "low" | "medium" | "high" | undefined; seed?: number | undefined; negativePrompt?: string | undefined; providerOptions?: { [x: string]: unknown; } | undefined; model: string | ModelConfig; prompt: string; image: string | { [x: string]: unknown; }; }; export type ImageEditTaskInput = WithImageValuePorts; export type ImageEditTaskOutput = AiImageOutput; export type ImageEditTaskConfig = TaskConfig; export declare class ImageEditTask extends AiImageOutputTask { static type: string; /** Capabilities required of the model; gated in {@link AiTask.execute}. */ static readonly requires: ["image.editing"]; static category: string; static title: string; static description: string; static cacheable: boolean; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; validateInput(input: ImageEditTaskInput): Promise; } export declare const imageEdit: (input: ImageEditTaskInput, config?: ImageEditTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { imageEdit: CreateWorkflow; } } export {}; //# sourceMappingURL=ImageEditTask.d.ts.map