Skip to content
Back to projects

Case study 16 / 18 · Tools

image generation service

Status: Used in Stratus Spoon (v2)

A backend service that generates recipe images from a title and description using Stable Diffusion XL through ComfyUI. It uploads the resulting image to Firebase Storage and returns an image URL for use by the calling application.

Case study

A Python FastAPI service, used by Stratus Spoon (v2), that connects a remote ComfyUI server to Firebase Storage. It takes a recipe title and description and returns the URL of a generated image.

The problem

Give the recipe app image generation as a separate backend workflow, so the app can ask for an image without coordinating model runs and storage itself.

What was built

  • A generate-image endpoint that accepts a recipe title and description.
  • Generation with Stable Diffusion XL on a remote ComfyUI server, followed by upload to Firebase Storage.
  • A returned image URL, cleanup of temporary files and restricted browser-origin access.

Key decisions

  • Generation is orchestrated by its own backend service.
  • Models run on a remote ComfyUI server, not in the browser.
  • Results go to cloud storage, and the local temporary file is removed.
  • Service credentials stay out of the repository.

Where it stands

Built and used by Stratus Spoon (v2). It needs a reachable ComfyUI server with an SDXL checkpoint, plus access to Firebase Storage.

How it was built

Backend

  • Python
  • FastAPI — The generate-image endpoint
  • Uvicorn

Data

  • Firebase Storage — Stores generated images

AI

  • ComfyUI — Runs the generation workflow on a remote server
  • Stable Diffusion XL — The image model

Testing

  • pytest