Skip to main content

Text to 3D

Overview

This endpoint generates 3D image from text prompt while passing appropriate parameters

Request

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

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

Body Attributes

ParameterDescription
keyYour API Key used for request authorization.
promptText prompt with description of the things you want in the image to be generated.
negative_promptItems you don't want in the 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
output_typeThis is the type of the 3D image you want to generate. It accepts gif or ply.
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":"",
"prompt":"beautiful man",
"guidance_scale":20,
"steps":64,
"frame_size":256,
"output_type":"gif",
"webhook": null,
"track_id": null
}

Request

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

var raw = JSON.stringify({
"key": "",
"prompt":"rose",
"guidance_scale":20,
"steps":64,
"frame_size":256,
"output_type":"gif",
"webhook": null,
"track_id": null
});

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

fetch("https://stablediffusionapi.com/api/v3/txt_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
}
}