Flux Depth Pro
Professional depth-aware image generation. Edit images while preserving spatial relationships.
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)
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
https://api.segmind.com/v1/flux-depth-pro
Parameters
control_image
requiredstring (uri)
Image to use as control input. Must be jpeg, png, or webp.
"https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/flux-tools/flux-depth-pro-ip.jpg"
prompt
requiredstring
Text prompt for image generation
"American man, smiling, waving, eyeglasses, casual clothing, sitting at desk, laptop, home office, indoor, daylight, modern decor, house plants, bookshelf, natural lighting"
guidance
optionalnumber
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.
7
Range: 1 - 50output_format
optionalstring
Format of the output images.
"jpg"
"jpg"
"png"
prompt_upsampling
optionalboolean
Automatically modify the prompt for more creative generation
false
safety_tolerance
optionalinteger
Safety tolerance, 1 is most strict and 6 is most permissive
2
Range: 1 - 6seed
optionalinteger
Random seed. Set for reproducible generation
96522
steps
optionalinteger
Number of diffusion steps. Higher values yield finer details but increase processing time.
40
Range: 15 - 50Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out