A plugin for AI-powered video generation using Luma AI, providing automated video creation capabilities from text prompts.
This plugin provides functionality to:
- Generate videos from text descriptions
- Handle video generation requests through Luma AI
- Manage API authentication and responses
- Cache and serve generated videos
- Monitor generation progress
npm install @elizaos/plugin-video-generation
The plugin requires the following environment variables:
LUMA_API_KEY=your_luma_api_key # Required: API key for Luma AI
Import and register the plugin in your Eliza configuration:
import { videoGenerationPlugin } from "@elizaos/plugin-video-generation";
export default {
plugins: [videoGenerationPlugin],
// ... other configuration
};
The plugin uses Luma AI's API to generate videos from text prompts:
import { videoGeneration } from "@elizaos/plugin-video-generation";
// Generate video from prompt
const result = await videoGeneration.handler(
runtime,
{
content: { text: "Generate a video of a sunset on the beach" },
},
state,
{},
callback
);
// The plugin automatically handles progress monitoring
const result = await generateVideo(prompt, runtime);
if (result.success) {
console.log("Video URL:", result.data);
} else {
console.error("Generation failed:", result.error);
}
npm run build
npm run test
npm run dev
@elizaos/core
: Core Eliza functionalitytsup
: Build tool- Other standard dependencies listed in package.json
interface Action {
name: "GENERATE_VIDEO";
similes: string[];
description: string;
validate: (runtime: IAgentRuntime, message: Memory) => Promise<boolean>;
handler: (
runtime: IAgentRuntime,
message: Memory,
state: State,
options: any,
callback: HandlerCallback
) => Promise<void>;
examples: Array<Array<any>>;
}
interface GenerationResult {
success: boolean;
data?: string;
error?: string;
}
generateVideo
: Main method for video generationvideoGeneration.handler
: Action handler for video requestsvideoGeneration.validate
: Validates API key and requirements
- Cause: Invalid or missing Luma API key
- Solution: Verify LUMA_API_KEY environment variable
- Cause: Long generation times or network issues
- Solution: Implement proper timeout handling and retry logic
- Cause: Insufficient permissions or disk space
- Solution: Verify file system permissions and available storage
- Store API keys securely using environment variables
- Implement proper error handling
- Keep dependencies updated
- Monitor API usage and rate limits
- Validate input prompts
- Secure file storage handling
The plugin uses predefined constants for API configuration:
export const LUMA_CONSTANTS = {
API_URL: "https://api.lumalabs.ai/dream-machine/v1/generations",
API_KEY_SETTING: "LUMA_API_KEY",
};
// Basic video generation
const videoPrompt = "Create a video of a futuristic city at night";
const result = await generateVideo(videoPrompt, runtime);
// With callback handling
videoGeneration.handler(
runtime,
{
content: { text: videoPrompt },
},
state,
{},
(response) => {
console.log("Generation status:", response);
}
);
-
Generation Features
- Advanced style control
- Multi-scene composition
- Custom duration settings
- Resolution options
- Frame rate control
- Audio integration
-
Video Editing
- Scene transitions
- Text overlay tools
- Effect templates
- Color correction
- Motion tracking
- Timeline editing
-
Asset Management
- Asset library
- Template system
- Style presets
- Resource optimization
- Version control
- Batch processing
-
Quality Improvements
- Enhanced resolution
- Frame interpolation
- Artifact reduction
- Stability features
- Lighting optimization
- Detail enhancement
-
Performance Optimization
- Generation speed
- Resource usage
- Parallel processing
- Caching system
- Queue management
- Load balancing
-
Export Options
- Multiple formats
- Compression settings
- Streaming support
- Progressive loading
- Thumbnail generation
- Metadata handling
-
Developer Tools
- API expansion
- Testing framework
- Documentation generator
- Debug visualization
- Performance monitoring
- Integration templates
-
AI Features
- Style transfer
- Scene understanding
- Content awareness
- Motion synthesis
- Character animation
- Environment generation
We welcome community feedback and contributions to help prioritize these enhancements.
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
This plugin integrates with and builds upon several key technologies:
- Luma AI: Advanced AI-powered video generation platform
- Luma Dream Machine: Text-to-video generation API
- Node.js Fetch API: HTTP request handling
Special thanks to:
- The Luma Labs team for providing the video generation API
- The Luma AI research team for their groundbreaking work in AI video generation
- The Eliza community for their contributions and feedback
For more information about video generation capabilities and tools:
This plugin is part of the Eliza project. See the main project repository for license information.