Introduction
Create session from image-to-3d.
Create Session
Request
POST /image-to-3d-sessions
Parameters
image_url REQUIRED
type : string
in : body
description : URL of the image to be converted into the 3d
model_version OPTIONAL
type : string
in : body
default : ""
example : "1.0"
description : Try the latest beta model
auto_gen_3d OPTIONAL
type : boolean
in : body
default : false
description : Call auto generate 3D
Code Snippets
Python
import requests
import json
url = "https://api.csm.ai:5566/image-to-3d-sessions"
payload = json.dumps({
"image_url": "https://via.placeholder.com/300/09f/fff.png"
})
headers = {
'x-api-key': '<X-API_KEY>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Node.js
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.csm.ai:5566/image-to-3d-sessions',
'headers': {
'x-api-key': '<X-API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"image_url": "https://via.placeholder.com/300/09f/fff.png"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Curl
curl -k --location 'https://api.csm.ai:5566/image-to-3d-sessions' \
--header 'x-api-key: <X-API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"image_url":"https://via.placeholder.com/300/09f/fff.png"
}'
Response
{
"error": "",
"message": "Created",
"statusCode": 201,
"data": {
"user_id": null,
"session_code": "SESSION_1689255965_4270760",
"image_url": "https://via.placeholder.com/300/09f/fff.png",
"input_image": "",
"discord_user_id": "",
"user_name": "",
"email": "",
"mesh_url_usdz": "",
"mesh_url_glb": "",
"mesh_url": "",
"mp4_url": "",
"mesh_url_zip":"",
"preview_mesh_url_zip":"",
"preview_mesh_url_glb":"",
"preview_mesh_url_usdz":"",
"polished_mesh_url_usdz":"",
"polished_mesh_url_glb":"",
"polished_mesh_url":"",
"mesh_url_obj":"",
"session_gif": "",
"percentage": 0,
"experimental_model": false,
"status": "uploaded",
"debug": false,
"source": "external",
"private":true,
"demo":false,
"price":0,
"random_poses": true,
"inference": [
{
"image_name": "U1.png",
"image_url": "https://imageto3d.blob.core.windows.net/data/inference_outputs/dkvora@yopmail.com/SESSION_1689658968_4249973/U1.png?se=2032-09-01T13%3A42%3A55Z&sp=r&sv=2022-11-02&sr=b&sig=buBTaQRmIX%2BEWhegBUq3rzu5aTPnyOogJ7t54KpIpU0%3D",
"height": 256,
"width": 256
},
{
"image_name": "U2.png",
"image_url": "https://imageto3d.blob.core.windows.net/data/inference_outputs/dkvora@yopmail.com/SESSION_1689658968_4249973/U2.png?se=2032-09-01T13%3A42%3A55Z&sp=r&sv=2022-11-02&sr=b&sig=0/KWzeAN3zuUtCz00DshsXyiXZwNWTZXzySZEAdP18c%3D",
"height": 256,
"width": 256
},
{
"image_name": "U3.png",
"image_url": "https://imageto3d.blob.core.windows.net/data/inference_outputs/dkvora@yopmail.com/SESSION_1689658968_4249973/U3.png?se=2032-09-01T13%3A42%3A55Z&sp=r&sv=2022-11-02&sr=b&sig=AKCqQ4KqOtzTBoozNrTtZsq/KTYYeeCveVaPQ474LHs%3D",
"height": 256,
"width": 256
},
{
"image_name": "U4.png",
"image_url": "https://imageto3d.blob.core.windows.net/data/inference_outputs/dkvora@yopmail.com/SESSION_1689658968_4249973/U4.png?se=2032-09-01T13%3A42%3A55Z&sp=r&sv=2022-11-02&sr=b&sig=rXmnVlAxfzKq/szqAHhn07T7bwszGD3u/LPVeVDu2oE%3D",
"height": 256,
"width": 256
}],
"output_id": "0e1e4b11-b1ec-43ba-96e4-2a01060a347e",
"_id": "64b0001d4af23fdbd514dda7",
"user_image":"",
"model_version":"1.0",
"is_deleted":false,
"created_at": "2023-07-13T13:46:05.884Z",
"updated_at": "2023-07-13T13:46:05.884Z"
}
}