hintstring
Optional text naming the parts you want.
tripo3d/tripo/smart-segmentTripo Smart Segment splits an image or a 3D model into named semantic parts, returning a segmented 3D model and a part mask.
model को आज़माएँ
PNG, JPEG, WebP, या GIF · अधिकतम 20 MiB
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
Tripo Smart Segment splits an image or a 3D model into named semantic parts, returning a segmented 3D model and a part mask.
| Field | Type | Default | Notes |
|---|---|---|---|
seg_type | image / model, required | image | image segments an image and builds a segmented 3D model; model segments an existing GLB. |
image | string | — | Input image when seg_type is image. |
model_url | string | — | Input GLB when seg_type is model. |
granularity | coarse / medium / fine | medium | How finely to split. |
hint | string | — | Optional text naming the parts you want. |
transform | array | — | Model transform as a column-major 4x4 matrix (16 numbers). Used when seg_type is model; identity when unset. |
url: Segmented GLB, one node per part.mask: Part mask image.parts: Comma-separated part names.| seg_type | Price |
|---|---|
| image | $0.85 |
| model | $0.55 |
| Failed runs are not charged. |
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ कोई भी समर्थित API चुनें.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "tripo3d/tripo/smart-segment",
"image": "https://static.sandbase.ai/examples/tencent/hunyuan-3d/v3/input_image_0.png",
"seg_type": "image",
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"granularity": "medium"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"एक SandBase API key बनाएँ और इसे अपने server environment में सेट करें। सभी requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"Key को सर्वर पर रखें। इसे browser code में expose न करें या repository में commit न करें।
इस model ID और इसके inputs के साथ /v1/run पर POST करें। ऊपर दिया गया request example submission और polling दोनों शामिल करता है।
Completed, failed या timeout होने तक poll करने के लिए लौटाए गए run ID का उपयोग करें। Output केवल completed होने के बाद पढ़ें।
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Model के image, video या audio field में सार्वजनिक रूप से उपलब्ध फ़ाइल URL पास करें। समर्थित formats और limits प्रत्येक Playground input के पास दिखाए गए हैं।
Playground में समर्थित image fields पर upload या replace control का उपयोग करें। Video URL fields hosted driving video स्वीकार करते हैं; इससे video-upload support का संकेत नहीं मिलता।
hintstringOptional text naming the parts you want.
imagestringInput image when seg_type is image.
seg_typestringआवश्यकimage segments an image and builds a segmented 3D model; model segments an existing GLB.
डिफ़ॉल्ट: "image"
संभावित मान: "image", "model"
model_urlstringInput GLB when seg_type is model.
transformarrayModel transform as a column-major 4x4 matrix (16 numbers). Used when seg_type is model; identity when unset.
granularitystringHow finely to split.
डिफ़ॉल्ट: "medium"
संभावित मान: "coarse", "medium", "fine"
{
"model": "tripo3d/tripo/smart-segment",
"image": "https://static.sandbase.ai/examples/tencent/hunyuan-3d/v3/input_image_0.png",
"seg_type": "image",
"model_url": "https://static.sandbase.ai/examples/tripo3d/tripo/shared/object.glb",
"granularity": "medium"
}पूरा हुआ run अपना परिणाम output में दिखाता है। नीचे दिया गया model का सेव किया हुआ example है, नई generation नहीं।
अभी तक कोई example output प्रकाशित नहीं किया गया है। अपना response देखने के लिए completed run के बाद Playground → Result → JSON का उपयोग करें।
यह model Tripo के v3 API पर भी उपलब्ध है। Request bodies, task objects और error codes Tripo के अनुरूप हैं, इसलिए base URL को https://api.sandbase.ai/tripo/v3 में बदलने और Authorization: Bearer के रूप में SandBase API key भेजने के बाद मौजूदा Tripo code काम करेगा। Requests Tripo के official channel पर /v1/run के समान मूल्य पर चलती हैं।
POST https://api.sandbase.ai/tripo/v3/mesh/smartsegment। model वैकल्पिक है और Tripo algorithm version चुनता है; इसे छोड़े जाने पर Tripo का default लागू होता है। ऊपर Tripo v3 API के अंतर्गत दिया गया request example एक पूर्ण call दिखाता है।
Tripo इन inputs को नीचे दिए गए Schema से अलग नाम देता है। बाकी सभी फ़ील्ड अपने नाम बनाए रखते हैं।
| स्कीमा फ़ील्ड | Tripo फ़ील्ड |
|---|---|
model_url | input |
image | input |
Inputs सार्वजनिक URLs होते हैं, या तो string के रूप में या url फ़ील्ड वाले object के रूप में। Tripo task ids और file_token मान अभी स्वीकार नहीं किए जाते, file upload उपलब्ध नहीं है, और webhook_url को अनदेखा किया जाता है।
Submission से data.task_id लौटता है। data.status के success, failed या cancelled होने तक poll करें। Success पर, data.output में model_url जैसे Tripo field names होते हैं, और credits_consumed 1 credit = $0.01 पर SandBase charge है।
curl "https://api.sandbase.ai/tripo/v3/tasks/$TASK_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"POST /tripo/v3/tasks/list को {"task_ids": [...]} के साथ उपयोग करने पर अधिकतम 100 tasks लौटते हैं। GET /tripo/v3/account/balance आपके SandBase balance को credits में लौटाता है।
Tripo अपने envelope का उपयोग करता है: {"code": 1004, "status": "error", "message": "..."}।
| code | अर्थ |
|---|---|
2 / 1002 | SandBase API key अनुपस्थित, अमान्य या अधिकृत नहीं है |
1003 | बॉडी JSON object नहीं है |
1004 | पैरामीटर अनुपस्थित या अमान्य है। संदेश Tripo फ़ील्ड का नाम बताता है |
1007 / 2000 | Rate limit या concurrency limit पहुँच गई है |
2001 | Task नहीं मिला, या किसी अन्य API key से बनाया गया था |
2002 | Endpoint या feature SandBase पर समर्थित नहीं है |
2010 | SandBase balance अपर्याप्त है या API key spending limit पहुँच गई है |
4001 | अज्ञात endpoint |
जब Tripo किसी task को अस्वीकार करता है या विफल करता है, तो वह Tripo के error_code और error_message के साथ failed पर समाप्त होता है। आपके अनुरोध या content से संबंधित codes बिना बदलाव के पास किए जाते हैं; upstream Tripo account से संबंधित codes को 1000 के रूप में रिपोर्ट किया जाता है।