Skip to content

Image Generation Plugin

The Image Generation Plugin enables AI image creation using Anthropic and Together services, with automatic caption generation.

  1. Install the package:

    Terminal window
    npm i github:elizaos-plugins/plugin-image-generation
  2. Configure environment:

    Terminal window
    # Choose your provider
    ANTHROPIC_API_KEY=your-anthropic-key
    TOGETHER_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();
ActionDescriptionExample
GENERATE_IMAGECreate image from textGenerate an image of a mountain sunset
interface ImageGenerationConfig {
provider: "anthropic" | "together";
apiKey: string;
defaultSize?: string;
autoCaption?: boolean;
}
  • Provide clear, detailed image descriptions
  • Handle generation errors gracefully
  • Implement appropriate content filtering
  • Cache generated images when possible