Stable Diffusion API
Access Stable Diffusion instantly with Puter.js, and add AI to any app in a few lines of code without backend or API keys.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.txt2img("A beautiful sunset", {
model: "stabilityai/stable-diffusion-3-medium"
}).then(imageElement => {
document.body.appendChild(imageElement);
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.txt2img("A beautiful sunset", {
model: "stabilityai/stable-diffusion-3-medium"
}).then(imageElement => {
document.body.appendChild(imageElement);
});
</script>
</body>
</html>
List of Stable Diffusion Models
Stable Diffusion 3.5 Medium
stability-ai/stable-diffusion-3.5-medium
Stable Diffusion 3.5 Medium is the smallest model in Stability AI's SD 3.5 family, built on an improved MMDiT-X architecture with 2.5 billion parameters, roughly a third the size of SD 3.5 Large. Stability AI positions it as outperforming other medium-sized image models, and it supports a wider range of output resolutions, from 0.25 to 2 megapixels, than the fixed 1-megapixel target of Large. It sits between Large and Large Turbo on the quality-speed-cost curve, less detailed and prompt-adherent than Large, but cheaper to call through the API and still capable of the typography and complex-prompt handling introduced across the SD 3.5 lineup. It fits applications generating high volumes of images where Large's extra fidelity isn't worth the added cost.
ImageStable Diffusion 3.5 Large
stability-ai/stable-diffusion-3.5-large
Stable Diffusion 3.5 Large is Stability AI's flagship image model in the SD 3.5 family, built on a Multimodal Diffusion Transformer (MMDiT) architecture with 8.1 billion parameters. It combines three text encoders, OpenCLIP-ViT/G, CLIP-ViT/L, and T5-XXL, with QK-normalization for more stable training. Stability AI describes it as leading the market in prompt adherence and rivaling larger models in image quality, generating images up to 1 megapixel (1024x1024) with improved typography and complex-prompt understanding over the earlier SD3 Medium. Within the SD 3.5 lineup, Large is the highest-quality but slowest option, compared with the faster Large Turbo and the smaller, more resource-efficient Medium. It fits professional design work, marketing content, and any use case where prompt fidelity and image detail matter more than generation speed.
ImageStable Diffusion 3.5 Large Turbo
stability-ai/stable-diffusion-3.5-large-turbo
Stable Diffusion 3.5 Large Turbo is a distilled version of Stable Diffusion 3.5 Large, built to generate images in as few as four inference steps instead of the dozens a standard diffusion model needs. It keeps the same 8-billion-parameter MMDiT architecture and multi-encoder text understanding as Large, compressed for speed through step distillation. Stability AI markets it as one of the fastest inference options for a model of its size while staying competitive on quality and prompt adherence, trading some of Large's fidelity for lower latency. It targets applications where response time matters, such as interactive tools, rapid prototyping, or high-volume generation, and it costs less per image than Large through this API, making it a reasonable default when fast turnaround matters more than maximum detail.
ImageStable Diffusion 3 Medium
stabilityai/stable-diffusion-3-medium
Stable Diffusion 3 Medium is a Multimodal Diffusion Transformer (MMDiT) text-to-image model by Stability AI featuring improved image quality, typography, and complex prompt understanding. It uses three pretrained text encoders and was trained on over 1 billion images. The model is optimized for resource efficiency, making it suitable for both consumer hardware and enterprise GPUs.
ImageStable Diffusion XL Base 1.0
stabilityai/stable-diffusion-xl-base-1.0
Stable Diffusion XL Base 1.0 is a text-to-image latent diffusion model by Stability AI that generates more photorealistic images with better composition and legible text compared to earlier SD versions. It uses a mixture-of-experts pipeline and can work standalone or with an optional refiner model for enhanced results. The model runs efficiently on consumer GPUs with 8GB VRAM.
ImageStable Diffusion
stability-ai/stable-diffusion
Stable Diffusion is the original text-to-image latent diffusion model released by Stability AI in 2022, the checkpoint that first brought open-weight image generation to a mass audience. This deployment serves version 1.5, initialized from the Stable Diffusion 1.2 weights and fine-tuned for 595,000 steps at 512x512 resolution on the LAION-Aesthetics v2 5+ dataset. It predates newer Stability releases like SDXL and Stable Diffusion 3.5, and its own model card notes limits on photorealism, legible text, and rendering faces or hands accurately. Its main draw today is longevity: a large ecosystem of community fine-tunes, LoRAs, and tooling has built up around the v1.5 checkpoint over several years. Through this API, billing is metered by generation time rather than a flat per-image rate, so cost scales with how long a request takes to run. It suits low-cost, high-volume batch generation and workflows already built around the v1.5 checkpoint.
Frequently Asked Questions
The Stable Diffusion API gives you access to models for AI image generation. Through Puter.js, you can start using Stable Diffusion models instantly with zero setup or configuration.
Puter.js supports a variety of Stable Diffusion models, including Stable Diffusion 3.5 Medium, Stable Diffusion 3.5 Large, Stable Diffusion 3.5 Large Turbo, and more. Find all AI models supported by Puter.js in the AI model list.
With the User-Pays model, users cover their own AI costs through their Puter account. This means you can build apps without worrying about infrastructure expenses.
Puter.js is a JavaScript library that provides access to AI, storage, and other cloud services directly from a single API. It handles authentication, infrastructure, and scaling so you can focus on building your app.
Yes — the Stable Diffusion API through Puter.js works with any JavaScript framework, Node.js, or plain HTML. Just include the library and start building. See the documentation for more details.