Skip to main content

Overview

AI Image Generator creates high-quality images from text descriptions using advanced AI models. The API generates original artwork, photos, illustrations, and designs based on detailed text prompts with customizable styles, aspect ratios, and resolutions. Typical processing time: ~5s median (see all processing times)

How It Works

  1. Write a prompt - Describe the image you want to create
  2. Choose a style - Select from 30+ art styles and tools
  3. Set the aspect ratio - Choose 1:1, 16:9, or 9:16
  4. API generates images - AI creates images matching your description
  5. Download results - Retrieve your generated images

Use Cases

  • Content creation - Generate images for blogs, social media, marketing
  • Concept art - Visualize ideas before production
  • Stock photo replacement - Create custom images on-demand
  • Product mockups - Generate product visualizations
  • Creative projects - Artwork, illustrations, and designs

Best Practices

Writing Effective Prompts

Be specific and descriptive - The more detail you provide, the better the results.
✅ Good prompts:
  • “A serene mountain landscape at sunset with vibrant orange and purple colors, dramatic clouds, photorealistic style”
  • “Minimalist logo design of a flying bird in blue gradient, vector art style, clean lines”
  • “Cozy coffee shop interior with warm lighting, wooden furniture, plants, cinematic photography”
❌ Avoid:
  • Too vague: “A nice picture”
  • Too short: “Mountain”
  • Conflicting instructions: “Bright dark image”

Style Selection

Magic Hour offers 30+ art styles. Match the style to your use case:

Aspect Ratio Guidelines

Set the aspect_ratio parameter to control the output shape:

Code Examples

Basic Image Generation

Generate Multiple Images

Portrait Orientation

Pricing

Cost depends on the model you choose (the default model is picked automatically and may change over time): Higher resolutions can increase the cost — see the model parameter in the API reference for supported resolutions and image counts per model.
Try this in our Google Colab Cookbook: Run this API with sample code. Just add your API key.

API Reference

AI Image Generator API Reference

View full API specification

AI Image Upscaler

Enhance image resolution

Image Background Remover

Remove image backgrounds