Fooocus-API  by mrhan1993

FastAPI backend for Fooocus, enabling REST API access

Created 2 years ago
653 stars

Top 51.1% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a FastAPI-powered REST API for Fooocus, an offline, open-source image generation software that simplifies Stable Diffusion and Midjourney's capabilities. It allows users to leverage Fooocus's advanced features programmatically from any language, benefiting developers and researchers seeking to integrate AI image generation into their applications or workflows.

How It Works

The API wraps the Fooocus Gradio application, exposing its functionalities through REST endpoints. It utilizes FastAPI for efficient web serving and supports both self-hosted deployments (via conda or venv) and Docker. The project aims to abstract away the complexities of Fooocus's underlying Gradio interface, offering a cleaner, more accessible programmatic interface.

Quick Start & Requirements

  • Installation: conda env create -f environment.yaml and conda activate fooocus-api, then python main.py. Alternatively, use Docker: docker run -d --gpus=all -p 8888:8888 konieshadow/fooocus-api.
  • Prerequisites: Python >= 3.10 (or conda), NVIDIA GPU with CUDA 12.1 recommended for PyTorch.
  • Setup: Initial setup may involve downloading models and can take time.
  • Docs: API details are available here.

Highlighted Details

  • Provides a programmatic interface to Fooocus, enabling integration into custom applications.
  • Supports image enhancement features with detailed parameter control via JSON payloads.
  • Offers deployment options including self-hosting and Docker, with GPU support.
  • Allows passing Fooocus-specific command-line flags for fine-tuned generation.

Maintenance & Community

The project is actively maintained by mrhan1993. Community interaction channels are not explicitly listed in the README.

Licensing & Compatibility

  • License: GNU General Public License v3.0 (GPL-3.0).
  • Compatibility: The GPL-3.0 license may impose copyleft restrictions on derivative works, potentially requiring open-sourcing of applications that link to or incorporate this API. The default checkpoint is under CreativeML Open RAIL-M.

Limitations & Caveats

The README notes potential installation issues with groundingdino-py, particularly on Chinese Windows environments. It also advises caution with --skip-pip after Fooocus updates due to dependency changes. The enhance_uov_prompt_type parameter's function is not fully detailed.

Health Check
Last Commit

4 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Starred by Pawel Garbacki Pawel Garbacki(Cofounder of Fireworks AI), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
2 more.

gpt4free by xtekky

0.1%
65k
API package for multi-provider LLM requests (GPT-4.1, Gemini 2.5, Deepseek R1)
Created 2 years ago
Updated 5 days ago
Feedback? Help us improve.