Image editing plugin for GUI Chat applications
npm install @gui-chat-plugin/edit-image
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
``bash`
yarn add @gui-chat-plugin/edit-image
`typescript
// 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";
`
`typescript
import { executeEditImage, TOOL_DEFINITION } from "@gui-chat-plugin/edit-image";
// Edit an image
const result = await executeEditImage(context, {
prompt: "Add sunglasses to the person",
});
`
`typescript`
interface EditImageArgs {
prompt: string; // Description of edits to make
}
`typescript`
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:
`typescript`
context.app.editImage(prompt: string): Promise
`bashInstall dependencies
yarn install
Try these prompts to test the plugin (after generating an image first):
1. "Add a rainbow in the sky of this image"
2. "Change the background to a beach scene"
3. "Make the colors more vibrant and add some butterflies"
MIT