> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stable Diffusion 3

> 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](https://fireworks.ai/). 
API status can be reviewed [here](https://readme.fireworks.ai/page/application-status). 

### Try it out
Grab your [API key](https://platform.stability.ai/account/keys) and head over to one of the following sites:    
- [![Open Fireworks Playground](https://platform.stability.ai/svg/fireworks.svg)](https://fireworks.ai/models/stability/sd3)
- [![Open Google Colab](https://platform.stability.ai/svg/google-colab.svg)](https://colab.research.google.com/github/stability-ai/stability-sdk/blob/main/nbs/SD3_API.ipynb)


### 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.



## OpenAPI

````yaml /api-reference/openapi.json post /sd/v2beta/stable-image/generate/sd3
openapi: 3.0.1
info:
  title: MaxAPI 模型 API
  description: MaxAPI 文本、图像、视频、音频和音乐模型接口。
  version: 1.0.0
servers:
  - url: https://api.maxapi.ai
    description: MaxAPI 生产环境
security: []
tags:
  - name: 模型接口
  - name: 模型接口/绘图模型
  - name: 模型接口/绘图模型/OpenAI Dall-e 格式
  - name: 模型接口/绘图模型/Flux系列
  - name: 模型接口/绘图模型/Flux系列/OpenAI Dalle 格式
  - name: 模型接口/绘图模型/Z-image
  - name: 模型接口/绘图模型/Banana生图异步格式(未来可能兼容其他模型)
  - name: 模型接口/聊天接口（Chat）
  - name: 模型接口/视频模型
  - name: 模型接口/视频模型/谷歌veo
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/VertexAI-VEO官方格式/任务查询
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/任务查询
  - name: 模型接口/视频模型/谷歌veo/AIStudio-VEO官方格式/下载视频(只有aistudio有这个动作)
  - name: 模型接口/视频模型/谷歌veo/GCP异步任务接口
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式/视频生成
  - name: 模型接口/视频模型/谷歌veo/官网逆向接口格式/OpenAI官方视频格式(适配 newapi)
  - name: 模型接口/视频模型/Wan阿里万象(官方格式)
  - name: 模型接口/视频模型/豆包seedance(官方格式)
  - name: 模型接口/视频模型/Vidu官方格式
  - name: 模型接口/视频模型/Vidu官方格式/视频生成
  - name: 模型接口/视频模型/Vidu官方格式/图像生成
  - name: 模型接口/视频模型/Vidu官方格式/音频生成
  - name: 模型接口/视频模型/Vidu官方格式/其他功能
  - name: 模型接口/视频模型/Vidu官方格式/任务管理
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式/视频生成
  - name: 模型接口/视频模型/MiniMax-Hailuo官方格式/任务管理
  - name: 模型接口/视频模型/MiniMax-Hailuo-OpenAI-Sora兼容格式
  - name: 模型接口/视频模型/MiniMax-Hailuo-OpenAI-Sora兼容格式/视频生成
  - name: 模型接口/视频模型/Sora-2-官方格式
  - name: 模型接口/视频模型/Sora-2-官方格式/创建角色接口
  - name: 模型接口/视频模型/Sora-2026-01-07新格式
  - name: 模型接口/自动补全接口（Completions）
  - name: 模型接口/图像接口（Images）
  - name: 模型接口/向量生成接口（Embeddings）
  - name: 模型接口/音频接口（Audio）
  - name: 模型接口/MJ图像(视频)接口
  - name: 模型接口/MJ图像(视频)接口/InsightFace任务提交
  - name: 模型接口/MJ图像(视频)接口/任务提交
  - name: 模型接口/MJ图像(视频)接口/任务查询
  - name: 模型接口/MJ图像(视频)接口/MJ视频相关
  - name: 模型接口/Suno音乐接口
  - name: 模型接口/Suno音乐接口/GoAmzAI格式
  - name: 模型接口/Suno音乐接口/GoAmzAI格式/v3.5
  - name: 模型接口/Suno音乐接口/GoAmzAI格式/v3.0
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/所有接口
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景1 生成自定义音乐(带歌词)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 2 通过提示词直接生成音乐(带歌词)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 4 通过提示词直接生成音乐(纯音乐)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景3 生成自定义音乐(纯音乐)
  - name: 模型接口/Suno音乐接口/官网原生格式(v2)/场景 5 上传自定义音频并续写
  - name: 模型接口/Suno音乐接口/生成歌词
  - name: 模型接口/Suno音乐接口/NewAPI兼容格式
  - name: 模型接口/Luma视频接口
  - name: 模型接口/Luma视频接口/GoAmzAI格式
  - name: 模型接口/Luma视频接口/GoAmzAI格式/付费版
  - name: 模型接口/Luma视频接口/GoAmzAI格式/免费版
  - name: 模型接口/Luma视频接口/官网原生格式(v2)
  - name: 模型接口/SD图像接口
  - name: 模型接口/SD图像接口/SD3
  - name: 模型接口/SD图像接口/SDXL
  - name: 模型接口/Fish Audio
  - name: 模型接口/统一视频接口
  - name: 模型接口/统一视频接口/阿里Wan(万相视频
  - name: 模型接口/统一视频接口/Sora2视频
  - name: 模型接口/统一视频接口/Seedance(即梦视频
  - name: 模型接口/统一视频接口/Google-Veo
  - name: 历史接口
  - name: 历史接口/PPT类接入
  - name: 历史接口/请求示例
  - name: 历史接口/原始接口（参数需要定义后才能发送请求）
  - name: 佐糖API
  - name: MewXAI星月熊开放API
  - name: MewXAI星月熊开放API/开放API接口
  - name: MewXAI星月熊开放API/示例
  - name: Ideogram（绘画）
  - name: 可灵API
  - name: RunWay官方API
  - name: 视频生成
  - name: 任务查询
  - name: Wan官方格式
  - name: 图像生成
  - name: 音频生成
  - name: 其他功能
  - name: 任务管理
  - name: InsightFace任务提交
  - name: 任务提交
  - name: Generate
  - name: SDXL & SD1.6
paths:
  /sd/v2beta/stable-image/generate/sd3:
    post:
      tags:
        - 模型接口/SD图像接口/SD3
        - Generate
      summary: Stable Diffusion 3
      description: >-
        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](https://fireworks.ai/). 

        API status can be reviewed
        [here](https://readme.fireworks.ai/page/application-status). 


        ### Try it out

        Grab your [API key](https://platform.stability.ai/account/keys) and head
        over to one of the following sites:    

        - [![Open Fireworks
        Playground](https://platform.stability.ai/svg/fireworks.svg)](https://fireworks.ai/models/stability/sd3)

        - [![Open Google
        Colab](https://platform.stability.ai/svg/google-colab.svg)](https://colab.research.google.com/github/stability-ai/stability-sdk/blob/main/nbs/SD3_API.ipynb)



        ### 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.
      parameters:
        - name: authorization
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
            description: >-
              Your [Stability API
              key](https://platform.stability.ai/account/keys), 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.
            minLength: 1
        - name: content-type
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
            minLength: 1
            description: >-
              The content type of the request body. Do not manually specify this
              header; your HTTP client library will automatically include the
              appropriate boundary parameter.
            example: multipart/form-data
        - name: accept
          in: header
          description: ''
          required: true
          example: ''
          schema:
            type: string
            default: image/*
            description: >-
              Specify `image/*` to get the image bytes directly. Otherwise
              specify `application/json` to receive the image as base64 encoded
              JSON.
            enum:
              - application/json
              - image/*
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 10000
                  description: >-
                    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.
                  example: ''
                mode:
                  type: string
                  enum:
                    - image-to-image
                    - text-to-image
                  default: text-to-image
                  description: >-
                    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
                  title: GenerationMode
                  example: text-to-image
                image:
                  type: string
                  description: >-
                    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.
                  format: binary
                  example: ''
                strength:
                  type: number
                  minimum: 0
                  maximum: 1
                  description: >-
                    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.
                  example: ''
                aspect_ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '1:1'
                    - '21:9'
                    - '2:3'
                    - '3:2'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '9:21'
                  default: '1:1'
                  description: >-
                    Controls the aspect ratio of the generated image. Defaults
                    to 1:1.


                    > **Important:** This parameter is only valid for
                    **text-to-image** requests.
                  example: '1:1'
                model:
                  type: string
                  enum:
                    - sd3-large
                    - sd3-large-turbo
                    - sd3-medium
                  default: sd3-large
                  description: |-
                    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
                  example: sd3-large
                seed:
                  type: number
                  minimum: 0
                  maximum: 4294967294
                  default: 0
                  description: >-
                    A specific value that is used to guide the 'randomness' of
                    the generation. (Omit this parameter or pass `0` to use a
                    random seed.)
                  example: ''
                output_format:
                  type: string
                  enum:
                    - jpeg
                    - png
                  default: png
                  description: Dictates the `content-type` of the generated image.
                  example: png
                negative_prompt:
                  type: string
                  maxLength: 10000
                  description: >-
                    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`.
                  example: ''
              required:
                - prompt
            example:
              prompt: ''
              mode: text-to-image
              image: ''
              strength: ''
              aspect_ratio: '1:1'
              model: sd3-large
              seed: ''
              output_format: png
              negative_prompt: ''
      responses:
        '200':
          description: 图片生成成功。返回格式由请求中的 Accept 头决定。
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: object
                properties:
                  image:
                    type: string
                    format: byte
                    description: Base64 编码的图片。
                  finish_reason:
                    type: string
                  seed:
                    type: integer
        '400':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
        '403':
          description: 请求失败
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentModerationResponse'
        '413':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  id: 4212a4b66fbe1cedca4bf2133d35dca5
                  name: payload_too_large
                  errors:
                    - 'body: payloads cannot be larger than 10MiB in size'
        '422':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  id: ff54b236a3acdde1522cb1ba641c43ed
                  name: invalid_language
                  errors:
                    - English is the only supported language for this service.
        '429':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  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.
        '500':
          description: 请求失败
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: >-
                      A unique identifier associated with this error. Please
                      include this in any [support
                      tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

                      you file, as it will greatly assist us in diagnosing the
                      root cause of the problem.
                    example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                  name:
                    type: string
                    minLength: 1
                    description: >-
                      Short-hand name for an error, useful for discriminating
                      between errors with the same status code.
                    example: bad_request
                  errors:
                    type: array
                    items:
                      type: string
                    minItems: 1
                    description: One or more error messages indicating what went wrong.
                    example:
                      - 'some-field: is required'
                required:
                  - id
                  - name
                  - errors
                example:
                  id: 2a1b2d4eafe2bc6ab4cd4d5c6133f513
                  name: internal_error
                  errors:
                    - >-
                      An unexpected server error has occurred, please try again
                      later.
      deprecated: false
      security: []
components:
  schemas:
    ContentModerationResponse:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: >-
            A unique identifier associated with this error. Please include this
            in any [support
            tickets](https://stabilityplatform.freshdesk.com/support/tickets/new) 

            you file, as it will greatly assist us in diagnosing the root cause
            of the problem.
          example: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
        name:
          type: string
          minLength: 1
          description: >-
            Our content moderation system has flagged some part of your request
            and subsequently denied it.  You were not charged for this request. 
            While this may at times be frustrating, it is necessary to maintain
            the integrity of our platform and ensure a safe experience for all
            users.


            If you would like to provide feedback, please use the [Support
            Form](https://stabilityplatform.freshdesk.com/support/tickets/new).
          enum:
            - content_moderation
        errors:
          type: array
          items:
            type: string
          minItems: 1
          description: One or more error messages indicating what went wrong.
          example:
            - 'some-field: is required'
      required:
        - id
        - name
        - errors
      description: Your request was flagged by our content moderation system.
      example:
        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.

````