soshimozi/stable-diffusion-backed-image-gen

TypeScript

0

19 commits

updated Nov 22, 2025

See the code

README

stable-diffusion-backed-image-gen

This project implements a real-time AI image generation pipeline using:

  • React frontend (hosted on AWS)
  • FastAPI backend hosted on Fly.io
  • Modal as the GPU-backed image generation worker


System Architecture

[ React UI ] → POST /enqueue → [ FastAPI ]
                     ↳ POST /status → [ FastAPI ] 
                                ↳ generates image

Deployment

1. Deploy Modal Worker

Steps:

  1. Sign up at https://modal.com

  2. Create a Hugging Face token:

  3. Register your Hugging Face token with Modal:

modal secret create hf-token
# Paste in:
# HF_TOKEN=your_token_here
  1. Deploy the worker:
modal deploy prompt_forge.py

FastAPI Endpoints

  • POST /generate → accepts prompt, returns job ID
  • POST /status → accepts job_id, returns status of job
  • GET /models → returns list of available models

Notes

  • The image generation logic uses FluxImageGenerator

Next Steps

  • Add retry and error handling

soshimozi/stable-diffusion-backed-image-gen

TypeScript

0

19 commits

updated Nov 22, 2025

See the code

README

stable-diffusion-backed-image-gen

This project implements a real-time AI image generation pipeline using:

  • React frontend (hosted on AWS)
  • FastAPI backend hosted on Fly.io
  • Modal as the GPU-backed image generation worker


System Architecture

[ React UI ] → POST /enqueue → [ FastAPI ]
                     ↳ POST /status → [ FastAPI ] 
                                ↳ generates image

Deployment

1. Deploy Modal Worker

Steps:

  1. Sign up at https://modal.com

  2. Create a Hugging Face token:

  3. Register your Hugging Face token with Modal:

modal secret create hf-token
# Paste in:
# HF_TOKEN=your_token_here
  1. Deploy the worker:
modal deploy prompt_forge.py

FastAPI Endpoints

  • POST /generate → accepts prompt, returns job ID
  • POST /status → accepts job_id, returns status of job
  • GET /models → returns list of available models

Notes

  • The image generation logic uses FluxImageGenerator

Next Steps

  • Add retry and error handling