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 is a powerful node-based interface for generative AI, but it is primarily designed as an interactive tool. This project provides a stateless API wrapper around ComfyUI, making it easier to integrate into production environments where horizontal scaling, asynchronous processing, and automated model management are required.

How it works

The server acts as a proxy that sits in front of ComfyUI. It accepts API-formatted prompt graphs via HTTP requests, handles the downloading of required input media, executes the workflow through ComfyUI's internal API, and then delivers the resulting images. It supports both synchronous responses (returning base64 images directly) and asynchronous responses (sending results to a webhook or cloud storage).

Who it’s for

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

Highlights

  • Stateless Architecture: Designed to be scaled horizontally behind a load balancer.
  • Flexible Output Delivery: Supports returning images as base64, uploading to S3-compatible storage, Azure Blob Storage, or sending them via webhooks.
  • Automated Model Management: Features dynamic model loading from URLs, a manifest system for startup downloads, and an on-demand model download endpoint.
  • Broad Model Support: Verified to work with Stable Diffusion (1.5, XL, 3.5), Flux, AnimateDiff, and various video models like LTX, Hunyuan, CogVideoX, and Mochi.
  • Customizable Endpoints: Allows the creation of dynamic workflow endpoints by adding script files to the server.

Related

  • Project
  • Project
  • Project
  • Project
  • Project