
Free & Best Quality AI Image generator API
Anish
🤖 AI Image Generation API 🖼️
This Hono.js-powered API allows you to generate stunning AI images using multiple state-of-the-art image generation models!
🚀 Quick Start
Base URL
https://ai-image-api.xeven.workers.dev/img
Available Query Parameters
prompt
(optional): Your image description. Default:Cyberpunk Dinosaur robot, modern, 3D render, 8K, HD
model
(optional): Choose your AI model. Default Model:SD XL Lightning
strength
(optional): Image generation strength. Default:1
guidance
(optional): Guidance scale. Default:7.5
🎨 Models Available
Model Name | Query Parameter | Best For |
---|---|---|
Stable Diffusion XL Lightning | sdxl-lightning | Fast, high-quality images < 5 secs 🚀 |
Stable Diffusion XL | sdxl | Balanced, professional images, highest quality < 12 secs 🖼️ |
Flux Schnell | flux-schnell | Best and most realistic model with quick generations < 6secs 🔥 |
Dreamshaper | dreamshaper | Fastest model < 2secs, low quality🌈 |
📝 Example Requests
Basic Request
GET https://ai-image-api.xeven.workers.dev/img?prompt=Cyberpunk landscape with neon cities
Detailed Request
GET https://ai-image-api.xeven.workers.dev/img?prompt=Futuristic robot&model=dreamshaper&strength=0.8&guidance=7
Dreamshaper Example
GET https://ai-image-api.xeven.workers.dev/img?prompt=Fantasy castle&model=dreamshaper
SD XL Lightning Example
GET https://ai-image-api.xeven.workers.dev/img?prompt=Space battle&model=sdxl-lightning
SD XL Example
GET https://ai-image-api.xeven.workers.dev/img?prompt=Future cityscape&model=sdxl
Flux Schnell Example
GET https://ai-image-api.xeven.workers.dev/img?prompt=Realistic portrait&model=flux-schnell
Curl Example
curl -X GET "https://ai-image-api.xeven.workers.dev/img?prompt=Fantasy%20castle&model=dreamshaper" --output image.png
Note: Binary output can mess up your terminal. Use “—output -” to tell curl to output it to your terminal anyway, or consider “—output
Curl Example with Parameters
curl -X GET "https://ai-image-api.xeven.workers.dev/img?prompt=Fantasy%20castle&model=flux-schnell" --output image.png
🛠️ Error Handling
- Invalid routes return a 404 “Not Found” JSON response
- Unsupported parameters fall back to default values