Flux Depth Pro

Professional depth-aware image generation. Edit images while preserving spatial relationships.

~25.66s
$0.063 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/flux-depth-pro"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "seed": 96522,
12    "steps": 40,
13    "prompt": "American man, smiling, waving, eyeglasses, casual clothing, sitting at desk, laptop, home office, indoor, daylight, modern decor, house plants, bookshelf, natural lighting",
14    "guidance": 7,
15    "control_image": "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-depth-pro-ip.jpg",
16    "output_format": "jpg",
17    "safety_tolerance": 2,
18    "prompt_upsampling": false
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24    result = response.json()
25    print(json.dumps(result, indent=2))
26else:
27    print(f"Error: {response.status_code}")
28    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/flux-depth-pro

Parameters

control_imagerequired
string (uri)

Image to use as control input. Must be jpeg, png, or webp.

Default: "https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-depth-pro-ip.jpg"
promptrequired
string

Text prompt for image generation

Default: "American man, smiling, waving, eyeglasses, casual clothing, sitting at desk, laptop, home office, indoor, daylight, modern decor, house plants, bookshelf, natural lighting"
guidanceoptional
number

Controls the balance between adherence to the text as well as image prompt and image quality/diversity. Higher values make the output more closely match the prompt but may reduce overall image quality. Lower values allow for more creative freedom but might produce results less relevant to the prompt.

Default: 7Range: 1 - 50
output_formatoptional
string

Format of the output images.

Default: "jpg"
Allowed values :
"jpg""png"
prompt_upsamplingoptional
boolean

Automatically modify the prompt for more creative generation

Default: false
safety_toleranceoptional
integer

Safety tolerance, 1 is most strict and 6 is most permissive

Default: 2Range: 1 - 6
seedoptional
integer

Random seed. Set for reproducible generation

Default: 96522
stepsoptional
integer

Number of diffusion steps. Higher values yield finer details but increase processing time.

Default: 40Range: 15 - 50

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