Skip to main content
POST
Text-to-image

请求头

Accept
enum<string>
默认值:application/json

The format of the response. Leave blank for JSON, or set to 'image/png' for a PNG image.

可用选项:
application/json,
image/png
Organization
string

Allows for requests to be scoped to an organization other than the user's default. If not provided, the user's default organization will be used.

Stability-Client-ID
string

Used to identify the source of requests, such as the client application or sub-organization. Optional, but recommended for organizational clarity.

Stability-Client-Version
string

Used to identify the version of the application or service making the requests. Optional, but recommended for organizational clarity.

路径参数

engine_id
string
必填

请求体

application/json

Represents the optional parameters that can be passed to any generation request.

text_prompts
TextPrompts · object[]
必填

An array of text prompts to use for generation.

Given a text prompt with the text A lighthouse on a cliff and a weight of 0.5, it would be represented as:

Minimum array length: 1
height
integer
默认值:512

Height of the image to generate, in pixels, in an increment divisible by 64.

必填范围: x >= 128必须是以下数值的倍数 64
示例:

512

width
integer
默认值:512

Width of the image to generate, in pixels, in an increment divisible by 64.

必填范围: x >= 128必须是以下数值的倍数 64
示例:

512

cfg_scale
number
默认值:7

How strictly the diffusion process adheres to the prompt text (higher values keep your image closer to your prompt)

必填范围: 0 <= x <= 35
示例:

7

clip_guidance_preset
enum<string>
默认值:NONE
可用选项:
FAST_BLUE,
FAST_GREEN,
NONE,
SIMPLE,
SLOW,
SLOWER,
SLOWEST
示例:

"FAST_BLUE"

sampler
enum<string>

Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.

可用选项:
DDIM,
DDPM,
K_DPMPP_2M,
K_DPMPP_2S_ANCESTRAL,
K_DPM_2,
K_DPM_2_ANCESTRAL,
K_EULER,
K_EULER_ANCESTRAL,
K_HEUN,
K_LMS
示例:

"K_DPM_2_ANCESTRAL"

samples
integer
默认值:1

Number of images to generate

必填范围: 1 <= x <= 10
示例:

1

seed
integer
默认值:0

Random noise seed (omit this option or use 0 for a random seed)

必填范围: 0 <= x <= 4294967295
示例:

0

steps
integer
默认值:30

Number of diffusion steps to run.

必填范围: 10 <= x <= 50
示例:

50

style_preset
enum<string>

Pass in a style preset to guide the image model towards a particular style. This list of style presets is subject to change.

可用选项:
3d-model,
analog-film,
anime,
cinematic,
comic-book,
digital-art,
enhance,
fantasy-art,
isometric,
line-art,
low-poly,
modeling-compound,
neon-punk,
origami,
photographic,
pixel-art,
tile-texture
extras
object

Extra parameters passed to the engine. These parameters are used for in-development or experimental features and may change without warning, so please use with caution.

响应

请求成功

An array of results from the generation request, where each image is a base64 encoded PNG.

artifacts
object[]