Create Upscale
POST
/v1/image/upscale/create
This endpoint is for upscaling images. You can upscale the result of your generations or an arbitrary image.
Request Example
Below is an example for an upscale. You can just send an output ID that belongs to your account or an arbitrary image url and the system will use the defaults for the rest.
curl -X POST 'https://api.stablecog.com/v1/image/upscale/create' \
-H 'Authorization: Bearer <YOUR_STABLECOG_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"input": "daa383dc-42f7-4137-92b6-4087af7b4aab"
}'
const API_KEY = process.env.STABLECOG_API_KEY;
const API_HOST = 'https://api.stablecog.com';
const API_ENDPOINT = '/v1/image/upscale/create';
const API_URL = `${API_HOST}${ENDPOINT}`;
const req = {
input: 'daa383dc-42f7-4137-92b6-4087af7b4aab'
};
const res = await fetch(API_URL, {
method: 'POST',
body: JSON.stringify(req),
headers: {
Authorization: `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
const resJSON = await res.json();
console.log(resJSON);
import os
import requests
import json
API_KEY = os.environ.get("STABLECOG_API_KEY")
API_HOST = "https://api.stablecog.com"
API_ENDPOINT = "/v1/image/upscale/create"
API_URL = f"{API_HOST}{API_ENDPOINT}"
req = {
"input": "daa383dc-42f7-4137-92b6-4087af7b4aab"
}
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
res = requests.post(API_URL, data=json.dumps(req), headers=headers)
res_json = res.json()
print(json.dumps(res_json, indent=2))
Response
{
"outputs": [
{
"id": "a9c45ba2-af2a-4dd5-8d45-522d97c494bd",
"url": "https://b.stablecog.com/ad5120b5-7be4-4d7a-9865-91f1094b7a81.jpeg"
}
],
"remaining_credits": 1391,
"settings": {
"model_id": "14c9c5a4-33a8-4aed-a648-ee8510ae65b2",
"input": "daa383dc-42f7-4137-92b6-4087af7b4aab"
}
}
Request Headers
Authorization required
string
Authorization: Bearer <YOUR_STABLECOG_API_KEY>
.Request Body
input required
string
Here are the constraints for the input image:
- Maximum width:
1024
. - Maximum height:
1024
. - Formats:
JPG
,PNG
,WebP
.
model_id
(enum) TUpscaleModelID
Response Body
outputs
array of TOutput
remaining_credits
float
settings
(object) TUpscaleSettings