curl --request POST \
--url https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra \
--header 'accept: <accept>' \
--header 'authorization: <authorization>' \
--header 'content-type: multipart/form-data' \
--form prompt=import requests
url = "https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001--"
headers = {
"authorization": "<authorization>",
"content-type": "multipart/form-data",
"accept": "<accept>"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('prompt', '');
const options = {
method: 'POST',
headers: {authorization: '<authorization>', accept: '<accept>'}
};
options.body = form;
fetch('https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("accept", "<accept>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra")
.header("authorization", "<authorization>")
.header("accept", "<accept>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001--")
.asString();"<string>"{
"id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"name": "bad_request",
"errors": [
"some-field: is required"
]
}{
"id": "ed14db44362126aab3cbd25cca51ffe3",
"name": "content_moderation",
"errors": [
"Your request was flagged by our content moderation system, as a result your request was denied and you were not charged."
]
}{
"id": "4212a4b66fbe1cedca4bf2133d35dca5",
"name": "payload_too_large",
"errors": [
"body: payloads cannot be larger than 10MiB in size"
]
}{
"id": "ff54b236a3acdde1522cb1ba641c43ed",
"name": "invalid_language",
"errors": [
"English is the only supported language for this service."
]
}{
"id": "rate_limit_exceeded",
"name": "rate_limit_exceeded",
"errors": [
"You have exceeded the rate limit of 150 requests within a 10 second period, and have been timed out for 60 seconds."
]
}{
"id": "2a1b2d4eafe2bc6ab4cd4d5c6133f513",
"name": "internal_error",
"errors": [
"An unexpected server error has occurred, please try again later."
]
}Stable Image Ultra
Our most advanced text to image generation service, Stable Image Ultra creates the highest quality images with unprecedented prompt understanding. Ultra excels in typography, complex compositions, dynamic lighting, vibrant hues, and overall cohesion and structure of an art piece. Made from the most advanced models, including Stable Diffusion 3, Ultra offers the best of the Stable Diffusion ecosystem.
Try it out
Grab your API key and head over to
How to use
Please invoke this endpoint with a POST request.
The headers of the request must include an API key in the authorization field. The body of the request must be
multipart/form-data. The accept header should be set to one of the following:
image/*to receive the image in the format specified by theoutput_formatparameter.application/jsonto receive the image in the format specified by theoutput_formatparameter, but encoded to base64 in a JSON response.
The only required parameter is the prompt field, which should contain the text prompt for the image generation.
Note: for the full list of optional parameters, please see the request schema below.
Output
The resolution of the generated image will be 1 megapixel. The default resolution is 1024x1024.
Credits
The Ultra service uses 8 credits per successful result. You will not be charged for failed results.
curl --request POST \
--url https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra \
--header 'accept: <accept>' \
--header 'authorization: <authorization>' \
--header 'content-type: multipart/form-data' \
--form prompt=import requests
url = "https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001--"
headers = {
"authorization": "<authorization>",
"content-type": "multipart/form-data",
"accept": "<accept>"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('prompt', '');
const options = {
method: 'POST',
headers: {authorization: '<authorization>', accept: '<accept>'}
};
options.body = form;
fetch('https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("accept", "<accept>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maxapi.ai/sd/v2beta/stable-image/generate/ultra")
.header("authorization", "<authorization>")
.header("accept", "<accept>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\n\r\n-----011000010111000001101001--")
.asString();"<string>"{
"id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"name": "bad_request",
"errors": [
"some-field: is required"
]
}{
"id": "ed14db44362126aab3cbd25cca51ffe3",
"name": "content_moderation",
"errors": [
"Your request was flagged by our content moderation system, as a result your request was denied and you were not charged."
]
}{
"id": "4212a4b66fbe1cedca4bf2133d35dca5",
"name": "payload_too_large",
"errors": [
"body: payloads cannot be larger than 10MiB in size"
]
}{
"id": "ff54b236a3acdde1522cb1ba641c43ed",
"name": "invalid_language",
"errors": [
"English is the only supported language for this service."
]
}{
"id": "rate_limit_exceeded",
"name": "rate_limit_exceeded",
"errors": [
"You have exceeded the rate limit of 150 requests within a 10 second period, and have been timed out for 60 seconds."
]
}{
"id": "2a1b2d4eafe2bc6ab4cd4d5c6133f513",
"name": "internal_error",
"errors": [
"An unexpected server error has occurred, please try again later."
]
}请求头
Your Stability API key, used to authenticate your requests. Although you may have multiple keys in your account, you should use the same key for all requests to this API.
1The content type of the request body. Do not manually specify this header; your HTTP client library will automatically include the appropriate boundary parameter.
1"multipart/form-data"
Specify image/* to get the image bytes directly. Otherwise specify application/json to receive the image as base64 encoded JSON.
application/json, image/* 请求体
What you wish to see in the output image. A strong, descriptive prompt that clearly defines elements, colors, and subjects will lead to better results.
To control the weight of a given word use the format (word:weight),
where word is the word you'd like to control the weight of and weight
is a value between 0 and 1. For example: The sky was a crisp (blue:0.3) and (green:0.8)
would convey a sky that was blue and green, but more green than blue.
1 - 10000""
A blurb of text describing what you do not wish to see in the output image.
This is an advanced feature.
10000""
Controls the aspect ratio of the generated image.
16:9, 1:1, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, 9:21 "1:1"
A specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass 0 to use a random seed.)
0 <= x <= 4294967294""
Dictates the content-type of the generated image.
jpeg, png, webp "png"
响应
图片生成成功。返回格式由请求中的 Accept 头决定。
The response is of type file.