xno.ai api reference

Tip: you can use https://curlconverter.com/ to convert these examples to your language.

Prompts

POST /api/prompts

Create a prompt.

Input

text The text of the prompt.
op(optional) The type of operation this prompt is responsible for. Can be txt2img(default), img2img, inpainting.
init_image(optional) The url of the init image when op is img2img or inpainting.
mask_image(optional) The url of the mask image when op is inpainting.
limit(optional) Number of images in this prompt(max 128). Defaults to user settings.
save_embeddings(optional) If true will save the latent space embeddings before decoder. Defaults to false.
decode_text(optional) Returns the text of the prompt in the response.

Output

created_at Prompt creation date.
images A list of urls to the images. If these urls are used before generation is complete, the url will return a 404.
image_uuids A list of image uuids. These uuids can be used for locking, unlocking, init_image ids, etc.
image_status A list of image status codes corresponding to each image. Can be generating, queued, failed, or complete.
text The text of the prompt. You must pass decode_text=true to the endpoint or this will not be returned.
limit Minimum number of images to return.
uuid The unique identifier.
save_embedding Save intermediate latent embeddings of the image.
op The type of operation this prompt is responsible for. Can be txt2img(default), img2img, inpainting.
init_image The url of the init image when op is img2img or inpainting.
mask_image The url of the mask image when op is inpainting.
webhook_category Used to filter webhooks. For instance, subscribe with category of 'twitter' and prompts with webhook_category of 'twitter' proc the webhook.
status The status of the prompt. Can be active, deleting, paused, or completed.

Headers

X-Api-Key The xno.ai api key

Example:

curl -X POST -d text='robot owl' -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/prompts

POST /api/prompts/:uuid/duplicate

Duplicate a prompt with a new model.

Input

uuid The uuid of the prompt
model Model to duplicate the prompt to
refine optional, default inherited

Output

created_at Prompt creation date.
images A list of urls to the images. If these urls are used before generation is complete, the url will return a 404.
image_uuids A list of image uuids. These uuids can be used for locking, unlocking, init_image ids, etc.
image_status A list of image status codes corresponding to each image. Can be generating, queued, failed, or complete.
text The text of the prompt. You must pass decode_text=true to the endpoint or this will not be returned.
limit Minimum number of images to return.
uuid The unique identifier.
save_embedding Save intermediate latent embeddings of the image.
op The type of operation this prompt is responsible for. Can be txt2img(default), img2img, inpainting.
init_image The url of the init image when op is img2img or inpainting.
mask_image The url of the mask image when op is inpainting.
webhook_category Used to filter webhooks. For instance, subscribe with category of 'twitter' and prompts with webhook_category of 'twitter' proc the webhook.
status The status of the prompt. Can be active, deleting, paused, or completed.

Headers

X-Api-Key The xno.ai api key

Example:

curl -X POST -d model='naclbit/trinart_stable_diffusion_v2' -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/prompts/:uuid/duplicate

GET /api/prompts/:uuid

Lookup a Prompt by uuid.

Input

uuid The uuid of the prompt

Output

created_at Prompt creation date.
images A list of urls to the images. If these urls are used before generation is complete, the url will return a 404.
image_uuids A list of image uuids. These uuids can be used for locking, unlocking, init_image ids, etc.
image_status A list of image status codes corresponding to each image. Can be generating, queued, failed, or complete.
text The text of the prompt. You must pass decode_text=true to the endpoint or this will not be returned.
limit Minimum number of images to return.
uuid The unique identifier.
save_embedding Save intermediate latent embeddings of the image.
op The type of operation this prompt is responsible for. Can be txt2img(default), img2img, inpainting.
init_image The url of the init image when op is img2img or inpainting.
mask_image The url of the mask image when op is inpainting.
webhook_category Used to filter webhooks. For instance, subscribe with category of 'twitter' and prompts with webhook_category of 'twitter' proc the webhook.
status The status of the prompt. Can be active, deleting, paused, or completed.

Headers

X-Api-Key The xno.ai api key

Example:

curl -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/prompts/:uuid

DELETE /api/prompts

Schedule and delete ALL prompts and images. Running prompts will be paused as prompt and images will be removed. Locked images and prompts containing locked images are not removed. Deletion cannot be reversed.

Input

confirm Set to true otherwise this will return 422.

Output

deleted_prompts deleted prompt count

Headers

X-Api-Key The xno.ai api key

Example:

curl -X DELETE -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/prompts?confirm=true

DELETE /api/prompts/:uuid

Schedule Prompt and all images for deletion. Running prompts will be paused as prompt and images are removed. Locked images are not removed. Deletion cannot be reversed.

Input

uuid The uuid of the prompt.

Output

None

Headers

X-Api-Key The xno.ai api key

Example:

curl -X DELETE -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/prompts/:uuid

Images

POST /api/images/:uuid/lock

Lock an image. Locked images are never deleted.

Input

uuid The uuid of the prompt

Output

None

Headers

X-Api-Key The xno.ai api key

Example:

curl -X POST -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/images/:uuid/lock

POST /api/images/:uuid/unlock

Unlock an image.

Input

uuid The uuid of the prompt

Output

None

Headers

X-Api-Key The xno.ai api key

Example:

curl -X POST -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/images/:uuid/unlock

GET /api/images/:uuid

Lookup an Image by uuid.

Input

uuid The uuid of the image

Output

created_at Image creation date.
height The height of the image in pixels.
locked If this image is locked.
opts Any additional options used to generate this image.
seed The seed of the image.
status The status of the image. Can be failed, generating, or completed.
url The url of this image.
uuid The unique identifier.
width The width of the image in pixels.

Headers

X-Api-Key The xno.ai api key

Example:

curl -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/images/:uuid

DELETE /api/images/:uuid

Deletes an image from storage and database.

Input

uuid The uuid of the image

Output

None

Headers

X-Api-Key The xno.ai api key

Example:

curl -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/images/:uuid

Metrics

GET /stats.json

Statistics about xno.ai.

Input

None

Output

active_workers Number of connected active workers.
prompts Total prompt count.
images Total image count.
users User count.
work_receipts The number of worker jobs executed for clients.
upgrades Upgraded user count.
image_timeouts Image timeouts.
image_queued Images queued.
image_processing Images processing.

Headers

None

Example:

curl https://xno.ai/stats.json

GET /api/account.json

Information about the account.

Input

None

Output

prompts A count of how many prompts are in use. There is no prompt limit.
upgraded Whether the account is upgraded. true or false
plan The current plan name.
api_images_created How many images have been made through the api.
api_images_limit The api limit before overage charges.
referral_code Your referral aka gallery code.
referral_view_count How many times your gallery has been viewed.
images_stored How many images are stored in the default s3 bucket.
images_stored_limit How many images this account can store

Headers

None

Example:

curl https://xno.ai/api/account.json

GET /api/models.json

List of whitelisted models.

Input

None

Output

models List of model_ids

Headers

None

Example:

curl https://xno.ai/models.json

GET /api/models/default.json

The default model.

Input

None

Output

model_id The model id from huggingface.co
revision The model revision on huggingface.co
vae Variational encoder

Headers

None

Example:

curl https://xno.ai/models/default.json

Webhooks

POST /api/webhooks

Setup a webhook that triggers when a prompt is completed.

Input

url url to call when the event occurs. For testing you can use requestbin.com
decode_text Whether text is included in the webhook. Defaults to False
event Can be prompt_complete or image_complete
category The prompt#webhook_category that triggers these hooks. Defaults to all. ex: twitter_bot

Output

None

Headers

None

Example:

curl -d url='https://webhook_url' -d event=generation_complete -H 'X-Api-Key: Your xno.ai API key' https://xno.ai/api/webhooks

DELETE /api/webhooks

Delete a webhook that triggers when a prompt is completed.

Input

event Can be prompt_complete or image_complete

Output

None

Headers

None

Example:

curl -X DELETE -H 'X-Api-Key: Your xno.ai API key' -d webhook_url='https://webhook_url' -d event=generation_complete https://xno.ai/api/webhooks

Example

Discord bot

See the discord bot integration.