EZLINK AI API
  1. Generate
EZLINK AI API
  • LLMs
    • 介绍
    • 项目说明
    • 导言
    • 身份验证
    • 发出请求
    • 参数详情
    • 音频(Audio)
      • 创建语音
      • 创建转录
      • 创建翻译
    • 聊天(Chat)
      • 聊天完成对象
      • 聊天完成块对象
      • 创建聊天补全
    • 自动补全(Completions)
      • 完成对象
      • 创建完成
    • 嵌入(Embeddings)
      • 嵌入对象
      • 创建嵌入
    • 图像(Images)
      • README
      • 图像对象
      • 创建图像
      • 创建图片编辑
      • 创建图像变体
    • 模型(Models)
      • 模型对象
      • 列出模型
      • 检索模型
    • 审查(Moderations)
      • 调节对象
      • 创建内容审核
  • Stability
    • Image-to-Video
      • Start generation
      • Fetch generation result
    • Upscale
      • Conservative
      • Start Creative Upscale
      • Fetch Creative Upscale result
    • Edit
      • Erase
      • Inpaint
      • Outpaint
      • Search and Replace
      • Remove Background
    • Generate
      • Stable Image Ultra
        POST
      • Stable Image Core
        POST
      • Stable Diffusion 3
        POST
    • Control
      • Sketch
      • Structure
      • Style
  • Midjourney
    • InsightFace任务提交
      • 提交swap_face任务
    • 任务提交
      • 执行动作
      • 提交Blend任务
      • 提交Describe任务
      • 提交Imagine任务
      • 提交Modal
      • 提交Shorten任务
    • 任务查询
      • 指定ID获取任务
      • 获取任务图片的seed(需设置mj或niji的私信ID)
  • File
  • Flux
    • 创建图像 Copy
      POST
  • video
    • 视频生成
    • 生成查询
  1. Generate

Stable Diffusion 3

POST
https://api.ezlinkai.com/v2beta/stable-image/generate/sd3
Generate
Generate an image using a Stable Diffusion 3 model:
SD3 Medium - the 2 billion parameter model
SD3 Large - the 8 billion parameter model
SD3 Large Turbo - the 8 billion parameter model with a faster inference time
This API is powered by Fireworks AI.
API status can be reviewed here.

Try it out#

Grab your API key and head over to one of the following sites:
Open Fireworks Playground
Open Google Colab

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 the output_format parameter.
application/json to receive the image encoded as base64 in a JSON response.

Generating with a prompt#

Commonly referred to as text-to-image, this mode generates an image from text alone. While the only required
parameter is the prompt, it also supports an aspect_ratio parameter which can be used to control the
aspect ratio of the generated image.

Generating with a prompt and an image#

Commonly referred to as image-to-image, this mode also generates an image from text but uses an existing image as the
starting point. The required parameters are:
prompt - text to generate the image from
image - the image to use as the starting point for the generation
strength - controls how much influence the image parameter has on the output image
mode - must be set to image-to-image
Note: maximum request size is 10MiB.

Optional Parameters:#

Both modes support the following optional parameters:
model - the model to use (SD3 Medium, SD3 Large, or SD3 Large Turbo)
output_format - the the format of the output image
seed - the randomness seed to use for the generation
negative_prompt - keywords of what you do not wish to see in the output image
Note: for more details about these parameters please see the request schema below.

Output#

The resolution of the generated image will be 1MP. The default resolution is 1024x1024.

Credits#

SD3 Medium: Flat rate of 3.5 credits per successful generation.
SD3 Large: Flat rate of 6.5 credits per successful generation.
SD3 Large Turbo: Flat rate of 4 credits per successful generation.
As always, you will not be charged for failed generations.

Request

Header Params
authorization
string 
required
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.
>= 1 characters
content-type
string 
required
The content type of the request body. Do not manually specify this header; your HTTP client library will automatically include the appropriate boundary parameter.
>= 1 characters
Example:
multipart/form-data
accept
enum<string> 
required
Specify image/* to get the image bytes directly. Otherwise specify application/json to receive the image as base64 encoded JSON.
Allowed values:
image/*application/json
Default:
image/*
stability-client-id
string 
optional
The name of your application, used to help us communicate app-specific debugging or moderation issues to you.
<= 256 characters
Example:
my-awesome-app
stability-client-user-id
string 
optional
A unique identifier for your end user. Used to help us communicate user-specific debugging or moderation issues to you. Feel free to obfuscate this value to protect user privacy.
<= 256 characters
Example:
DiscordUser#9999
stability-client-version
string 
optional
The version of your application, used to help us communicate version-specific debugging or moderation issues to you.
<= 256 characters
Example:
1.2.1
Body Params multipart/form-data
prompt
string 
required
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.
>= 1 characters<= 10000 characters
mode
enum<string> 
GenerationMode
optional
Controls whether this is a text-to-image or image-to-image generation, which affects which parameters are required:
text-to-image requires only the prompt parameter
image-to-image requires the prompt, image, and strength parameters
Allowed values:
text-to-imageimage-to-image
Default:
text-to-image
Example:
text-to-image
image
file 
optional
The image to use as the starting point for the generation.
Supported formats:
jpeg
png
webp
Supported dimensions:
Every side must be at least 64 pixels
Important: This parameter is only valid for image-to-image requests.
strength
number 
optional
Sometimes referred to as denoising, this parameter controls how much influence the
image parameter has on the generated image. A value of 0 would yield an image that
is identical to the input. A value of 1 would be as if you passed in no image at all.
Important: This parameter is only valid for image-to-image requests.
>= 0<= 1
aspect_ratio
enum<string> 
optional
Controls the aspect ratio of the generated image. Defaults to 1:1.
Important: This parameter is only valid for text-to-image requests.
Allowed values:
21:916:93:25:41:14:52:39:169:21
Default:
1:1
Example:
1:1
model
enum<string> 
optional
The model to use for generation.
sd3-medium requires 3.5 credits per generation
sd3-large requires 6.5 credits per generation
sd3-large-turbo requires 4 credits per generation
Allowed values:
sd3-mediumsd3-largesd3-large-turbo
Default:
sd3-large
Example:
sd3-large
seed
number 
optional
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<= 4294967294
Default:
0
output_format
enum<string> 
optional
Dictates the content-type of the generated image.
Allowed values:
pngjpeg
Default:
png
Example:
png
negative_prompt
string 
optional
Keywords of what you do not wish to see in the output image.
This is an advanced feature.
Important: This parameter does not work with sd3-large-turbo.
<= 10000 characters

Request samples

Python
JavaScript
Shell
Java
Swift
Go
PHP
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Python
JavaScript
Shell
Java
curl --location --request POST 'https://api.ezlinkai.com/v2beta/stable-image/generate/sd3' \
--header 'authorization;' \
--header 'accept;' \
--header 'stability-client-id;' \
--header 'stability-client-user-id;' \
--header 'stability-client-version;' \
--form 'prompt=""' \
--form 'mode="text-to-image"' \
--form 'image=@""' \
--form 'strength=""' \
--form 'aspect_ratio="1:1"' \
--form 'model="sd3-large"' \
--form 'seed=""' \
--form 'output_format="png"' \
--form 'negative_prompt=""'

Responses

🟢200Generation was successful.
application/json
Body
object {0}
Example
{}
🟠400Invalid parameter(s), see the `errors` field for details.
🟠403Your request was flagged by our content moderation system.
🟠413Your request was larger than 10MiB.
🟠422Your request was well-formed, but rejected. See the `errors` field for details.
🟠429You have made more than 150 requests in 10 seconds.
🔴500An internal error occurred. If the problem persists [contact support](https://stabilityplatform.freshdesk.com/support/tickets/new).
Modified at 2024-08-18 02:37:15
Previous
Stable Image Core
Next
Sketch
Built with