Skip to main content

Enterprise: 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.

Multiview endpoint result
caution

Make sure you add your s3 details for image_editing server, so you can receive image generated in your bucket. Images generated without s3 details being added will be delete after 24hours

Request

--request POST 'https://modelslab.com/api/v1/enterprise/image_editing/multiview' \

Make a POST request to https://modelslab.com/api/v1/enterprise/image_editing/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
temptrue if you want proxy links to access images apart from normal links. Useful in case your country blocks our storage provider. Default: false
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":null,
"image":"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/PTnppRlMnh5qKdwtzoOFs1CCkufWU9-metaZG93bmxvYWQuanBn-.jpg",
"prompt": "make multiple images",
"width": 640,
"height":960,
"num_inference_steps":31,
"guidance_scale":7.5,
"temp": false,
"webhook": null,
"track_id": null
}

Request

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

var raw = JSON.stringify({
{
"key":"",
"seed":null,
"image":"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/PTnppRlMnh5qKdwtzoOFs1CCkufWU9-metaZG93bmxvYWQuanBn-.jpg",
"prompt": "make multiple images",
"width": 640,
"height":960,
"num_inference_steps":31,
"guidance_scale":7.5,
"temp": false,
"webhook": null,
"track_id": null
});

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

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

Response

Example Response

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