Skip to main content

Image Agent CLI Commands

The praisonai-ts CLI provides the image command for image generation and analysis.

Generate Images

# Generate an image from text
praisonai-ts image generate "A sunset over mountains"

# Generate with options
praisonai-ts image generate "A cat" --size 1024x1024 --quality hd

# Get JSON output
praisonai-ts image generate "A futuristic city" --json
Example Output:
{
  "success": true,
  "data": {
    "images": ["https://...generated-image-url..."],
    "prompt": "A sunset over mountains"
  }
}

Analyze Images

# Analyze an image from URL
praisonai-ts image analyze https://example.com/image.jpg

# Analyze with custom prompt
praisonai-ts image analyze https://example.com/image.jpg "What objects are in this image?"

# Get JSON output
praisonai-ts image analyze https://example.com/image.jpg --json

Generation Options

OptionDescription
--sizeImage size (256x256, 512x512, 1024x1024, 1792x1024, 1024x1792)
--qualityQuality level (standard, hd)
--styleStyle (vivid, natural)

SDK Usage

For programmatic usage:
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

// Generate image
const images = await agent.generate({
  prompt: 'A sunset over mountains',
  size: '1024x1024',
  quality: 'hd'
});

// Analyze image
const analysis = await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  prompt: 'Describe this image'
});
For more details, see the Image Agent SDK documentation.