Image editing plugin for GUI Chat applications. Edit previously generated images based on text prompts.
- Edit existing images with natural language prompts
- Support for various editing operations (add objects, change style, modify background)
- Display edited images with original prompt
yarn add @gui-chat-plugin/edit-image// In src/tools/index.ts
import EditImagePlugin from "@gui-chat-plugin/edit-image/vue";
const pluginList = [
// ... other plugins
EditImagePlugin,
];
// In src/main.ts
import "@gui-chat-plugin/edit-image/style.css";import { executeEditImage, TOOL_DEFINITION } from "@gui-chat-plugin/edit-image";
// Edit an image
const result = await executeEditImage(context, {
prompt: "Add sunglasses to the person",
});interface EditImageArgs {
prompt: string; // Description of edits to make
}interface ImageToolData {
imageData: string; // Base64 encoded image data
prompt: string; // The edit prompt used
}This plugin requires the host application to provide an editImage function via the context:
context.app.editImage(prompt: string): Promise<EditImageResult># Install dependencies
yarn install
# Run demo
yarn dev
# Build
yarn build
# Lint
yarn lintTry these prompts to test the plugin (after generating an image first):
- "Add a rainbow in the sky of this image"
- "Change the background to a beach scene"
- "Make the colors more vibrant and add some butterflies"
MIT