About FLUX.2 [flex]
FLUX.2 [flex] is an image generation model that excels in high-quality image creation and editing with strong control over text rendering, typographic layout, and precise prompt adherence.
It provides granular control over image generation, allowing users to balance speed, quality, and cost by adjusting inference steps and guidance scale, and supports up to 10 reference images for tasks such as style transfer, compositing, and product continuity.
Some other noteworthy features of FLUX.2 [flex] include:
- Superior text and caption rendering, making it well-suited for infographics, marketing materials, and brand assets.
- JSON-structured prompts for precise compositional control.
- Accurate color reproduction, including support for exact HEX color codes, which is valuable for product visualization.
Ready to build with FLUX.2 [flex]?
Try FLUX.2 [flex] in the Workbench to prompt it, compare outputs, and iterate on prompts without writing any code. When you're ready to ship, call the same model from our API and build your own apps on top of it.
curl -sSf -X POST https://hub.oxen.ai/api/ai/images/edit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OXEN_API_KEY" \
-d '{
"model": "flux-2-flex",
"prompt": "Draw a parody of the Mona Lisa by Leonardo da Vinci with Bloxy, the cartoon ox in @Image1, as Lisa del Giocondo. Keep Bloxy in the original style of @Image1 with the cartoon ox, but adapt its pose to the pose depicted in the Mona Lisa. Don'\''t include its arms or legs in the painting.",
"input_image": [
"https://hub.oxen.ai/api/repos/elau/assets/file/main/bloxy/bloxy_cropped_512x512.png"
],
"aspect_ratio": "16:9",
"resolution": "1 MP",
"num_inference_steps": 30,
"guidance": 2,
"output_format": "webp",
"output_quality": 80,
"disable_safety_checker": false
}'Request parameters
Every field FLUX.2 [flex] accepts in the request body. See the API reference for response formats.
https://hub.oxen.ai/api/ai/images/edit| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Prompt for generated image. Use @Image1, @Image2, etc. to reference the input images. |
input_image | array<string>nullable | No | — | Input images to transform or use as reference. Reference them in the prompt as @Image1, @Image2, etc. |
aspect_ratio | string | No | "16:9" | 1:116:99:164:33:43:22:3match_input_image |
resolution | string | No | "1 MP" | 1 MP2 MP0.5 MP |
num_inference_steps | integer | No | 30 | Number of denoising steps. Recommended range is 28-50, and lower number of steps produce lower quality outputs, faster. Range: 1 – 50 |
guidance | number | No | 2 | Guidance for generated image. Lower values can give more realistic images. Good values to try are 2, 2.5, 3 and 3.5 Range: 0 – 10 |
seed | integernullable | No | — | Random seed. Set for reproducible generation |
output_format | string | No | "webp" | Format of the output imageswebpjpgpng |
output_quality | integer | No | 80 | Quality when saving the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Not relevant for .png outputs Range: 0 – 100 |
disable_safety_checker | boolean | No | false | Disable safety checker for generated images. |