Image Generation
Generate images from text prompts using Flux, Stable Diffusion, DALL-E, and more
Image Generation
Generate stunning images from text descriptions using state-of-the-art models like Flux Pro, Stable Diffusion 3.5, DALL-E 3, and more.
For long-running generations or multiple images, use async mode with ?async=true to avoid timeouts.
Try it Now
Test the Image Generation API directly in your browser:
Endpoint
POST /images/generations
POST /images/generations?async=trueRequired scope: image
Request Body
{
"prompt": "A serene mountain landscape at sunset with vibrant colors",
"model": "fal-ai/flux/dev",
"size": "1024x1024",
"n": 1,
"style": "vivid",
"upscale": null,
"negative_prompt": "blurry, low quality, distorted",
"seed": 42
}Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | - | Text description of the desired image |
model | string | No | fal-ai/flux/dev | Model ID (see Available Models) |
size | string | No | 1024x1024 | Image dimensions |
n | number | No | 1 | Number of images to generate (1-10) |
style | string | No | vivid | Image style: vivid or natural |
upscale | string | No | - | Post-processing upscale: 2x or 4x |
negative_prompt | string | No | - | Elements to exclude from the image |
seed | number | No | random | Random seed for reproducibility |
Available Sizes
| Size | Aspect | Use Case |
|---|---|---|
512x512 | 1:1 | Thumbnails, avatars |
1024x1024 | 1:1 | Standard social media |
1792x1024 | 16:9 | Landscape, banners |
1024x1792 | 9:16 | Portrait, stories |
1536x1024 | 3:2 | Photography style |
1024x1536 | 2:3 | Vertical photography |
Response
{
"created": 1703123456,
"data": [
{
"url": "https://fal.media/files/abc123.png",
"revised_prompt": "A serene mountain landscape...",
"width": 1024,
"height": 1024
}
],
"model": "fal-ai/flux/dev",
"model_tier": "standard",
"usage": {
"credits_used": 15,
"credits_breakdown": {"base": 15},
"generations_used": 1,
"generations_remaining": 99
}
}Async Mode
For multiple images or high-resolution outputs, use async mode:
// Request with ?async=true
{
"id": "job_abc123",
"status": "pending",
"created": 1703123456,
"model": "fal-ai/flux/dev",
"estimated_credits": 15
}Poll the job status with GET /jobs/{job_id}?poll=true.
Examples
curl -X POST https://www.novakit.ai/api/v1/images/generations \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cyberpunk cityscape with neon lights and flying cars",
"size": "1024x1024",
"n": 2
}'import requests
response = requests.post(
"https://www.novakit.ai/api/v1/images/generations",
headers={
"Authorization": "Bearer sk_your_api_key",
"Content-Type": "application/json"
},
json={
"prompt": "A cyberpunk cityscape with neon lights and flying cars",
"size": "1024x1024",
"n": 2
}
)
for image in response.json()["data"]:
print(image["url"])const response = await fetch(
"https://www.novakit.ai/api/v1/images/generations",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "A cyberpunk cityscape with neon lights and flying cars",
size: "1024x1024",
n: 2,
}),
}
);
const data = await response.json();
data.data.forEach((image: { url: string }) => console.log(image.url));Available Models
Flux Models (Recommended)
| Model | Speed | Quality | Best For |
|---|---|---|---|
fal-ai/flux/dev | ~10s | Excellent | Production images (default) |
fal-ai/flux-2 | ~8s | Excellent | Latest Flux generation |
fal-ai/flux-2-pro | ~12s | Excellent | Professional quality |
fal-ai/flux-pro/v1.1-ultra | ~15s | Excellent | Highest quality Flux |
fal-ai/flux-general | ~10s | Excellent | With ControlNets and LoRAs |
Stable Diffusion & Other Models
| Model | Speed | Quality | Best For |
|---|---|---|---|
fal-ai/stable-diffusion-v35-large | ~12s | Excellent | High quality SD |
fal-ai/hidream-i1-fast | ~5s | Good | Fast generation |
fal-ai/hidream-i1-dev | ~8s | Excellent | Balanced quality |
fal-ai/imagen4/preview/fast | ~6s | Excellent | Google Imagen 4 |
Specialty Models
| Model | Speed | Quality | Best For |
|---|---|---|---|
fal-ai/recraft/v3/text-to-image | ~10s | Excellent | Graphic design, logos |
fal-ai/ideogram/v2 | ~12s | Excellent | Text in images |
fal-ai/gpt-image-1.5 | ~8s | Good | GPT-style generation |
bria/text-to-image/3.2 | ~8s | Good | Commercial-safe images |
Tips for Better Results
Writing effective prompts:
- Be specific and descriptive
- Include style references (e.g., "oil painting", "photorealistic")
- Mention lighting and mood
- Use negative prompts to exclude unwanted elements
Example Prompts
| Style | Prompt |
|---|---|
| Photorealistic | "Professional photo of a golden retriever in a sunny park, shallow depth of field, Canon EOS R5" |
| Digital Art | "Fantasy castle on a floating island, digital art, vibrant colors, by Greg Rutkowski" |
| Minimalist | "Simple geometric logo design, minimal, clean lines, white background" |
Upscaling
Add "upscale": "2x" or "upscale": "4x" to increase resolution:
{
"prompt": "A detailed fantasy map",
"size": "1024x1024",
"upscale": "4x"
}This will generate at 1024x1024 and upscale to 4096x4096.