Skip to main content

Multiview Endpoint

Overview

This endpoint takes one input image and generates multiple views of that same image. Note that images of objects and images without a background produces better result.

Image to image endpoint result

Request

--request POST 'https://stablediffusionapi.com/api/v5/multiview' \

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

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
imageinitial image url
widthWidth of generated images. Default: 640px. Max: 1024px
heightHeight of generated images. Default: 960px. Max: 1024px
temp"yes" if you want proxy links to access images apart from normal links. Useful in case your country blocks our storage provider. Default: "no"
num_inference_stepsNumber of denoising steps (minimum: 1; maximum: 50)
guidance_scaleScale for classifier-free guidance (minimum: 1; maximum: 20)
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":"",
"seed":12345,
"image":"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/0558bcce-cba0-4157-963f-9374b53d68d9.png",
"prompt": "make multiple images",
"width": 640,
"height":960,
"num_inference_steps":50,
"guidance_scale":4,
"temp":"no",
"webhook": null,
"track_id": null
}

Request

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

var raw = JSON.stringify({
"key":"",
"seed":12345,
"image":"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/0558bcce-cba0-4157-963f-9374b53d68d9.png",
"prompt": "make multiple images",
"width": 640,
"height":960,
"num_inference_steps":50,
"guidance_scale":4,
"temp":"no",
"webhook": null,
"track_id": null
});

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

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

Response

Example Response

{
"status": "success",
"generationTime": 13.116175889968872,
"id": 657,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/2ee9e794-7b5a-4e2d-80b1-7e6a943a8a36.png"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/2ee9e794-7b5a-4e2d-80b1-7e6a943a8a36.png"
],
"meta": {
"file_prefix": "2ee9e794-7b5a-4e2d-80b1-7e6a943a8a36",
"guidance_scale": 4,
"height": 960,
"image": "https://cdn2.stablediffusionapi.com/generations/2874812851699698333.png",
"num_inference_steps": 50,
"outdir": "out",
"prompt": "make multiple images",
"seed": 12345,
"temp": "no",
"width": 640
}
}