aws-solutions-library-samples/guidance-for-asynchronous-inference-with-stable-diffusion-on-aws
Stable Diffusion is a popular Open Source project for generating images using Gen AI. Building a scalable and cost efficient inference solution is a common challenge. This project shows how to use AWS serverless and container services to build an end-to-end scalable, secure and price effecient asynchronous image generation architecture.
The architecture orchestrates request validation through API Gateway and Lambda, then routes prompts via SNS to model-specific SQS queues that trigger KEDA-based pod scaling on EKS. Karpenter provisions GPU instances (g5/g6/p4) with spot pricing support and SOCI Parallel Pull for optimized container startup, while Stable Diffusion runtimes stream model weights on-demand from S3 via the Mountpoint CSI driver. The solution uses Infrastructure-as-Code (AWS CDK) for reproducible deployment and achieves sub-$0.001 per-image inference costs at scale by combining serverless orchestration with efficient container scheduling.
Stars
38
Forks
7
Language
Python
License
MIT-0
Category
Last pushed
Mar 10, 2026
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/diffusion/aws-solutions-library-samples/guidance-for-asynchronous-inference-with-stable-diffusion-on-aws"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
Stability-AI/stability-sdk
SDK for interacting with stability.ai APIs (e.g. stable diffusion inference)
kiri-art/stable-diffusion-react-nextjs-mui-pwa
PWA Web App front end for Stable Diffusion, on React/NextJS with Material UI
ShiftHackZ/Stable-Diffusion-Android
Stable Diffusion AI client app for Android
riffusion/riffusion-app-hobby
Stable diffusion for real-time music generation (web app)
aqualxx/stable-ui
🔥 A frontend for generating images with Stable Diffusion through Stable Horde