रीटेक्सचर API एक ऐसी सुविधा है जो आपको Meshy की AI रीटेक्सचरिंग क्षमताओं को अपने खुद के एप्लिकेशन में इंटीग्रेट करने की अनुमति देती है। इस सेक्शन में, आपको इस API के साथ शुरुआत करने के लिए
आवश्यक सभी जानकारी मिलेगी।
यह एंडपॉइंट आपको एक नया Retexture टास्क बनाने की अनुमति देता है। किन प्रॉपर्टीज़ Retexture टास्क ऑब्जेक्ट में शामिल हैं, यह देखने के लिए
The Retexture Task Object देखें।
पैरामीटर
input_task_id या model_url में से केवल एक आवश्यक है। यदि दोनों दिए जाते हैं, तो input_task_id को प्राथमिकता मिलती है।
Name
input_task_id
Type
string
आवश्यक
Description
उस पूर्ण हो चुके इमेज से 3D या टेक्स्ट से 3D टास्क की ID, जिसे आप रीटेक्सचर करना चाहते हैं।
यह टास्क निम्न में से एक होना चाहिए: टेक्स्ट से 3D Preview, टेक्स्ट से 3D Refine, इमेज से 3D या रीमेश। इसके अलावा, इसकी स्थिति SUCCEEDED होनी चाहिए।
Name
model_url
Type
string
आवश्यक
Description
Meshy को टेक्सचर करने के लिए एक 3D मॉडल प्रदान करें। समर्थित फॉर्मैट: .glb, .gltf, .obj, .fbx, .stl.
मॉडल प्रदान करने के दो तरीके हैं:
सार्वजनिक रूप से एक्सेस करने योग्य URL: एक URL जो सार्वजनिक इंटरनेट से एक्सेस किया जा सकता है।
Data URI: मॉडल का एक base64-एन्कोडेड data URI। MIME type application/octet-stream का उपयोग करें। उदाहरण: data:application/octet-stream;base64,<your base64-encoded model data>.
ठीक एक स्टाइल इनपुट आवश्यक है: text_style_prompt, image_style_url, या multiview_image_urls। multiview_image_urls को अन्य दोनों में से किसी के साथ नहीं जोड़ा जा सकता; यदि text_style_prompt और image_style_url दोनों दिए जाते हैं, तो image_style_url को प्राथमिकता मिलती है।
Name
text_style_prompt
Type
string
आवश्यक
Description
टेक्स्ट का उपयोग करके ऑब्जेक्ट की अपनी वांछित टेक्सचर स्टाइल का वर्णन करें। अधिकतम 800 अक्षर।
Name
image_style_url
Type
string
आवश्यक
Description
टेक्सचरिंग प्रक्रिया को गाइड करने के लिए एक 2d इमेज प्रदान करें। हम वर्तमान में .jpg, .jpeg, और .png फॉर्मैट का समर्थन करते हैं।
इमेज प्रदान करने के दो तरीके हैं:
सार्वजनिक रूप से एक्सेस करने योग्य URL: एक URL जो सार्वजनिक इंटरनेट से एक्सेस किया जा सकता है
Data URI: इमेज का एक base64-एन्कोडेड data URI। data URI का उदाहरण: data:image/jpeg;base64,<your base64-encoded image data>
यदि मूल एसेट और अपलोड की गई इमेज के बीच ज्यामिति में पर्याप्त अंतर हो, तो इमेज टेक्सचरिंग सर्वोत्तम ढंग से काम नहीं कर सकती है।
Name
multiview_image_urls
Type
string[]
आवश्यक
Description
टेक्सचरिंग को गाइड करने के लिए अलग-अलग व्यू से एक ही ऑब्जेक्ट दिखाने वाली 1 से 4 इमेज प्रदान करें। पहली इमेज प्राइमरी (फ्रंट) व्यू है; शेष व्यू (left, back, right) का क्रम मायने नहीं रखता।
प्रत्येक एलिमेंट वही फॉर्मैट स्वीकार करता है जो image_style_url करता है (एक सार्वजनिक रूप से एक्सेस करने योग्य URL या एक base64 data URI, .jpg/.jpeg/.png)।
इसके लिए स्पष्ट रूप से ai_model: "meshy-7" आवश्यक है।
Name
ai_model
Type
string
डिफ़ॉल्ट latest
Description
रीटेक्सचरिंग के लिए उपयोग किए जाने वाले AI मॉडल की ID। उपलब्ध मान: meshy-5, meshy-6, meshy-7, latest (Meshy 7)।
Name
enable_original_uv
Type
boolean
डिफ़ॉल्ट false
Description
नया UV लेआउट जनरेट करने के बजाय मॉडल का मौजूदा UV लेआउट बनाए रखें।
यदि आप ऐसे मॉडल को रीटेक्सचर कर रहे हैं जिसे Meshy ने जनरेट किया है (input_task_id के माध्यम से, या ऐसा model_url जो किसी Meshy आउटपुट की ओर संकेत करता है), तो इसके ऑप्टिमाइज़्ड UV लेआउट को फिर से उपयोग करने के लिए इसे true सेट करें।
यदि आप अपने द्वारा अपलोड किए गए थर्ड-पार्टी मॉडल को रीटेक्सचर कर रहे हैं, तो true सेट करें जब इसमें पहले से अच्छे UV हों जिन्हें आप बनाए रखना चाहते हैं, या Meshy को नए UV अनरैप करने देने के लिए इसे false छोड़ दें (उन मॉडलों के लिए सर्वोत्तम जिनमें उचित UV मैपिंग नहीं है)।
Name
enable_pbr
Type
boolean
डिफ़ॉल्ट false
Description
बेस कलर के अलावा PBR मैप (metallic, roughness, normal) जनरेट करें। जब ai_model, meshy-6 हो तो एक emission map भी शामिल होता है, सिवाय texture_resolution: 8k के। meshy-7 और latest emission map प्रोड्यूस नहीं करते हैं।
Name
texture_resolution
Type
string
डिफ़ॉल्ट 2k
Description
बेस कलर टेक्सचर रिज़ॉल्यूशन। 2k (2048×2048), 4k (4096×4096), या 8k (8192×8192) में से एक। उच्चतर रिज़ॉल्यूशन अधिक सतह विवरण कैप्चर करते हैं।
4k और 8k के लिए ai_modelmeshy-6, meshy-7 या latest आवश्यक है। 8k पर, कोई emission map प्रोड्यूस नहीं होता है।
Name
hd_texture
Type
boolean
⚠ पुराना
डिफ़ॉल्ट false
Description
इसके बजाय texture_resolution का उपयोग करें — यह texture_resolution: "4k" के बराबर है। जब दोनों सेट किए जाते हैं, तो texture_resolution को प्राथमिकता मिलती है।
Name
remove_lighting
Type
boolean
डिफ़ॉल्ट true
Description
बेस कलर टेक्सचर से हाइलाइट्स और शैडो हटा देता है, जिससे एक साफ-सुथरा परिणाम मिलता है जो कस्टम लाइटिंग सेटअप के तहत बेहतर काम करता है।
केवल तभी समर्थित है जब ai_model, meshy-6 हो।
Name
target_formats
Type
string[]
Description
निर्दिष्ट करता है कि आउटपुट में कौन से 3D फ़ाइल फॉर्मैट शामिल किए जाएं। केवल अनुरोधित फॉर्मैट ही जनरेट और रिटर्न किए जाएंगे, जिससे टास्क पूर्ण होने का समय कम हो सकता है। जब छोड़ दिया जाता है, तो सभी समर्थित फॉर्मैट शामिल होते हैं।
उपलब्ध मान: glb, obj, fbx, stl, usdz, 3mf
जब छोड़ दिया जाता है, तो 3mf को छोड़कर सभी फॉर्मैट जनरेट किए जाते हैं। 3mf केवल तभी शामिल होता है जब इसे स्पष्ट रूप से निर्दिष्ट किया गया हो।
Name
alpha_thumbnail
Type
boolean
डिफ़ॉल्ट false
Description
जब true पर सेट किया जाता है, तो टास्क अतिरिक्त रूप से प्रीव्यू का एक ट्रांसपेरेंट-बैकग्राउंड (RGBA) वर्ज़न रेंडर करता है और इसे GET रिस्पॉन्स पर alpha_thumbnail_url के रूप में रिटर्न करता है। मौजूदा thumbnail_url फ़ील्ड में कोई बदलाव नहीं होता है।
रिटर्न
रिस्पॉन्स की result प्रॉपर्टी में नए बनाए गए Retexture टास्क की टास्क id होती है।
विफलता के मोड
Name
400 - Bad Request
Description
अनुरोध अस्वीकार्य था। सामान्य कारण:
पैरामीटर गुम है: model_url या input_task_id में से एक अवश्य दिया जाना चाहिए।
स्टाइल गुम है: text_style_prompt, image_style_url या multiview_image_urls में से एक अवश्य दिया जाना चाहिए।
परस्पर विरोधी स्टाइल इनपुट: multiview_image_urls को text_style_prompt या image_style_url के साथ नहीं जोड़ा जा सकता।
मल्टी-व्यू के लिए असमर्थित मॉडल: multiview_image_urls के लिए स्पष्ट रूप से ai_model: "meshy-7" आवश्यक है।
मॉडल उपलब्ध नहीं है: ai_model: "meshy-7" को क्रमिक रूप से रोल आउट किया जा रहा है और अभी तक आपके अकाउंट के लिए सक्षम नहीं किया गया है।
अमान्य इनपुट टास्क: input_task_id को किसी समर्थित मॉडल से एक सफल टास्क का संदर्भ देना चाहिए।
अमान्य मॉडल फॉर्मैट: model_url एक असमर्थित एक्सटेंशन वाली फ़ाइल की ओर संकेत करता है।
अगम्य URL: model_url, image_style_url या एक multiview_image_urls एलिमेंट को डाउनलोड नहीं किया जा सका।
Name
401 - Unauthorized
Description
प्रमाणीकरण विफल रहा। कृपया अपनी API की जांचें।
Name
402 - Payment Required
Description
यह टास्क करने के लिए अपर्याप्त क्रेडिट।
Name
429 - Too Many Requests
Description
आपने अपनी रेट लिमिट पार कर ली है।
Request
POST
/openapi/v1/retexture
# Retexture with text promptcurlhttps://api.meshy.ai/openapi/v1/retexture \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "text_style_prompt": "red fangs, Samurai outfit that fused with japanese batik style", "enable_original_uv": true, "enable_pbr": true }'# Retexture with image style and PBRcurlhttps://api.meshy.ai/openapi/v1/retexture \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "model_url": "https://cdn.meshy.ai/model/example_model_2.glb", "image_style_url": "https://cdn.meshy.ai/image/example_image.jpg", "ai_model": "latest", "enable_pbr": true, "enable_original_uv": true }'
यह एंडपॉइंट आपको किसी वैध टास्क id के लिए Retexture टास्क प्राप्त करने की अनुमति देता है।
Retexture टास्क ऑब्जेक्ट के साथ कौन-सी प्रॉपर्टीज़ शामिल हैं, यह देखने के लिए
The Retexture Task Object देखें।
पैरामीटर
Name
id
Type
path
Description
प्राप्त किए जाने वाले Retexture टास्क का यूनीक आइडेंटिफ़ायर।
रिटर्न्स
रिस्पॉन्स में Retexture टास्क ऑब्जेक्ट शामिल होता है। विवरण के लिए
The Retexture Task Object सेक्शन देखें।
{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"retexture","model_urls": {"glb":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***","fbx":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***","obj":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.obj?Expires=***","usdz":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***","mtl":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.mtl?Expires=***","stl":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.stl?Expires=***" },"thumbnail_url":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***","text_style_prompt":"red fangs, Samurai outfit that fused with japanese batik style","texture_image_url":"","progress":100,"started_at":1692771667037,"created_at":1692771650657,"expires_at":1692771679037,"finished_at":1692771669037,"status":"SUCCEEDED","texture_urls": [ {"base_color":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***","metallic":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX","normal":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX","roughness":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX","emission":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ],"task_error": {"message":"" },"consumed_credits":10}
[ {"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"retexture","model_urls": {"glb":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***","fbx":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***","usdz":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***" },"thumbnail_url":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***","text_style_prompt":"red fangs, Samurai outfit that fused with japanese batik style","progress":100,"started_at":1692771667037,"created_at":1692771650657,"expires_at":1692771679037,"finished_at":1692771669037,"status":"SUCCEEDED","texture_urls": [ {"base_color":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***","metallic":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX","normal":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX","roughness":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX","emission":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ],"preceding_tasks":0,"task_error": {"message":"" },"consumed_credits":10 }]
Retexture Task ऑब्जेक्ट एक ऐसी कार्य इकाई है जिसका उपयोग Meshy टेक्स्ट या इमेज इनपुट से 3D टेक्सचर जनरेट करने के लिए करता है।
इस मॉडल में निम्नलिखित properties हैं:
Properties
Name
id
Type
string
Description
टास्क के लिए यूनीक पहचानकर्ता। हालांकि हम कार्यान्वयन विवरण के रूप में टास्क id के लिए k-sortable UUID का उपयोग करते हैं,
आपको id के फॉर्मेट के बारे में कोई भी धारणा नहीं बनानी चाहिए।
Name
type
Type
string
Description
Retexture टास्क का प्रकार। इसका मान retexture है।
Name
model_urls
Type
object
Description
Meshy द्वारा जनरेट की गई टेक्सचर्ड 3D मॉडल फ़ाइल का डाउनलोड करने योग्य URL।
Name
glb
Type
string
Description
GLB फ़ाइल का डाउनलोड करने योग्य URL।
Name
fbx
Type
string
Description
FBX फ़ाइल का डाउनलोड करने योग्य URL।
Name
obj
Type
string
Description
OBJ फ़ाइल का डाउनलोड करने योग्य URL।
Name
usdz
Type
string
Description
USDZ फ़ाइल का डाउनलोड करने योग्य URL।
Name
mtl
Type
string
Description
MTL फ़ाइल का डाउनलोड करने योग्य URL, जो टेक्सचर मौजूद होने पर OBJ एक्सपोर्ट के साथ लौटाई जाती है।
Name
stl
Type
string
Description
STL फ़ाइल का डाउनलोड करने योग्य URL।
Name
3mf
Type
string
Description
3MF फ़ाइल का डाउनलोड करने योग्य URL। यह केवल तभी मौजूद होता है जब target_formats के माध्यम से 3mf का अनुरोध किया गया हो।
Name
text_style_prompt
Type
string
Description
यह वह टेक्स्ट prompt है जिसका उपयोग टेक्सचरिंग टास्क बनाने के लिए किया गया था।
Name
image_style_url
Type
string
Description
यह वह इमेज इनपुट है जिसका उपयोग टेक्सचरिंग टास्क बनाने के लिए किया गया था।
Name
multiview_image_urls
Type
string[]
Description
उन मल्टी-व्यू संदर्भ इमेजों के डाउनलोड करने योग्य URL जिनका उपयोग टेक्सचरिंग टास्क बनाने के लिए किया गया था। यह केवल तभी मौजूद होता है जब टास्क multiview_image_urls के साथ बनाया गया हो।
Name
thumbnail_url
Type
string
Description
मॉडल फ़ाइल की थंबनेल इमेज का डाउनलोड करने योग्य URL।
Name
alpha_thumbnail_url
Type
string
Description
thumbnail_url के पारदर्शी-बैकग्राउंड (RGBA) संस्करण का डाउनलोड करने योग्य URL। यह केवल तभी मौजूद होता है जब टास्क alpha_thumbnail: true के साथ बनाया गया हो और पारदर्शी प्रीव्यू सफलतापूर्वक रेंडर हुआ हो; अन्यथा यह फ़ील्ड छोड़ दिया जाता है।
Name
progress
Type
integer
Description
टास्क की progress। यदि टास्क अभी शुरू नहीं हुआ है, तो यह property 0 होगी। एक बार टास्क सफल हो जाने पर, यह 100 हो जाएगी।
Name
started_at
Type
timestamp
Description
टास्क कब शुरू हुआ था, इसका टाइमस्टैंप, मिलीसेकंड में। यदि टास्क अभी शुरू नहीं हुआ है, तो यह property 0 होगी।
एक टाइमस्टैंप RFC 3339 मानक के अनुसार, 1 जनवरी, 1970 UTC से बीते मिलीसेकंडों की संख्या को दर्शाता है।
उदाहरण के लिए, शुक्रवार, 1 सितंबर, 2023 12:00:00 PM GMT को 1693569600000 के रूप में दर्शाया जाता है। यह Meshy API में सभी टाइमस्टैंप पर लागू होता है।
Name
created_at
Type
timestamp
Description
टास्क कब बनाया गया था, इसका टाइमस्टैंप, मिलीसेकंड में।
Name
expires_at
Type
timestamp
Description
टास्क का परिणाम कब समाप्त होगा, इसका टाइमस्टैंप, मिलीसेकंड में।
Name
finished_at
Type
timestamp
Description
टास्क कब समाप्त हुआ था, इसका टाइमस्टैंप, मिलीसेकंड में। यदि टास्क अभी समाप्त नहीं हुआ है, तो यह property 0 होगी।
Name
status
Type
string
Description
टास्क की स्थिति। संभावित मान PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED में से कोई एक है।
Name
texture_urls
Type
array
Description
टास्क से जनरेट किए गए texture URL ऑब्जेक्ट्स की एक array। सामान्यतः इसमें केवल एक ही texture URL ऑब्जेक्ट होता है। प्रत्येक texture URL में निम्नलिखित properties होती हैं:
Name
base_color
Type
string
Description
बेस कलर मैप इमेज का डाउनलोड करने योग्य URL।
Name
metallic
Type
string
Description
मेटैलिक मैप इमेज का डाउनलोड करने योग्य URL।
यदि टास्क enable_pbr: false के साथ बनाया गया है, तो यह property छोड़ दी जाएगी।
Name
normal
Type
string
Description
नॉर्मल मैप इमेज का डाउनलोड करने योग्य URL।
यदि टास्क enable_pbr: false के साथ बनाया गया है, तो यह property छोड़ दी जाएगी।
Name
roughness
Type
string
Description
रफनेस मैप इमेज का डाउनलोड करने योग्य URL।
यदि टास्क enable_pbr: false के साथ बनाया गया है, तो यह property छोड़ दी जाएगी।
Name
emission
Type
string
Description
एमिशन मैप इमेज का डाउनलोड करने योग्य URL।
यदि टास्क enable_pbr: false के साथ बनाया गया है, या ai_model, meshy-5 है, तो यह property छोड़ दी जाएगी।
Name
preceding_tasks
Type
integer
Description
पूर्ववर्ती टास्क की संख्या।
यह property केवल तभी मौजूद होती है जब टास्क की स्थिति PENDING हो।
Name
task_error
Type
object
Description
विफल टास्क के लिए एरर विवरण। पूर्ण task_error ऑब्जेक्ट संदर्भ के लिए एरर देखें।
Name
consumed_credits
Type
integer
Description
इस टास्क द्वारा उपयोग किए गए क्रेडिट की संख्या। यह तब मौजूद होती है जब टास्क की स्थिति PENDING, IN_PROGRESS, या SUCCEEDED हो। FAILED टास्क के लिए 0 लौटाता है (विफलता पर क्रेडिट वापस कर दिए जाते हैं)।
Example Retexture Task Model
{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"retexture","model_urls": {"glb":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.glb?Expires=***","fbx":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.fbx?Expires=***","usdz":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/model.usdz?Expires=***" },"text_style_prompt":"red fangs, Samurai outfit that fused with japanese batik style","image_style_url":"https://assets.meshy.ai/***/image/example_image.jpg?Expires=***","thumbnail_url":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/preview.png?Expires=***","progress":100,"started_at":1692771667037,"created_at":1692771650657,"expires_at":1692771679037,"finished_at":1692771669037,"status":"SUCCEEDED","texture_urls": [ {"base_color":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0.png?Expires=***","metallic":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_metallic.png?Expires=XXX","normal":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_normal.png?Expires=XXX","roughness":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_roughness.png?Expires=XXX","emission":"https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/texture_0_emission.png?Expires=XXX" } ],"preceding_tasks":0,"task_error": {"message":"" },"consumed_credits":10}