Skip to main content

Image to 3D Endpoint

Overview

The Image to 3D API generates a 3D character from an input image.

Open in Playground 🚀

Request

--request POST 'https://modelslab.com/api/v6/3d/image_to_3d' \

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

Body Attributes

ParameterDescriptionValues
key (required)API key for request authorization.String
image (required)The input image to be used for 3D conversion.File (PNG, JPEG, etc.)
output_format (optional)Specifies the format of the generated 3D object.obj, stl, ply (default: glb)
render (optional)Indicates whether to render a NeRF video of the 3D model.Boolean (default: false)
resolution (optional)Resolution of the generated 3D model.Integer (max: 512, default: 256)
multi_image (optional)Processes multiple images together when set to true. Input should include multiple POVs in a transparent PNG.Boolean (default: false)
ss_guidance_strength (optional)Adjusts the strength of style-space guidance for better model refinement.Float (default: 7.5)
ss_sampling_steps (optional)Number of steps for style-space sampling.Integer (range: 1–50, default: 12)
slat_guidance_strength (optional)Strength of slat guidance to refine model details.Float (range: 0.0–10.0, default: 3.0)
slat_sampling_steps (optional)Number of steps for slat guidance sampling.Integer (range: 1–50, default: 12)
mesh_simplify (optional)Controls the degree of mesh simplification to optimize the output.Float (range: 0.90–0.98, default: 0.90)
chunk_size (optional)Specifies the size of processing chunks, which affects VRAM usage.Integer (max: 12000, default: 8192)
seed (optional)Sets a random seed for reproducibility; 0 generates a random seed.Integer (default: 0)
temp (optional)Saves the output files in a temporary directory if set to "yes".String ("yes" or "no", default: "no")
Open in Playground 🚀

Example

Body

Body
{
"key": "",
"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"
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key": "",
"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"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/3d/image_to_3d", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

Example Response
{
"status": "success",
"generationTime": 10.62,
"id": 109655545,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/out/ae46c488-b66c-4aaa-9540-7355261d8d71.obj"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/out/ae46c488-b66c-4aaa-9540-7355261d8d71.obj"
],
"meta": {
"chunk_size": 8192,
"file_prefix": "ae46c488-b66c-4aaa-9540-7355261d8d71",
"foreground_ratio": ".85",
"image": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/0335d02b-958a-4a7f-b7e4-a5f1e61efbf1-0.png",
"remove_bg": true,
"render": false,
"resolution": 256,
"seed": 3480183101,
"temp": "no"
}
}