Stable Diffusion 3.5
Generate using Stable Diffusion 3.5 models, Stability AI latest base model:
-
Stable Diffusion 3.5 Large: At 8 billion parameters, with superior quality and prompt adherence, this base model is the most powerful in the Stable Diffusion family. This model is ideal for professional use cases at 1 megapixel resolution.
-
Stable Diffusion 3.5 Large Turbo: A distilled version of Stable Diffusion 3.5 Large. SD3.5 Large Turbo generates high-quality images with exceptional prompt adherence in just 4 steps, making it considerably faster than Stable Diffusion 3.5 Large.
-
Stable Diffusion 3.5 Medium: With 2.5 billion parameters, the model delivers an optimal balance between prompt accuracy and image quality, making it an efficient choice for fast high-performance image generation.
-
Stable Diffusion 3.5 Flash: A distilled version of Stable Diffusion 3.5 Medium. SD3.5 Flash generates high-quality images with a 4 step process instead of 40, making it faster than Stable Diffusion 3.5 Medium.
Read more about the model capabilities here.
As of April 17, 2025, we have deprecated the Stable Diffusion 3.0 APIs and will be automatically re-routing calls to Stable Diffusion 3.0 models to Stable Diffusion 3.5 APIs at no extra cost. You can read more in the release notes.
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 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 fromimage- the image to use as the starting point for the generationstrength- controls how much influence theimageparameter has on the output imagemode- must be set toimage-to-image
Note: maximum request size is 10MiB.
Optional Parameters:
Both modes support the following optional parameters:
model- the model to use (SD 3.5 Large, SD 3.5 Large Turbo, SD 3.5 Medium, SD 3.5 Flash)output_format- 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 imagecfg_scale- controls how strictly the diffusion process adheres to the prompt textstyle_preset- guides the image model towards a particular style
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
- SD 3.5 Large: Flat rate of 6.5 credits per successful generation.
- SD 3.5 Large Turbo: Flat rate of 4 credits per successful generation.
- SD 3.5 Medium: Flat rate of 3.5 credits per successful generation.
- SD 3.5 Flash: Flat rate of 2.5 credits per successful generation.
As always, you will not be charged for failed generations.
Authorizations
Your Stability API key, sent as a bearer token in the Authorization header.
Headers
Body
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
promptparameter - image-to-image requires the
prompt,image, andstrengthparameters
text-to-image, image-to-image 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. For SD 3.5 Flash, the best results for image-to-image generation are achieved with a
strengthbetween .94 - .97.
0 <= x <= 1The model to use for generation.
sd3.5-largerequires 6.5 credits per generationsd3.5-large-turborequires 4 credits per generationsd3.5-mediumrequires 3.5 credits per generationsd3.5-flashrequires 2.5 credits per generation- As of the April 17, 2025,
sd3-large,sd3-large-turboandsd3-mediumare re-routed to theirsd3.5-[model version]equivalent, at the same price.
sd3.5-large, sd3.5-large-turbo, sd3.5-medium Response
Generation was successful.
The bytes of the generated image.
The finish-reason and seed will be present as headers.