Generate images using fal.ai Flux. Use when asked to create images, portraits, maps, or visual assets for the campaign.
curl -X POST "https://fal.run/{MODEL}" \
-H "Authorization: Key $FAL_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "...", "image_size": "portrait_4_3", "num_images": 1}'
All per-megapixel prices round up to nearest MP. 1024×768 = 1 MP.
| Model | Endpoint | Price | Notes |
|---|---|---|---|
| FLUX.1 [schnell] | fal-ai/flux/schnell | $0.003/MP | Designed for 1-4 inference steps |
| FLUX.1 [dev] | fal-ai/flux/dev | $0.025/MP | 12B parameter flow transformer |
| FLUX.1 LoRA |
fal-ai/flux-lora| $0.035/MP |
| Dev + custom LoRA weights |
| FLUX 1.1 [pro] | fal-ai/flux-pro/v1.1 | $0.055/MP | Has prompt enhancement option |
| FLUX.2 [pro] | fal-ai/flux-2-pro | $0.03 first MP + $0.015/extra MP | Text-to-image only |
| FLUX.2 [flex] | fal-ai/flux-2-flex | $0.05/MP (input + output) | Text-to-image + image editing |
| Kontext [pro] | fal-ai/flux-pro/kontext | $0.04/image (flat) | Reference-image editing |
| Kontext LoRA | fal-ai/flux-kontext-lora | $0.035/MP | Kontext + custom LoRA weights |
fal-ai/flux/dev| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | — | Image description |
image_size | enum or {width,height} | no | landscape_4_3 | Size preset or custom dimensions |
num_inference_steps | integer (1-50) | no | 28 | More = higher quality, slower |
guidance_scale | float (1-20) | no | 3.5 | Prompt adherence strength |
seed | integer | no | random | For reproducible results |
num_images | integer (1-4) | no | 1 | Batch count |
output_format | jpeg | png | no | jpeg | Output format |
enable_safety_checker | boolean | no | true | Safety filter |
acceleration | none | regular | high | no | none | Speed boost |
sync_mode | boolean | no | false | Return image as data URI |
fal-ai/flux/schnellSame schema as dev, except:
num_inference_steps default: 4 (designed for 1-4 steps)fal-ai/flux-pro/v1.1| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | — | Image description |
image_size | enum or {width,height} | no | landscape_4_3 | Size preset or custom dimensions |
seed | integer | no | random | For reproducible results |
num_images | integer | no | 1 | Batch count |
output_format | jpeg | png | no | jpeg | Output format |
safety_tolerance | 1-6 | no | 2 | 1=most strict, 6=most permissive |
enhance_prompt | boolean | no | false | Auto-enhance prompt |
sync_mode | boolean | no | false | Return image as data URI |
No num_inference_steps or guidance_scale — model controls these internally.
fal-ai/flux-2-pro| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | — | Image description |
image_size | enum or {width,height} | no | landscape_4_3 | Size preset or custom (max 14142px) |
seed | integer | no | random | For reproducible results |
output_format | jpeg | png | no | jpeg | Output format |
safety_tolerance | 1-5 | no | 2 | 1=most strict, 5=most permissive |
enable_safety_checker | boolean | no | true | Safety filter |
sync_mode | boolean | no | false | Return image as data URI |
No num_inference_steps, guidance_scale, or num_images.
fal-ai/flux-2-flexText-to-image endpoint: fal-ai/flux-2-flex
Image editing endpoint: fal-ai/flux-2-flex/edit
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | — | Image description |
image_size | enum or {width,height} | no | landscape_4_3 | Size preset or custom |
num_inference_steps | integer (2-50) | no | 28 | Quality/speed tradeoff |
guidance_scale | float (1.5-10) | no | 3.5 | Prompt adherence |
seed | integer | no | random | For reproducible results |
output_format | jpeg | png | no | jpeg | Output format |
safety_tolerance | 1-5 | no | 2 | 1=most strict, 5=most permissive |
enable_safety_checker | boolean | no | true | Safety filter |
sync_mode | boolean | no | false | Return image as data URI |
Edit endpoint adds: image_urls (string array, required) — input images to edit.
fal-ai/flux-pro/kontext| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | — | Edit instruction or image description |
image_url | string | yes | — | Reference/source image URL |
guidance_scale | float | no | 3.5 | Prompt adherence |
num_images | integer | no | 1 | Batch count |
output_format | jpeg | png | no | jpeg | Output format |
safety_tolerance | 1-6 | no | 2 | 1=most strict, 6=most permissive |
enhance_prompt | boolean | no | false | Auto-enhance prompt |
aspect_ratio | enum | no | — | 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21 |
seed | integer | no | random | For reproducible results |
sync_mode | boolean | no | false | Return image as data URI |
Uses aspect_ratio instead of image_size. Uses image_url (singular) not image_urls.
fal-ai/flux-loraSame schema as dev, plus:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
loras | array of LoraWeight | no | [] | LoRA adaptations to apply |
LoraWeight object: {"path": "url-or-path", "scale": 1.0} (scale range 0-4)
fal-ai/flux-kontext-loraSame schema as Kontext, plus:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
loras | array of LoraWeight | no | [] | LoRA adaptations to apply |
num_inference_steps | integer (10-50) | no | 30 | Quality/speed tradeoff |
acceleration | none | regular | high | no | none | Speed boost |
resolution_mode | enum | no | match_input | auto, match_input, or aspect ratios |
Uses resolution_mode instead of aspect_ratio. Default output format is png.
{
"images": [{"url": "https://...", "width": 1024, "height": 768, "content_type": "image/jpeg"}],
"seed": 12345,
"prompt": "the prompt used",
"has_nsfw_concepts": [false],
"timings": {}
}
| Preset | Dimensions |
|---|---|
square | 1024×1024 |
square_hd | 1024×1024 |
portrait_4_3 | 768×1024 |
portrait_16_9 | 576×1024 |
landscape_4_3 | 1024×768 |
landscape_16_9 | 1024×576 |
Distilled from the guides listed at the bottom. When in doubt, consult the originals.
Flux weighs earlier tokens more heavily. Structure prompts as: Subject → Action → Style → Context [BFL, fal.ai]
Flux uses T5/Mistral text encoders. It wants sentences, not tag lists. [fal.ai how-to]
Weight syntax like (emphasis)++ or (word:1.5) has no effect — the model ignores it. [fal.ai how-to]
Flux is guidance-distilled and does not support negative prompts. Describe what you want, not what to avoid. [BFL, fal.ai how-to]
Naming specific camera systems shapes output character. [BFL, fal.ai how-to]
Lens focal lengths: 14-24mm wide/dramatic, 35-50mm natural, 70-85mm portrait, 100mm+ telephoto compression. [fal.ai prompt guide]
Depth of field: f/1.4-f/2.8 shallow blur, f/4-f/5.6 moderate, f/8-f/16 deep/sharp. [fal.ai prompt guide]
Describe how light interacts with the scene, not just the condition name. [fal.ai how-to]
Associate hex codes with specific objects. [BFL]
Vague references like "use #FF0000 somewhere" produce inconsistent results. [BFL]
Flux renders text well with clear specifications. [BFL, fal.ai how-to]
For complex multi-subject scenes, Flux 2 accepts JSON: [BFL, fal.ai how-to]
{
"scene": "A dimly lit jazz club in 1960s New York",
"subjects": [
{
"type": "musician",
"description": "man in a charcoal suit, salt-and-pepper beard",
"pose": "playing an upright bass with closed eyes",
"position": "foreground left"
}
],
"style": "Cinematic film photography",
"color_palette": ["#2C1810", "#D4A574", "#8B4513"],
"lighting": "Single warm spotlight from above, smoke catching the light",
"mood": "Intimate and contemplative",
"composition": "rule of thirds",
"camera": {"angle": "slightly low angle", "lens": "50mm"}
}
Use JSON for multi-subject precision. Natural language works equally well for single-subject images. [BFL]
Flux understands compositional terms: rule of thirds, golden spiral, triangular arrangement, diagonal energy. [fal.ai prompt guide]