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.

Multiview endpoint result

Request

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

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

Body Attributes

ParameterDescriptionValues
keyYour API Key used for request authorizationstring
promptThe text prompt describing the content you want in the generated imagestring
negative_promptItems you do not want in the imagestring
imageA link or valid base64 data of the image you want your generations to resemble. The format should be data:image/jpeg;base64,{your_base64_string}URL or base64 string
widthThe width of the generated images. The default is 640 pixels. The maximum is 1024 pixels.integer (default: 640, max: 1024)
heightThe height of the generated images. The default is 960 pixels. The maximum is 1024 pixels.integer (default: 960, max: 1024)
tempSet to true if you want proxy links to access images in addition to normal links. Useful if your country blocks the storage provider. The default is false.boolean (true/false)
num_inference_stepsThe number of denoising steps. The acceptable values are 21, 31, and 41.integer (21, 31, or 41)
guidance_scaleThe scale for classifier-free guidance. The minimum is 1 and the maximum is 20.integer (1 to 20)
base64Set to true if the provided image is in base64 format or if you want your generated images as a base64 string. The default is false.boolean (true/false)
webhookProvide a URL to receive a POST API call once the image generation is complete.URL
track_idThis ID is returned in the response to the webhook API call and will be used to identify the webhook request.integral value

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":50,
"guidance_scale":4,
"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":50,
"guidance_scale":4,
"temp": false,
"webhook": null,
"track_id": null
});

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

fetch("https://modelslab.com/api/v6/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": 13.116175889968872,
"id": 289386,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/temp/8b7d3a65-73e2-4d44-82b1-a333cee1ab93.png"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/temp/efaf0575-36a6-4c1b-8236-6d44eb3fcb35.png"
],
""meta": {
"base64": "no",
"file_prefix": "986ecb6b-df2e-4478-8719-c44e43ef0dc3",
"guidance_scale": 4,
"height": 960,
"image": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/PTnppRlMnh5qKdwtzoOFs1CCkufWU9-metaZG93bmxvYWQuanBn-.jpg",
"num_inference_steps": 50,
"opacity": 0.7,
"outdir": "out",
"padding_down": 10,
"padding_right": 10,
"prompt": "make multiple images",
"scale_down": 6,
"seed": 1546994876,
"temp": "yes",
"watermark": "no",
"width": 640
}
}
}
}