Stable Diffusion 3 Turbo
ServerlessImageImg2Img
ServerlessImageImg2Img
Distilled, few-step version of Stable Diffusion 3, the newest image generation model from Stability AI, which is equal to or outperforms state-of-the-art text-to-image generation systems such as DALL-E 3 and Midjourney v6 in typography and prompt adherence, based on human preference evaluations. Stability AI has partnered with Fireworks AI, the fastest and most reliable API platform in the market, to deliver Stable Diffusion 3 and Stable Diffusion 3 Turbo. To use the API directly, visit https://platform.stability.ai/docs/api-reference#tag/Generate/paths/~1v2beta~1stable-image~1generate~1sd3/post
Stable Diffusion 3 Turbois available via partnership with Stability AI, in which Fireworks powers the underlying API. You must use a Stability API key and will be billed by Stability for usage, instead of Fireworks. See the API code example below or see the Stability API docs for full details.
Generate an image response for the given prompt.
import requests response = requests.post( f"https://api.stability.ai/v2beta/stable-image/generate/sd3", headers={ "authorization": f"Bearer sk-<STABILITY_API_KEY>", "accept": "image/*" }, files={"none": ''}, data={ mode="text-to-image", aspect_ratio="1:1", output_format="png", model="sd3-turbo", }, ) if response.status_code == 200: with open("./<DEFAULT_IMAGE_NAME>.png", 'wb') as file: file.write(response.content) else: raise Exception(str(response.json()))