Stable Diffusion API Documentation

Updated 2 years ago on July 18, 2023

Welcome

API Stable Diffusion V3 has these capabilities:

  • Higher speed;
  • Inlay;
  • Image 2 Image;
  • Negative inducements.

Stable Diffusion's API is organized according to REST principles. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

The Stable Diffusion API is equipped with an NSFW validation program. Any image recognized as NSFW will be replaced with an empty image.

We have a chatbot trained in documentation and codebase, click on the chat icon in the footer and ask a question, it will also provide you with code samples :)

Please pay attention to the content of your images. We have a filter system in place to remove any child pornography. Repeated attempts will result in account suspension.

The Stable Diffusion API uses keys to authenticate requests. Pass the key obtained from the API Key Page into the request body and perform all endpoint actions accordingly.

Send JSON POST requests with data and links.

Do not send files in raw form, instead send publicly available links to them.

Here you will find information about the Stable Diffusion and Multiple AI APIs.

You can pass details to generate images using this API, without having to use the GPU locally.

All requests to the API are authorized with a key. You can get it by registering.

API Features

  1. Use 100+ models to generate images with a single API call.
  2. Use of multilore models
  3. Use of embedding models
  4. Utilization of control network models
  5. Use of models with multiple control networks
  6. High-quality images
  7. High-resolution correction
  8. Multiple language support
  9. The process of self-awareness
  10. Model train
  11. Clipfix
  12. Base64 support

All API requests require a header to be passed. Make sure to pass Content-Type: application/json in the header, as shown in the example below:

--header 'Content-Type: application/json'

For more information about the Image Stable Diffusion API endpoints, follow the links below:

Possible responses to the error

The following are the most common errors that can occur when using the Stable Diffusion API.

Marginal rate

This error is returned if the same request has been sent multiple times.

{ 
"status": "error",
"message": "Rate limit exceeded",
"tips": "you are sending the same request multiple times, spam filter is enabled, please wait for 30 seconds and try again"
}

Wrong key

This error is returned if the API key used to authenticate the request is invalid.

{
"status": "error",
"message": "Invalid Api Key",
"tip": "1. Make sure Content-Type: application/json is passed in the header. 2. Make sure you are executing the POST request with the correct JSON. 3. Make sure the JSON is error free, use jsonlint to validate the json array. 4.
Make sure you have a valid API key."
}

Unfortunate answer

This error is returned if the request fails for some reason.

{
"status": "failed",
"id":""",
"message": "Failed, Try Again",
"output
":""
}

Validation errors

This error is returned if one of the mandatory fields is not specified. In this example, the prompt field is not specified:

{
"status": "error",
"message":{
"prompt":[
"The prompt field is required.
"
]

}

}

This error is returned if model_id has not been populated for the endpoint that requires it.

{
"status": "error",
"message": "Model id not found"
}

Let's get in touch!

Please feel free to send us a message through the contact form.

Drop us a line at mailrequest@nosota.com / Give us a call over skypenosota.skype