SaladTechnologies/comfyui-api

A simple API server to make ComfyUI easy to scale horizontally. Get outputs directly in the response, or asynchronously via a variety of storage providers.

What it solves

ComfyUI API transforms ComfyUI from a local, stateful GUI-based tool into a stateless, scalable API server. This allows developers to integrate powerful generative AI workflows (image and video generation) into larger applications without managing the underlying ComfyUI state or manual file handling.

How it works

The project acts as a wrapper around the ComfyUI /prompt API. It manages the lifecycle of a request by downloading required input media, executing the workflow, and then delivering the output. It supports two primary modes of operation:

  • Synchronous: Returns base64-encoded images directly in the HTTP response.
  • Asynchronous: Sends completed outputs to a specified webhook URL or uploads them to cloud storage.

It also includes features for dynamic model loading, an LRU cache for local storage management, and the ability to define startup manifests for automatic model and extension installation.

Who it’s for

Developers and ML engineers who want to deploy ComfyUI workflows as scalable microservices, particularly those using containerized environments like Kubernetes or SaladCloud.

Highlights

  • Stateless Architecture: Enables horizontal scaling behind load balancers.
  • Flexible Output Delivery: Supports base64 responses, webhooks, and modular storage backends (S3, Azure Blob, Hugging Face, HTTP).
  • Broad Model Support: Verified for Stable Diffusion (1.5, XL, 3.5), Flux, AnimateDiff, and various video models like Hunyuan, CogVideoX, and Mochi.
  • Dynamic Model Loading: Automatically caches models provided via URL in model-loading nodes.
  • Custo-mizable Image Processing: Allows returning images in PNG, JPEG, or WebP formats via API parameters.
  • Single Binary Distribution: Distributed as a single binary for easy deployment with no external dependencies.

Related

  • Project
  • Project
  • Project
  • Project
  • Project