Image Generation Plugin
The Image Generation Plugin enables AI image creation using Anthropic and Together services, with automatic caption generation.
Installation
Section titled โInstallationโ-
Install the package:
Terminal window npm i github:elizaos-plugins/plugin-image-generationTerminal window pnpm add github:elizaos-plugins/plugin-image-generationTerminal window yarn add github:elizaos-plugins/plugin-image-generation -
Configure environment:
Terminal window # Choose your providerANTHROPIC_API_KEY=your-anthropic-keyTOGETHER_API_KEY=your-together-key
import { createImageGenerationPlugin } from "@eliza/plugin-image-generation";
const imagePlugin = createImageGenerationPlugin({ provider: "anthropic", apiKey: process.env.ANTHROPIC_API_KEY, defaultSize: "1024x1024"});
const agent = new AgentBuilder() .withPlugin(imagePlugin) .build();
Features
Section titled โFeaturesโAction | Description | Example |
---|---|---|
GENERATE_IMAGE | Create image from text | Generate an image of a mountain sunset |
Configuration
Section titled โConfigurationโinterface ImageGenerationConfig { provider: "anthropic" | "together"; apiKey: string; defaultSize?: string; autoCaption?: boolean;}
Best Practices
Section titled โBest Practicesโ- Provide clear, detailed image descriptions
- Handle generation errors gracefully
- Implement appropriate content filtering
- Cache generated images when possible