Skip to main content
POST
/
3d
/
image_to_3d
Generate 3D model from image
curl --request POST \
  --url https://modelslab.com/api/v6/3d/image_to_3d \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "<string>",
  "init_image": "<string>",
  "output_format": "glb",
  "render": false,
  "resolution": 256,
  "multi_image": false,
  "ss_guidance_strength": 7.5,
  "ss_sampling_steps": 12,
  "slat_guidance_strength": 3,
  "slat_sampling_steps": 12,
  "mesh_simplify": 0.9,
  "chunk_size": 8192,
  "seed": 0,
  "temp": "no",
  "webhook": "<string>",
  "track_id": "<string>"
}
'
import requests

url = "https://modelslab.com/api/v6/3d/image_to_3d"

payload = {
    "key": "<string>",
    "init_image": "<string>",
    "output_format": "glb",
    "render": False,
    "resolution": 256,
    "multi_image": False,
    "ss_guidance_strength": 7.5,
    "ss_sampling_steps": 12,
    "slat_guidance_strength": 3,
    "slat_sampling_steps": 12,
    "mesh_simplify": 0.9,
    "chunk_size": 8192,
    "seed": 0,
    "temp": "no",
    "webhook": "<string>",
    "track_id": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    key: '<string>',
    init_image: '<string>',
    output_format: 'glb',
    render: false,
    resolution: 256,
    multi_image: false,
    ss_guidance_strength: 7.5,
    ss_sampling_steps: 12,
    slat_guidance_strength: 3,
    slat_sampling_steps: 12,
    mesh_simplify: 0.9,
    chunk_size: 8192,
    seed: 0,
    temp: 'no',
    webhook: '<string>',
    track_id: '<string>'
  })
};

fetch('https://modelslab.com/api/v6/3d/image_to_3d', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://modelslab.com/api/v6/3d/image_to_3d",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'key' => '<string>',
    'init_image' => '<string>',
    'output_format' => 'glb',
    'render' => false,
    'resolution' => 256,
    'multi_image' => false,
    'ss_guidance_strength' => 7.5,
    'ss_sampling_steps' => 12,
    'slat_guidance_strength' => 3,
    'slat_sampling_steps' => 12,
    'mesh_simplify' => 0.9,
    'chunk_size' => 8192,
    'seed' => 0,
    'temp' => 'no',
    'webhook' => '<string>',
    'track_id' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://modelslab.com/api/v6/3d/image_to_3d"

	payload := strings.NewReader("{\n  \"key\": \"<string>\",\n  \"init_image\": \"<string>\",\n  \"output_format\": \"glb\",\n  \"render\": false,\n  \"resolution\": 256,\n  \"multi_image\": false,\n  \"ss_guidance_strength\": 7.5,\n  \"ss_sampling_steps\": 12,\n  \"slat_guidance_strength\": 3,\n  \"slat_sampling_steps\": 12,\n  \"mesh_simplify\": 0.9,\n  \"chunk_size\": 8192,\n  \"seed\": 0,\n  \"temp\": \"no\",\n  \"webhook\": \"<string>\",\n  \"track_id\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://modelslab.com/api/v6/3d/image_to_3d")
  .header("Content-Type", "application/json")
  .body("{\n  \"key\": \"<string>\",\n  \"init_image\": \"<string>\",\n  \"output_format\": \"glb\",\n  \"render\": false,\n  \"resolution\": 256,\n  \"multi_image\": false,\n  \"ss_guidance_strength\": 7.5,\n  \"ss_sampling_steps\": 12,\n  \"slat_guidance_strength\": 3,\n  \"slat_sampling_steps\": 12,\n  \"mesh_simplify\": 0.9,\n  \"chunk_size\": 8192,\n  \"seed\": 0,\n  \"temp\": \"no\",\n  \"webhook\": \"<string>\",\n  \"track_id\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://modelslab.com/api/v6/3d/image_to_3d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"key\": \"<string>\",\n  \"init_image\": \"<string>\",\n  \"output_format\": \"glb\",\n  \"render\": false,\n  \"resolution\": 256,\n  \"multi_image\": false,\n  \"ss_guidance_strength\": 7.5,\n  \"ss_sampling_steps\": 12,\n  \"slat_guidance_strength\": 3,\n  \"slat_sampling_steps\": 12,\n  \"mesh_simplify\": 0.9,\n  \"chunk_size\": 8192,\n  \"seed\": 0,\n  \"temp\": \"no\",\n  \"webhook\": \"<string>\",\n  \"track_id\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {
    "chunk_size": 123,
    "file_prefix": "<string>",
    "foreground_ratio": "<string>",
    "guidance_scale": 123,
    "image": "<string>",
    "negative_prompt": "<string>",
    "num_inference_steps": 123,
    "output_format": "<string>",
    "prompt": "<string>",
    "remove_bg": true,
    "render": true,
    "resolution": 123,
    "seed": 123,
    "temp": "<string>",
    "ss_guidance_strength": 123,
    "ss_sampling_steps": 123,
    "slat_guidance_strength": 123,
    "slat_sampling_steps": 123,
    "mesh_simplify": 123,
    "multi_image": true,
    "texture_size": 123
  }
}
{
  "status": "error",
  "message": "<string>"
}

Request

Make a POST request to below endpoint and pass the required parameters as a request body to the endpoint.
curl
--request POST 'https://modelslab.com/api/v6/3d/image_to_3d' \

Body

json
{    
    "key": "your_api_key",    
    "init_image": "https://i.pinimg.com/736x/7c/83/64/7c83645c903677dd93ef50fe953dceea.jpg",    
    "ss_sampling_steps" : 50,    
    "slat_sampling_steps" : 50,    
    "output_format":"glb",    
    "webhook": null,    
    "track_id": null,    
    "temp": "no"
}

Body

application/json
key
string
required

API key for request authorization

init_image
string

The input image URL or file path to be used for 3D conversion

output_format
enum<string>
default:glb

Specifies the format of the generated 3D object

Available options:
obj,
stl,
ply,
glb
render
boolean
default:false

Indicates whether to render a NeRF video of the 3D model

resolution
integer
default:256

Resolution of the generated 3D model

Required range: x <= 512
multi_image
boolean
default:false

Processes multiple images together when set to true

ss_guidance_strength
number
default:7.5

Adjusts the strength of style-space guidance for better model refinement

ss_sampling_steps
integer
default:12

Number of steps for style-space sampling

Required range: 1 <= x <= 50
slat_guidance_strength
number
default:3

Strength of slat guidance to refine model details

Required range: 0 <= x <= 10
slat_sampling_steps
integer
default:12

Number of steps for slat guidance sampling

Required range: 1 <= x <= 50
mesh_simplify
number
default:0.9

Controls the degree of mesh simplification to optimize the output

Required range: 0.9 <= x <= 0.98
chunk_size
integer
default:8192

Specifies the size of processing chunks, which affects VRAM usage

Required range: x <= 12000
seed
integer
default:0

Sets a random seed for reproducibility; 0 generates a random seed

temp
enum<string>
default:no

Saves the output files in a temporary directory if set to 'yes'

Available options:
yes,
no
webhook
string | null

Webhook URL for completion notification

track_id
string | null

Custom tracking ID for the request

Response

3D generation response

status
enum<string>
Available options:
success
generationTime
number

Time taken to generate the 3D model in seconds

id
integer

Unique identifier for the generation request

output
string<uri>[]

Array of URLs to the generated 3D files

Array of proxy URLs for the generated 3D files

meta
object

Metadata about the generation process and parameters used