Hunyuan3D-2

Hunyuan3D 2.0 enables the creation of high-quality 3D models with intricate details. Produce assets that are visually appealing and suitable for professional use.

~36.87s
~$0.345
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/hunyuan-3d-2"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://i.ibb.co/8nbymYTS/hunyuan-image.png",
12    "octree_resolution": "256",
13    "num_inference_steps": 30,
14    "guidance_scale": 5.5,
15    "seed": 12467,
16    "face_count": 40000,
17    "texture": false,
18    "mesh": null
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/hunyuan-3d-2

Parameters

meshrequired
string (uri)

GLB file, only needed if modifying existing mesh

Default: null
face_countoptional
integer

Only used if texture=true, maximum number of faces in the mesh.

Default: 40000Range: 5000 - 100000
guidance_scaleoptional
number

Scale for classifier-free guidance

Default: 5.5Range: 1 - 15
imageoptional
string (uri)

Input Image.

num_inference_stepsoptional
integer

Number of inference steps.

Default: 30Range: 20 - 50
octree_resolutionoptional
integer

Higher resolution gives betterquality but slower processing.

Default: 256
Allowed values :
256384512
seedoptional
integer

Seed for image generation.

Default: -1Range: -1 - 999999999999999
textoptional
string

Prompt to render (optional when image is used)

Default: null
textureoptional
boolean

Whether to apply texture to the generated mesh.

Default: false

Response Type

Returns: 3D Model

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