Skip to content

Image Generation Plugin

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

Installation

  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

Usage

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

ActionDescriptionExample
GENERATE_IMAGECreate image from textGenerate an image of a mountain sunset

Configuration

interface ImageGenerationConfig {
provider: "anthropic" | "together";
apiKey: string;
defaultSize?: string;
autoCaption?: boolean;
}

Best Practices

  • โœ”๏ธ Provide clear, detailed image descriptions
  • โœ”๏ธ Handle generation errors gracefully
  • โœ”๏ธ Implement appropriate content filtering
  • โœ”๏ธ Cache generated images when possible