Flux 2
Generate high-quality images from text prompts with Flux 2. Features configurable guidance scale, acceleration levels, and prompt expansion for optimal results.
Quick Start
Requires an each::labs API key. Get one at eachlabs.ai.
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2",
"version": "0.0.1",
"input": {
"prompt": "a stunning architectural photograph of a modern glass building at twilight",
"image_size": "landscape_4_3",
"guidance_scale": 2.5,
"num_inference_steps": 28
}
}'
Parameters
| Parameter |
Type |
Default |
Description |
| acceleration |
string |
regular |
The acceleration level to use. enum: none, regular, high |
| enable_prompt_expansion |
boolean |
false |
If set to true, the prompt will be expanded for better results. |
| enable_safety_checker |
boolean |
true |
If set to true, the safety checker will be enabled. |
| guidance_scale |
number |
2.5 |
Guidance Scale controls how closely the model follows your prompt. |
| image_size |
string |
landscape_4_3 |
The size of the generated image. enum: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 |
| num_images |
integer |
1 |
The number of images to generate. |
| num_inference_steps |
integer |
28 |
The number of inference steps to perform. |
| output_format |
string |
png |
The format of the generated image. enum: jpeg, png, webp |
| prompt |
string |
|
The prompt to generate an image from. |
| seed |
integer |
|
The seed to use for the generation. |
Examples
Detailed landscape:
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2",
"version": "0.0.1",
"input": {
"prompt": "misty mountain lake at dawn, reflections on still water, photorealistic",
"image_size": "landscape_16_9",
"guidance_scale": 3.0,
"num_inference_steps": 35,
"output_format": "png",
"seed": 42
}
}'
Fast batch generation:
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2",
"version": "0.0.1",
"input": {
"prompt": "minimalist logo design for a coffee brand, clean lines, modern",
"image_size": "square_hd",
"acceleration": "high",
"num_images": 4,
"enable_prompt_expansion": true
}
}'
Related Models
Documentation
1---2name: flux-23description: Flux 2. Generate images from text prompts with configurable guidance and acceleration. Triggers: text to image, flux, image generation, fast4---56# Flux 278Generate high-quality images from text prompts with Flux 2. Features configurable guidance scale, acceleration levels, and prompt expansion for optimal results.910## Quick Start1112> Requires an each::labs API key. Get one at [eachlabs.ai](https://eachlabs.ai).1314```bash15curl -X POST https://api.eachlabs.ai/v1/prediction \16 -H "Content-Type: application/json" \17 -H "X-API-Key: $EACHLABS_API_KEY" \18 -d '{19 "model": "flux-2",20 "version": "0.0.1",21 "input": {22 "prompt": "a stunning architectural photograph of a modern glass building at twilight",23 "image_size": "landscape_4_3",24 "guidance_scale": 2.5,25 "num_inference_steps": 2826 }27 }'28```2930## Parameters3132| Parameter | Type | Default | Description |33|-----------|------|---------|-------------|34| acceleration | string | regular | The acceleration level to use. enum: none, regular, high |35| enable_prompt_expansion | boolean | false | If set to true, the prompt will be expanded for better results. |36| enable_safety_checker | boolean | true | If set to true, the safety checker will be enabled. |37| guidance_scale | number | 2.5 | Guidance Scale controls how closely the model follows your prompt. |38| image_size | string | landscape_4_3 | The size of the generated image. enum: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 |39| num_images | integer | 1 | The number of images to generate. |40| num_inference_steps | integer | 28 | The number of inference steps to perform. |41| output_format | string | png | The format of the generated image. enum: jpeg, png, webp |42| prompt | string | | The prompt to generate an image from. |43| seed | integer | | The seed to use for the generation. |4445## Examples4647**Detailed landscape:**48```bash49curl -X POST https://api.eachlabs.ai/v1/prediction \50 -H "Content-Type: application/json" \51 -H "X-API-Key: $EACHLABS_API_KEY" \52 -d '{53 "model": "flux-2",54 "version": "0.0.1",55 "input": {56 "prompt": "misty mountain lake at dawn, reflections on still water, photorealistic",57 "image_size": "landscape_16_9",58 "guidance_scale": 3.0,59 "num_inference_steps": 35,60 "output_format": "png",61 "seed": 4262 }63 }'64```6566**Fast batch generation:**67```bash68curl -X POST https://api.eachlabs.ai/v1/prediction \69 -H "Content-Type: application/json" \70 -H "X-API-Key: $EACHLABS_API_KEY" \71 -d '{72 "model": "flux-2",73 "version": "0.0.1",74 "input": {75 "prompt": "minimalist logo design for a coffee brand, clean lines, modern",76 "image_size": "square_hd",77 "acceleration": "high",78 "num_images": 4,79 "enable_prompt_expansion": true80 }81 }'82```8384## Related Models8586- [Flux 2 | Edit](../flux-2-edit/) - Image editing with Flux 287- [Flux 2 Pro](../flux-2-pro/) - Pro-quality generation88- [Flux 2 | Text to Image Lora](../flux-2-lora/) - LoRA-enhanced generation8990## Documentation9192- [each::labs Docs](https://docs.eachlabs.ai)93- [API Reference](https://docs.eachlabs.ai/api/overview)