Insta Depth

InstantID aims to generate customized images with various poses or styles from only a single reference ID image while ensuring high fidelity

~15.15s
~$0.052
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/insta-depth"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Photo of a woman wearing a Superman costume",
12    "negative_prompt": "lowquality, badquality, sketches",
13    "face_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/insta-depth-ip.png",
14    "pose_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/insta-dept-pose.png",
15    "num_inference_steps": 10,
16    "guidance_scale": 3,
17    "seed": 354849415,
18    "base64": 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/insta-depth

Parameters

face_imagerequired
string (uri)

Face Image.

pose_imagerequired
string (uri)

Pose Image.

promptrequired
string

Prompt to render

base64optional
boolean

Base64 encoding of the output image.

Default: false
guidance_scaleoptional
number

Scale for classifier-free guidance

Default: 3Range: 1 - 15
negative_promptoptional
string

Prompts to exclude, eg. 'bad anatomy, bad hands, missing fingers'

num_inference_stepsoptional
integer

Number of denoising steps.

Default: 10Range: 4 - 100
seedoptional
integer

Seed for image generation.

Default: -1Range: -1 - 999999999999999

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