Skip to main content

Image to 3D

Overview

This endpoint generates 3D image from image while passing appropriate parameters.

Request

--request POST 'https://stablediffusionapi.com/api/v3/img_to_3d' \

Make a POST request to https://stablediffusionapi.com/api/v3/img_to_3d endpoint and pass the required parameters as a request body.

Body Attributes

ParameterDescription
keyYour API Key used for request authorization.
imageLink to the Initial Image
stepsNumber of denoising steps (minimum: 1; maximum: 50)
guidance_scaleScale for classifier-free guidance (minimum: 1; maximum: 20)
frame_sizeNumber of frame size)
seedSeed is used to reproduce results, same seed will give you same image in return again. Pass null for a random number.
secondsNumber of seconds
batch_sizeNumber of images per prompt
safety_checkerA checker for NSFW images. If such an image is detected, it will be replaced by a blank image.
webhookSet an URL to get a POST API call once the image generation is complete.
track_idThis ID is returned in the response to the webhook API call. This will be used to identify the webhook request.

Example

Body

Body
{
"key":"",
"image":"https://img.freepik.com/premium-photo/red-roses-rose-petals-white-backgroundvalentines-day-concept_167862-5720.jpg",
"guidance_scale":5,
"steps":64,
"frame_size":128,
"batch_size":10,
"seed":20,
"safety_checker":"no",
"seconds":4,
"webhook": null,
"track_id": null
}

Request

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

var raw = JSON.stringify({
"key": "",
"image":"https://img.freepik.com/premium-photo/red-roses-rose-petals-white-backgroundvalentines-day-concept_167862-5720.jpg",
"guidance_scale":5,
"steps":64,
"frame_size":128,
"webhook": null,
"track_id": null
});

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

fetch("https://stablediffusionapi.com/api/v3/img_to_3d", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
"status": "success",
"generationTime": 6,
"id": 326,
"output": [
"https://cdn.stablediffusionapi.com/generations/2d74af44-825c-4cff-9fe9-3716bd40c9fd.gif"
],
"meta": {
"file_prefix": "2d74af44-825c-4cff-9fe9-3716bd40c9fd",
"frame_size": 256,
"guidance_scale": 15,
"negative_prompt": "",
"outdir": "out",
"output_type": "gif",
"prompt": "A birthday cupcake",
"safetychecker": "no",
"seconds": 3,
"seed": 1110454524,
"steps": 64
}
}