Image-to-3d
1 Create Session

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_resolution REQUIRED
type : string
in : body
default : "high"
example : "high"
description : Model Resolution for session. Available options : high,low


pixel_alignment REQUIRED
type : string
in : body
default : "highest"
example : "highest"
description : Pixel Alignment for session. Available options : highest, moderate, lowest


preview_mesh REQUIRED
type : string
in : body
default : "turbo"
example : "turbo"
description : Preview Mesh for session. Available options : turbo, hd


diffusion_time_steps OPTIONAL
type : number
in : body
default : 20
example : 20
description : Diffusion Time Steps for session. _Available range : 16 To 200


auto_gen_3d OPTIONAL
type : boolean
in : body
default : false
description : Call auto generate 3D


topology OPTIONAL
type : string
in : body
default : ""
example : "tris"
description : Topology for enterprise user. Available options : tris,quads
Note : This option is available for the enterprise users only.


resolution OPTIONAL
type : string
in : body
default : ""
description : Resolution for enterprise user. Available resolution : low_poly,high_poly
Note : This option is available for the enterprise users only.


texture_resolution OPTIONAL
type : number
in : body
default : ""
example : 0
description : Resolution for enterprise user. Available texture resolution : 128, 256, 512, 1024, 2048
Note : This option is available for the enterprise users only.

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",
  "preview_mesh": "turbo",
  "pixel_alignment": "lowest",
  "model_resolution": "low"
})
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",
  "preview_mesh": "turbo",
  "pixel_alignment": "lowest",
  "model_resolution": "low"
})

};
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",
  "preview_mesh": "turbo",
  "pixel_alignment": "lowest",
  "model_resolution": "low"
}'

Response

{
    "error": "",
    "message": "Created",
    "statusCode": 201,
    "data": {
        "_id": "65d5c6ef3fa05a56705af77d",
        "user_id": "652d54ef642585b4048a3ecf",
        "session_code": "SESSION_1708502346_4237483",
        "image_url": "https://via.placeholder.com/300/09f/fff.png",
        "input_image": "",
        "caption": "",
        "discord_user_id": "",
        "user_name": "",
        "email": "test@email.com",
        "preview_mesh_url": "",
        "mesh_url_usdz": "",
        "mesh_url_glb": "",
        "reactions_count": 0,
        "emoji_reactions": {
            "heart": 0,
            "fire": 0,
            "exploding_head": 0,
            "meh": 0,
            "dislike": 0
        },
        "texture_resolution": 2048,
        "mesh_url": "",
        "polished_mesh_url_usdz": "",
        "polished_mesh_url_glb": "",
        "polished_mesh_url": "",
        "mesh_url_obj": "",
        "mesh_url_zip": "",
        "preview_mesh_url_zip": "",
        "preview_mesh_url_glb": "",
        "preview_mesh_url_usdz": "",
        "preview_mesh_url_fbx": "",
        "mesh_url_fbx": "",
        "mp4_url": "",
        "designer_mesh_url": "",
        "preview_mesh_url_3mf": "",
        "mesh_url_3mf": "",
        "session_gif": "",
        "user_image": "",
        "percentage": 0,
        "price": 0,
        "status": "spin_generate_processing",
        "topology": "tris",
        "resolution": "high_poly",
        "source": "web",
        "demo": false,
        "user_demo": false,
        "private": true,
        "debug": false,
        "random_poses": true,
        "inference": [],
        "output_id": "b8ef0e62-6ba6-4a21-b6bc-607d97250770",
        "animated_walk_url": "",
        "animated_run_url": "",
        "animated_jump_url": "",
        "auto_gen_3d": false,
        "server_type": "fast",
        "model_version": "2.0",
        "selected_spin": "",
        "is_deleted": false,
        "tier_at_creation": "enterprise",
        "reaction_by_admin": "",
        "manual_segmentation": false,
        "preview_mesh": "turbo",
        "pixel_alignment": "highest",
        "model_resolution": "high",
        "product_version": "1.0.0",
        "diffusion_time_steps": 32,
        "selected_spin_index": 0,
        "spins": [],
        "created_at": "2024-02-21T09:48:31.604Z",
        "updated_at": "2024-02-21T09:48:31.604Z"
    }
}