Flux Krea Dev

FLUX.1 Krea generates stunning, photorealistic images with fine-tuned aesthetic control for diverse creative applications.

~24.98s
$0.032 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/flux-krea-dev"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "seed": 42,
12    "prompt": "A miniature raccoon explorer made of wool wearing all kinds of equipment, the whole world is made of felt textile, holding a signboard which says 'Flux krea dev on Segmind'",
13    "go_fast": true,
14    "guidance": 3,
15    "megapixels": "1",
16    "num_outputs": 2,
17    "aspect_ratio": "16:9",
18    "output_format": "jpg",
19    "output_quality": 90,
20    "prompt_strength": 0.7,
21    "num_inference_steps": 40,
22    "disable_safety_checker": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28    result = response.json()
29    print(json.dumps(result, indent=2))
30else:
31    print(f"Error: {response.status_code}")
32    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/flux-krea-dev

Parameters

promptrequired
string

Guide the AI with text for the image generation. Short and imaginative prompts work best; imaginative scenes suggest detailed descriptions.

aspect_ratiooptional
string

Decide image proportions. Use '1:1' for square or other ratios for landscapes or portraits.

Default: "16:9"
Allowed values (11 total):
"1:1""16:9""21:9""3:2""2:3""4:5""5:4""3:4""4:3""9:16"+1 more
disable_safety_checkeroptional
boolean

Toggle safety checker to allow all image outputs. Disable to maximize creative freedom.

Default: false
go_fastoptional
boolean

Enable faster predictions; less deterministic but quicker. Disable for exact replication and improved detail.

Default: true
guidanceoptional
number

Controls adherence to prompt. Increase for more accuracy; decrease for creative variance.

Default: 7Range: 0 - 10
imageoptional
string (uri)

Input an image to guide the output. Match aspect ratio to maintain consistency; use any for unique results.

Default: null
megapixelsoptional
number

Choose resolution size. Use '1' for high-quality or '0.25' for faster, lower-resolution outputs.

Default: 1
Allowed values :
10.25
num_inference_stepsoptional
integer

Adjust the number of processing steps. Higher gives better quality; lower speeds up.

Default: 40Range: 1 - 50
num_outputsoptional
integer

Set the number of images generated. Choose more for variability or single for speed.

Default: 2Range: 1 - 4
output_formatoptional
string

Select image format. Use 'webp' for web-friendly, 'jpg' for compression, or 'png' for quality.

Default: "jpg"
Allowed values :
"webp""jpg""png"
output_qualityoptional
integer

Set image saving quality. Choose 100 for best or lower for smaller file size.

Default: 90Range: 0 - 100
prompt_strengthoptional
number

Defines prompt influence in img2img mode. High values alter original image more significantly.

Default: 0.7Range: 0 - 1
seedoptional
integer

The seed ensures reproducibility. Use specific numbers for consistent results or leave random for variability.

Default: 42

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out