API to create AI images using
Stable Diffusion & Flux
Spend less time on managing GPUs and more time on your products.
Building an app? See the AI Image Generation API for endpoints, parameters and prices.
Text to Image
Easily change your text into great images with ModelsLab's API, Bring your ideas to life in seconds!
Inpainting & Outpainting API
Use ModelsLab's API to fill gaps and expand your images easily!
Avatars & Headshot API
Use ModelsLab's Facegen & Faceswap tools to create AI Avatars & swap features.
ControlNet API to generate controlled images
Use ControlNet for precise and creative image generation.
Background Remove & Replace API
Use ModelsLab's API to make perfect background changes for professional results.
Upscale & Super Resolution Images to 8K using API
Use ModelsLab's API to get crystal-clear detail and upgrade your visuals instantly.
Virtual Try-on and Fashion API
Use ModelsLab's API to see outfits on instantly. Upgrade your style with virtual fitting!
Imagen quick start
Generate an image with one POST request to /api/v6/images/text-to-image. Works with Stable Diffusion, SDXL, Flux, and 10,000+ models. Returns a hosted image URL.
Python — text-to-image with Flux
Python1import requests23response = requests.post(4 "https://modelslab.com/api/v6/images/text-to-image",5 json={6 "key": "YOUR_API_KEY",7 "model_id": "flux",8 "prompt": "a cinematic close-up portrait, soft daylight, 35mm film grain",9 "negative_prompt": "low quality, blurry",10 "width": 1024,11 "height": 1024,12 "samples": 113 }14)1516print(response.json()["output"][0])
JavaScript — Stable Diffusion XL with a LoRA
JavaScript1const response = await fetch('https://modelslab.com/api/v6/images/text-to-image', {2 method: 'POST',3 headers: { 'Content-Type': 'application/json' },4 body: JSON.stringify({5 key: 'YOUR_API_KEY',6 model_id: 'sdxl',7 lora_model: 'your-lora-id',8 lora_strength: 0.8,9 prompt: 'a softly-lit portrait, photorealistic',10 width: 1024,11 height: 1024,12 samples: 1,13 }),14});1516const data = await response.json();17console.log(data.output[0]);
cURL — quick test from terminal
bash1curl -X POST 'https://modelslab.com/api/v6/images/text-to-image' \2 -H 'Content-Type: application/json' \3 -d '{4 "key": "YOUR_API_KEY",5 "model_id": "flux",6 "prompt": "a vintage diner at golden hour, neon sign glow",7 "width": 1024,8 "height": 1024,9 "samples": 110 }'
Use Cases
Unleash Your Creativity in Our Sandbox of Voices and Languages
Trusted by 450+ teams on dedicated GPUs
See how developers and engineering teams scale generative pipelines with ModelsLab.
ModelsLab's Voice Cloning and Audio APIs revolutionized how we approach character development in our games. It's like having a full studio of voice actors running on dedicated infrastructure.
Alex Rivera
Lead Game Developer at Voxel Studios
The LLM and image generation APIs made multi-model pipelines trivial. One unified API key replaced four separate vendor contracts and cut our queue latency in half.
John Hernandez
AI Systems Architect at Synthetix AI
The ease of creating lifelike voiceovers for our e-learning courses has dramatically increased engagement. 99.9% uptime and instant API response have made it essential to our stack.
Priya Singh
Instructional Designer at LearnStream Media
Dedicated GPU clusters gave our production pipelines the throughput we needed without unpredictable rate limits or cold starts. Excellent developer experience.
Michael Chen
Digital Marketing Manager at Nexus Studio
Plans from $21 a month
Basic is $21/month and Standard $47/month; self-hosted image models cost $0.0047 per image from that allowance. Open Source Unlimited is $149/month with no per-image charge on self-hosted models. Every plan covers Flux, SDXL and 10,000+ community models. Cancel anytime.
100% refund policy on monthly & yearly plans — cancel anytime
Open Source Unlimited
Mission-Critical
100% refund policy · cancel anytime
Standard
Production
100% refund policy · cancel anytime
Basic
Prototype
100% refund policy · cancel anytime
Get expert support
We're Here to Help.
Want to know more? You can email us anytime at support@modelslab.com
Explore Our Other Solutions
Unlock your creative potential and scale your business with ModelsLab's comprehensive suite of AI-powered solutions.
AI Audio Generation
Text-to-speech, voice cloning, music generation, and audio processing APIs.
AI Video Generation & Tools
Create, edit, and enhance videos with AI-powered generation and transformation tools.
Engage Seamlessly with LLM
Access powerful language models for chatbots, content generation, and AI assistants.
Create Stunning 3D Models
Transform images and text into 3D models with advanced AI-powered generation.
Explore Plugins for Pro
Our plugins are designed to work with the most popular content creation software.
Build Apps with ModelsLabML API
Use our API to build apps, generate AI art, create videos, and produce audio with ease.