Flux Krea Dev Serverless API

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

~24.29s
POST /v2/flux-krea-dev · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3import segmind
 4
 5# Async (v2): submit to the queue and block until COMPLETED.
 6# run() returns the final result dict (600s deadline, 1.0s poll by default).
 7result = segmind.run(
 8    "flux-krea-dev",
 9    seed=42,
10    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'",
11    go_fast=True,
12    guidance=3,
13    megapixels="1",
14    num_outputs=2,
15    aspect_ratio="16:9",
16    output_format="jpg",
17    output_quality=90,
18    prompt_strength=0.7,
19    num_inference_steps=40,
20    disable_safety_checker=False,
21)
22print(result["status"])                      # COMPLETED
23print(result.get("output"))                  # model output (e.g. media URL)
24print(result["metrics"]["inference_time"])   # server compute seconds
25
26# --- Or submit + poll manually (track request_id, control the cadence) ---
27from segmind import SegmindClient, InferenceFailed, InferenceTimeout
28
29client = SegmindClient()                      # reads SEGMIND_API_KEY
30payload = {
31    "seed": 42,
32    "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'",
33    "go_fast": True,
34    "guidance": 3,
35    "megapixels": "1",
36    "num_outputs": 2,
37    "aspect_ratio": "16:9",
38    "output_format": "jpg",
39    "output_quality": 90,
40    "prompt_strength": 0.7,
41    "num_inference_steps": 40,
42    "disable_safety_checker": False,
43}
44job = client.submit_async("flux-krea-dev", **payload)
45print(job.request_id)                         # available immediately
46try:
47    result = job.wait(timeout=600, interval=1.0)
48except InferenceTimeout as e:
49    print("still running:", e.request_id)
50except InferenceFailed as e:
51    print("failed:", e.detail)

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

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/flux-krea-dev

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

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