Skip to main content

Mixture Canvas Endpoint

Overview

This endpoint allow you to add canva to an image and fill the canva with prompt description

Request

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

Make a POST request to https://stablediffusionapi.com/api/v5/mixture_canvas 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
imageurl of the image to outpaint
widthThis is the canvas width: Default 800
heightThis is the canvas height: Default 360
guidance_scaleOptional. Scale for classifier-free guidance (minimum: 1; maximum: 20). Default is 8
strengthOptional. Prompt strength when using image. 1.0 corresponds to full destruction of information in the image.
num_inference_stepsOptional. Number of denoising steps. Default 20
mix_factorOptional. Mix factor for the task. Default is 0.5
pos_y1Optional. Y1 position for the outpainting. Default is 448
pos_y2Optional. Y2 position for the outpainting. Default is 800
pos_x1Optional. X1 position for the outpainting. Default is 0
pos_x2Optional. X2 position for the outpainting. Default is 352
seedSeed is used to reproduce results, same seed will give you same image in return again. Pass null for a
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://camo.githubusercontent.com/5591434c42714807553e83644a191816cdf39100648f8d94b28a149dc0bc5cc7/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f6b616469726e61722f6469666675736572735f726561646d655f696d616765732f7265736f6c76652f6d61696e2f696e7075745f696d6167652e706e67",
"prompt":"best quality, masterpiece, WLOP, sakimichan, art contest winner on pixiv, 8K, intricate details, wet effects, rain drops, ethereal, mysterious, futuristic, UHD, HDR, cinematic lighting, in a beautiful forest, rainy day, award winning, trending on artstation, beautiful confident cheerful young woman, wearing a futuristic sleeveless dress, ultra beautiful detailed eyes, hyper-detailed face, complex, perfect, model, textured, chiaroscuro, professional make-up, realistic, figure in frame,",
"webhook": null,
"track_id": null
}

Request

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

var raw = JSON.stringify({
"key":"",
"image":"https://camo.githubusercontent.com/5591434c42714807553e83644a191816cdf39100648f8d94b28a149dc0bc5cc7/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f6b616469726e61722f6469666675736572735f726561646d655f696d616765732f7265736f6c76652f6d61696e2f696e7075745f696d6167652e706e67",
"prompt":"best quality, masterpiece, WLOP, sakimichan, art contest winner on pixiv, 8K, intricate details, wet effects, rain drops, ethereal, mysterious, futuristic, UHD, HDR, cinematic lighting, in a beautiful forest, rainy day, award winning, trending on artstation, beautiful confident cheerful young woman, wearing a futuristic sleeveless dress, ultra beautiful detailed eyes, hyper-detailed face, complex, perfect, model, textured, chiaroscuro, professional make-up, realistic, figure in frame,",
"webhook": null,
"track_id": null
});

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

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

Response

Example Response

{
"status": "success",
"generationTime": 12.331510066986084,
"id": 514,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/07eb4e9b-3248-4789-b87f-44a7f64d77fd.png"
],
"meta": {
"canvas_height": 800,
"canvas_width": 360,
"file_prefix": "07eb4e9b-3248-4789-b87f-44a7f64d77fd",
"guidance_scale": 8,
"image": "https://camo.githubusercontent.com/5591434c42714807553e83644a191816cdf39100648f8d94b28a149dc0bc5cc7/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f6b616469726e61722f6469666675736572735f726561646d655f696d616765732f7265736f6c76652f6d61696e2f696e7075745f696d6167652e706e67",
"negative_prompt": "low quality",
"outdir": "out",
"pos_x1": 0,
"pos_x2": 352,
"pos_y1": 448,
"pos_y2": 800,
"prompt": "best quality, masterpiece, WLOP, sakimichan, art contest winner on pixiv, 8K, intricate details, wet effects, rain drops, ethereal, mysterious, futuristic, UHD, HDR, cinematic lighting, in a beautiful forest, rainy day, award winning, trending on artstation, beautiful confident cheerful young woman, wearing a futuristic sleeveless dress, ultra beautiful detailed eyes, hyper-detailed face, complex, perfect, model, textured, chiaroscuro, professional make-up, realistic, figure in frame,",
"seed": 3843097097,
"steps": 100,
"strength": 1
}
}