Run Stable Diffusion and Flux as an API
Host SDXL, Flux, or any diffusion checkpoint behind a cloud API.

Fast inference for image generation
Everything you need to serve generative models at scale.
“Switching to Beam has been really helpful. It has addressed all the pain points we had with Replicate, enabling us to provide a better, more reliable service to our customers.”
Ship an image API in three steps
Load the pipeline once
Load your checkpoint when the container boots — requests reuse the warm pipeline instead of reloading weights.
Deploy the endpoint
beam deploy gives you an authenticated HTTPS URL backed by autoscaling GPUs.
Generate over HTTP
POST a prompt, get back a hosted image URL. Beam handles queuing, scaling, and auth.
$ beam deploy app.py:generate
=> Deployed 🎉
=> https://sdxl-abc123.app.beam.cloud
$ curl -X POST https://sdxl-abc123.app.beam.cloud \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"prompt": "isometric voxel city at dusk"}'
{"url": "https://app.beam.cloud/output/id/8b0d..."}Frequently asked questions
Which models can I host?
Anything diffusers can load: SDXL, SD 1.5, Flux, plus your own fine-tuned checkpoints and LoRAs.
How does this compare to per-image APIs like Replicate or fal?
Per-image platforms charge a markup on every generation, and your model options are limited to their catalog. On Beam you deploy your own checkpoints and LoRAs, pay per-second for the GPU while it's generating, and your code stays private.
How are images returned?
Save them with Output and return a hosted public URL, or base64-encode them into the JSON response.
What about cold starts with large checkpoints?
Keep weights on a volume so containers skip the download, and use on_start so each container loads the pipeline exactly once.
Can I keep an endpoint warm?
Yes — set keep_warm_seconds to hold containers hot for latency-sensitive apps, and let everything else scale to zero.
Do I need to manage queues for burst traffic?
No. Autoscaling is managed by Beam — set your scaling policy and containers are added as request volume grows.
Related use cases
Turn ComfyUI workflows into production APIs
Turn ComfyUI workflows into autoscaling API endpoints.
Training & Fine-tuningFine-tune models on GPUs
LoRA and QLoRA fine-tuning on serverless GPUs.
InferenceGenerative media on serverless GPUs
Text-to-video on H100s — no reserved GPUs, hosted outputs.
Start shipping on infra
you won’t outgrow.
Run sandboxes and GPU workloads on your cloud, and scale out to ours when you need to. No infra to manage.