The image upscale featureĀ provides a better image to the user by increasing its resolution.
Endpoint: https://api.vyro.ai/v1/imagine/api**/upscale**
Requests must include the following parameters:
Parameter | Type | Description | Default | Range / Values | Optional |
---|---|---|---|---|---|
model_version |
Integer | The text guides the image generation. | - | 1 |
No |
image |
Upload file | The reference image for the output style. | - | jpeg/jpg, png | No |
The following keys and values must be included in the request headers:
The endpoint responds with an image.
The status code of the response is as follows:
Status Code | Reason |
---|---|
200 | Success: The request was successful, and the image was generated as expected. |
400 | Bad Request: The request is malformed or incomplete. Causes can include: missing image_file in the request, invalid input image format, or too large image resolution. |
401 | Unauthorized: Authentication is required or has failed. |
403 | Forbidden: The client does not have access rights to the content. |
429 | Too Many Requests: The user has sent too many requests in a given amount of time. |
500 | Internal Server Error: An unexpected condition was encountered, and no more specific message is suitable. |
Example Request
Here is an example of how your request might look:
import requests
import os
# API endpoint
url = '<https://api.vyro.ai/v1/imagine/api/upscale/>'
# Headers
headers = {
'bearer': '<Your bearer token here>'
}
# Form data
data = {
'model_version': '1',
}
# Image to be sent
image_path = '/path/to/your/image.jpg'
with open(image_path, 'rb') as img:
files = {'image': img}
# Make the request
response = requests.post(url, headers=headers, files=files, data=data)
# Check the status of the request
if response.status_code == 200:
print('Request was successful.')
else:
print('Error occurred. Status code:', response.status_code)
<aside>
š” Remember to replace **"**<Your Bearer Token Here>**"**
and "/path/to/your/image.jpg"
with your actual bearer token and uploaded image.
</aside>