Enterprise: Upload Image Endpoint
- enterprise/system_details
- enterprise/restart_server
- enterprise/update_server
- enterprise/update_s3
- enterprise/clear_cache
- enterprise/schedulers_list
- enterprise/load_model
- enterprise/verify_model
- enterprise/get_all_models
- enterprise/delete_model
- enterprise/controlnet
- enterprise/text2img
- enterprise/text2video
- enterprise/text2video
- enterprise/inpaint
- enterprise/super_resolution
- enterprise/upload_image
- enterprise/sync_image
- enterprise/load_vae
- enterprise/nsfw_image_check
- enterprise/fetch_queue_image
Overview
The Enterprise Upload Image endpoint uploads an image to your S3 bucket.
info
You should have your own S3 bucket to use this endpoint.
Update your S3 bucket details using this endpoint.
Request
--request POST 'https://stablediffusionapi.com/api/v1/enterprise/upload_image' \
Send a POST
request to https://stablediffusionapi.com/api/v1/enterprise/upload_image endpoint.
note
Make sure you are passing the image in base64 format.
Body Attributes
Parameter | Description |
---|---|
key | Your enterprise API Key used for request authorization. |
base64_image | The base64 string of the image to be uploaded. |
image_type | Extension or type of the image; options: png, jpeg, jpg |
Example
Body
Body Raw
{
"key": "enterprise_api_key",
"base64_image": "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABe1JREFUaIHdms9PVFcUxz/zA2YhFRAUQVjVH1EXVBFIEBxNq2n/BKMB2RgDahCCCxOX/gG17YYfUVmYxh9VlCC1QcFGg4mKdmGi/ZGgLkQYQKogkJnbxZkH782bx7w3zDBtT3Iyc+fec+75zrv33HPOfS4SQx5gO7An/LkJWA9kRIz7APwBvAAeA33AEyCYIDvipjLge2AUUHHyaFhH6TLbDsA3wK92DM3OFrYzFrgH7FsOABuBX6IZUVSEqqlBtbejBgZQ4+MopYw8NiZ9bW2o6mrUunWWgHqADckA4AKagE/6CX0+VG0t6t49VChkNjwWh0Kovj7UoUOo9HQTmE9AQ3juhFAmcEM/ideLOnoU9eaNc+Ot+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+Fa/xkq1Dp9PCspOFHd2otassbwisOTCwsWTsGg8NGRKdUuIoH6ts77eufcJBFCnT0tuEQtAQQHqzBnU5KTzeY4cMei6qxmvP8f3Ea4Veb3w6BEUF0dijU3BoHiUhw/h+XPJAt1uiaq3bpXcpaIinJs6pMFBKC2VOcL0FdAbbWwPYbSlpf+uAt3MDGrHDsPT6F4M9HpgWhvc1JR6ABo3NJhKphtjPcEGTcDlkgJyqkG0tZk84/FYIED2zXVNyOuV0n6qQFy9arpWuIqDe8XPkGN/3te3ti4/iAsXTCAeYX4JISblIddd88usqWl5HMDMjOyJiOX0AqlhxUV5+icDqLIyqYonC8STJybvpD2JuEFotBLdniG8b+rqnEcAi/HQkBx2EdcGCviJOJaTFbmQ6y7DCwPp6VKdvHt38UDRioNBCVGqq6O+MDCNeKekJN8b0B2aes7PlzJmayvqwYPoJdDRUelraUEdOIBau9YyjOlGzrSk017kFaWYcVVWlrCdsUjs9OVyAIikEiSMHrZpaDQeDuswRbFOKFHrz42U9vcgGedG4HPkPRY9vUcKBdqLZ3eAZ0hJakn0DwRcaPWWv+9kAAAAAElFTkSuQmCC",
"image_type": "png"
}
Request
- JS
- PHP
- NODE
- PYTHON
- JAVA
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"key": "",
"base64_image": "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABe1JREFUaIHdms9PVFcUxz/zA2YhFRAUQVjVH1EXVBFIEBxNq2n/BKMB2RgDahCCCxOX/gG17YYfUVmYxh9VlCC1QcFGg4mKdmGi/ZGgLkQYQKogkJnbxZkH782bx7w3zDBtT3Iyc+fec+75zrv33HPOfS4SQx5gO7An/LkJWA9kRIz7APwBvAAeA33AEyCYIDvipjLge2AUUHHyaFhH6TLbDsA3wK92DM3OFrYzFrgH7F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v17e7LBoCle2wYSxo9oPzoJ469cMVY3iopQly7JRFYyc3Oo8+fFcE3O7Ubdvm1/Xi0VCPNbYP4Y+U7rcJJYKYU6e9ZUqlFFRVLHbW9H3byJunFD1vThw+bI1+NxXnKqrjbo+Fa/xkq1Dp9PCspOFHd2otassbwisOTCwsWTsGg8NGRKdUuIoH6ts77eufcJBFCnT0tuEQtAQQHqzBnU5KTzeY4cMei6qxmvP8f3Ea4Veb3w6BEUF0dijU3BoHiUhw/h+XPJAt1uiaq3bpXcpaIinJs6pMFBKC2VOcL0FdAbbWwPYbSlpf+uAt3MDGrHDsPT6F4M9HpgWhvc1JR6ABo3NJhKphtjPcEGTcDlkgJyqkG0tZk84/FYIED2zXVNyOuV0n6qQFy9arpWuIqDe8XPkGN/3te3ti4/iAsXTCAeYX4JISblIddd88usqWl5HMDMjOyJiOX0AqlhxUV5+icDqLIyqYonC8STJybvpD2JuEFotBLdniG8b+rqnEcAi/HQkBx2EdcGCviJOJaTFbmQ6y7DCwPp6VKdvHt38UDRioNBCVGqq6O+MDCNeKekJN8b0B2aes7PlzJmayvqwYPoJdDRUelraUEdOIBau9YyjOlGzrSk017kFaWYcVVWlrCdsUjs9OVyAIikEiSMHrZpaDQeDuswRbFOKFHrz42U9vcgGedG4HPkPRY9vUcKBdqLZ3eAZ0hJakn0DwRcaPWWv+9kAAAAAElFTkSuQmCC",
"image_type": "png"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://stablediffusionapi.com/api/v1/enterprise/upload_image", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"base64_image" => "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABe1JREFUaIHdms9PVFcUxz/zA2YhFRAUQVjVH1EXV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TTNGQUC8yAAJt3AX1rr5Uv7ivr6oLISTp1amkGhEOzfDwUFcPmyfbkIW/8E+JGwP3ZSYPD7F/x4d3f858HFiwt6Kivty7W0GM6Ri26kZgRAvym6t6aSkoXvDQ0wOWlfVqOREWhuXmjv3WtfNsLWxyDxvAJUYaH90ufw8EK0C6iqquj1Xit++xa1ffuCfF4e6v17e7LBoCle2wYSxo9oPzoJ469cMVY3iopQly7JRFYyc3Oo8+fFcE3O7Ubdvm1/Xi0VCPNbYP4Y+U7rcJJYKYU6e9ZUqlFFRVLHbW9H3byJunFD1vThw+bI1+NxXnKqrjbo+Fa/xkq1Dp9PCspOFHd2otassbwisOTCwsWTsGg8NGRKdUuIoH6ts77eufcJBFCnT0tuEQtAQQHqzBnU5KTzeY4cMei6qxmvP8f3Ea4Veb3w6BEUF0dijU3BoHiUhw/h+XPJAt1uiaq3bpXcpaIinJs6pMFBKC2VOcL0FdAbbWwPYbSlpf+uAt3MDGrHDsPT6F4M9HpgWhvc1JR6ABo3NJhKphtjPcEGTcDlkgJyqkG0tZk84/FYIED2zXVNyOuV0n6qQFy9arpWuIqDe8XPkGN/3te3ti4/iAsXTCAeYX4JISblIddd88usqWl5HMDMjOyJiOX0AqlhxUV5+icDqLIyqYonC8STJybvpD2JuEFotBLdniG8b+rqnEcAi/HQkBx2EdcGCviJOJaTFbmQ6y7DCwPp6VKdvHt38UDRioNBCVGqq6O+MDCNeKekJN8b0B2aes7PlzJmayvqwYPoJdDRUelraUEdOIBau9YyjOlGzrSk017kFaWYcVVWlrCdsUjs9OVyAIikEiSMHrZpaDQeDuswRbFOKFHrz42U9vcgGedG4HPkPRY9vUcKBdqLZ3eAZ0hJakn0DwRcaPWWv+9kAAAAAElFTkSuQmCC",
"image_type" => "png"
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://stablediffusionapi.com/api/v1/enterprise/upload_image',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://stablediffusionapi.com/api/v1/enterprise/upload_image',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key": "",
"base64_image": "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABe1JREFUaIHdms9PVFcUxz/zA2YhFRAUQVjVH1EXVBFIEBxNq2n/BKMB2RgDahCCCxOX/gG17YYfUVmYxh9VlCC1QcFGg4mKdmGi/ZGgLkQYQKogkJnbxZkH782bx7w3zDBtT3Iyc+fec+75zrv33HPOfS4SQx5gO7An/LkJWA9kRIz7APwBvAAeA33AEyCYIDvipjLge2AUUHHyaFhH6TLbDsA3wK92DM3OFrYzFrgH7FsOABuBX6IZUVSEqqlBtbejBgZQ4+MopYw8NiZ9bW2o6mrUunWWgHqADckA4AKagE/6CX0+VG0t6t49VChkNjwWh0Kovj7UoUOo9HQTmE9AQ3juhFAmcEM/ideLOnoU9eaNc+Ot+PVrVH296I4AdB1YuVQQa4FBveLyctSzZ4kDEMlPn6JKS01gHgN5SwHxu6bM5UI1N6NmZ5MHQuPZWVRjo8ypA/MyHjArEf+uAOXxyCZONoBI7uhApaUZwPwGZNkF4QJuasJpaajOzuUHofG1a6Z9cx2bDqAJ3XLq6EgdCI3PnTMtsxOxQGxA52JPnkw9CI0bG02uedNiQOYPu/Ly5dnYdnl21uTNfrYC8bU2yOtNrouNlwcHxfHowEQNZ+Zjp2PHUm+0FdfVGYD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WuIqDe8XPkGN/3te3ti4/iAsXTCAeYX4JISblIddd88usqWl5HMDMjOyJiOX0AqlhxUV5+icDqLIyqYonC8STJybvpD2JuEFotBLdniG8b+rqnEcAi/HQkBx2EdcGCviJOJaTFbmQ6y7DCwPp6VKdvHt38UDRioNBCVGqq6O+MDCNeKekJN8b0B2aes7PlzJmayvqwYPoJdDRUelraUEdOIBau9YyjOlGzrSk017kFaWYcVVWlrCdsUjs9OVyAIikEiSMHrZpaDQeDuswRbFOKFHrz42U9vcgGedG4HPkPRY9vUcKBdqLZ3eAZ0hJakn0DwRcaPWWv+9kAAAAAElFTkSuQmCC",
"image_type": "png"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://stablediffusionapi.com/api/v1/enterprise/upload_image"
payload = json.dumps({
"key": "",
"base64_image": "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABe1JREFUaIHdms9PVFcUxz/zA2YhFRAUQVjVH1EXVBFIEBxNq2n/BKMB2RgDahCCCxOX/gG17YYfUVmYxh9VlCC1QcFGg4mKdmGi/ZGgLkQYQKogkJnbxZkH782bx7w3zDBtT3Iyc+fec+75zrv33HPOfS4SQx5gO7An/LkJWA9kRIz7APwBvAAeA33AEyCYIDvipjLge2AUUHHyaFhH6TLbDsA3wK92DM3OFrYzFrgH7FsOABuBX6IZUVSEqqlBtbejBgZQ4+MopYw8NiZ9bW2o6mrUunWWgHqADckA4AKagE/6CX0+VG0t6t49VChkNjwWh0Kovj7UoUOo9HQTmE9AQ3juhFAmcEM/ideLOnoU9eaNc+Ot+PVrVH296I4AdB1YuVQQa4FBveLyctSzZ4kDEMlPn6JKS01gHgN5SwHxu6bM5UI1N6NmZ5MHQuPZWVRjo8ypA/MyHjArEf+uAOXxyCZONoBI7uhApaUZwPwGZNkF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Uhw/h+XPJAt1uiaq3bpXcpaIinJs6pMFBKC2VOcL0FdAbbWwPYbSlpf+uAt3MDGrHDsPT6F4M9HpgWhvc1JR6ABo3NJhKphtjPcEGTcDlkgJyqkG0tZk84/FYIED2zXVNyOuV0n6qQFy9arpWuIqDe8XPkGN/3te3ti4/iAsXTCAeYX4JISblIddd88usqWl5HMDMjOyJiOX0AqlhxUV5+icDqLIyqYonC8STJybvpD2JuEFotBLdniG8b+rqnEcAi/HQkBx2EdcGCviJOJaTFbmQ6y7DCwPp6VKdvHt38UDRioNBCVGqq6O+MDCNeKekJN8b0B2aes7PlzJmayvqwYPoJdDRUelraUEdOIBau9YyjOlGzrSk017kFaWYcVVWlrCdsUjs9OVyAIikEiSMHrZpaDQeDuswRbFOKFHrz42U9vcgGedG4HPkPRY9vUcKBdqLZ3eAZ0hJakn0DwRcaPWWv+9kAAAAAElFTkSuQmCC",
"image_type": "png"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"key\": \"\",\n \"base64_image\": \"iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABe1JREFUaIHdms9PVFcUxz/zA2YhFRAUQVjVH1EXVBFIEBxNq2n/BKMB2RgDahCCCxOX/gG17YYfUVmYxh9VlCC1QcFGg4mKdmGi/ZGgLkQYQKogkJnbxZkH782bx7w3zDBtT3Iyc+fec+75zrv33HPOfS4SQx5gO7An/LkJWA9kRIz7APwBvAAeA33AEyCYIDvipjLge2AUUHHyaFhH6TLbDsA3wK92DM3OFrYzFrgH7FsOABuBX6IZUVSEqqlBtbejBgZQ4+MopYw8NiZ9bW2o6mrUunWWgHqADckA4AKag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1/Xi0VCPNbYP4Y+U7rcJJYKYU6e9ZUqlFFRVLHbW9H3byJunFD1vThw+bI1+NxXnKqrjbo+Fa/xkq1Dp9PCspOFHd2otassbwisOTCwsWTsGg8NGRKdUuIoH6ts77eufcJBFCnT0tuEQtAQQHqzBnU5KTzeY4cMei6qxmvP8f3Ea4Veb3w6BEUF0dijU3BoHiUhw/h+XPJAt1uiaq3bpXcpaIinJs6pMFBKC2VOcL0FdAbbWwPYbSlpf+uAt3MDGrHDsPT6F4M9HpgWhvc1JR6ABo3NJhKphtjPcEGTcDlkgJyqkG0tZk84/FYIED2zXVNyOuV0n6qQFy9arpWuIqDe8XPkGN/3te3ti4/iAsXTCAeYX4JISblIddd88usqWl5HMDMjOyJiOX0AqlhxUV5+icDqLIyqYonC8STJybvpD2JuEFotBLdniG8b+rqnEcAi/HQkBx2EdcGCviJOJaTFbmQ6y7DCwPp6VKdvHt38UDRioNBCVGqq6O+MDCNeKekJN8b0B2aes7PlzJmayvqwYPoJdDRUelraUEdOIBau9YyjOlGzrSk017kFaWYcVVWlrCdsUjs9OVyAIikEiSMHrZpaDQeDuswRbFOKFHrz42U9vcgGedG4HPkPRY9vUcKBdqLZ3eAZ0hJakn0DwRcaPWWv+9kAAAAAElFTkSuQmCC\",\n \"image_type\": \"png\"\n}");
Request request = new Request.Builder()
.url("https://stablediffusionapi.com/api/v1/enterprise/upload_image")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Response
{
"status": "success",
"message": "image uploaded",
"image_url": "https://pub-8b49af329fae499aa563997f5d4068a4.r2.dev/generations/2789658481681896990.png"
}