mrhan1993/Fooocus-API

FastAPI powered API for Fooocus

What it solves

Fooocus-API provides a professional REST API wrapper for Fooocus, an image generation software based on Stable Diffusion. It replaces the often difficult experience of using the Gradio client, allowing developers to integrate Fooocus's high-quality image generation capabilities into their own applications using any programming language.

How it works

Built with FastAPI, the project wraps the Fooocus engine to expose its functionality via HTTP endpoints. It handles the complex inner optimizations of Fooocus—which automate manual tweaking typically required in Stable Diffusion—and provides a structured way to send prompts, images, and configuration parameters (like ImageEnhance controllers) to the generator. It can be deployed via Docker, Conda, or virtual environments, and supports remote deployment through Replicate.

Who it’s for

Developers who want to use Fooocus's simplified, high-quality image generation workflow programmatically without dealing with the Gradio interface or manual Stable Diffusion parameter tuning.

Highlights

  • REST API Access: Uses FastAPI to provide a standard interface for image generation.
  • Simplified Workflow: Leverages Fooocus's design to eliminate the need for manual technical parameter tweaking.
  • Flexible Deployment: Supports Docker (with NVIDIA Container Toolkit), Conda, and venv.
  • Advanced Controls: Includes support for ImageEnhance, UpscaleVary, and various ControlNets.
  • Security Features: Includes an optional API key for secure remote access and blocks non-public URL inputs to prevent SSRF.

Related

  • Project
  • Project
  • Project
  • Project
  • Project