Image Generation
Generate images with AI agents
Generate images using DALL-E or other image models.
Quick Start
- Generate Image
rust use praisonai::{Agent, tool}; #[tool] async fn generate_image(prompt: String) -> String { // Uses DALL-E via tool let url = dalle::generate(&prompt).await?; url } let agent = Agent::new() .name("Artist") .instructions("Generate images based on descriptions") .tool(generate_image) .build()?; agent.chat("Create a sunset over mountains").await?;
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
model | String | dall-e-3 | Image model |
size | String | 1024x1024 | Image size |
quality | String | standard | Image quality |
Best Practices
Be specific in prompts
Detailed prompts produce better images – include style, lighting, and composition.
Consider image size
Smaller images are faster and cheaper – use larger only when needed.