Stable Diffusion 3
POST
/sd/v2beta/stable-image/generate/sd3
Generate
API status can be reviewed here.
Try it out
How to use
POST
request.authorization
field. The body of the request must bemultipart/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
parameter is the
prompt
, it also supports an aspect_ratio
parameter which can be used to control theaspect ratio of the generated image.
Generating with a prompt and an image
starting point. The required parameters are:
prompt
- text to generate the image fromimage
- the image to use as the starting point for the generationstrength
- controls how much influence the image
parameter has on the output imagemode
- must be set to image-to-image
Note: maximum request size is 10MiB.
Optional Parameters:
model
- the model to use (SD3 Medium, SD3 Large, or SD3 Large Turbo)output_format
- the the format of the output imageseed
- the randomness seed to use for the generationnegative_prompt
- keywords of what you do not wish to see in the output imageNote: for more details about these parameters please see the request schema below.
Output
Credits
请求参数
Header 参数
authorization
string
必需
>= 1 字符
content-type
string
必需
>= 1 字符
示例值:
multipart/form-data
accept
enum<string>
必需
image/*
to get the image bytes directly. Otherwise specify application/json
to receive the image as base64 encoded JSON.枚举值:
application/jsonimage/*
默认值:
image/*
Body 参数multipart/form-data
prompt
string
必需
elements, colors, and subjects will lead to better results.
>= 1 字符<= 10000 字符
示例值:
mode
enum<string>
GenerationMode
prompt
parameterprompt
, image
, and strength
parameters枚举值:
image-to-imagetext-to-image
默认值:
text-to-image
示例值:
text-to-image
image
file
可选
Important: This parameter is only valid for image-to-image requests.
strength
number
可选
image
parameter has on the generated image. A value of 0 would yield an image thatis 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
示例值:
0
aspect_ratio
enum<string>
可选
Important: This parameter is only valid for text-to-image requests.
枚举值:
16:91:121:92:33:24:55:49:169:21
默认值:
1:1
示例值:
1:1
model
enum<string>
可选
sd3-medium
requires 3.5 credits per generationsd3-large
requires 6.5 credits per generationsd3-large-turbo
requires 4 credits per generation枚举值:
sd3-largesd3-large-turbosd3-medium
默认值:
sd3-large
示例值:
sd3-large
seed
number
可选
0
to use a random seed.)>= 0<= 4294967294
默认值:
0
示例值:
0
output_format
enum<string>
可选
content-type
of the generated image.枚举值:
jpegpng
默认值:
png
示例值:
png
negative_prompt
string
可选
This is an advanced feature.
Important: This parameter does not work with sd3-large-turbo
.
<= 10000 字符
示例值:
示例代码
返回响应
修改于 2025-04-07 07:23:29