YanAI  by huaiyuechusan

Self-hosted AI image generation and management system

Created 1 month ago
273 stars

Top 94.3% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

YanAI is a self-hosted system for AI image creation and management, built upon reverse-engineered ChatGPT image capabilities. It offers an OpenAI-compatible API, an online drawing workbench, and comprehensive management features for users and accounts, benefiting those seeking a flexible, self-hosted solution for AI image workflows.

How It Works

The project reverse-engineers OpenAI's official website interfaces to provide an OpenAI-compatible API for image generation and editing. It supports multiple storage backends (JSON, SQLite, PostgreSQL, Git) and features account pooling, user quotas, and channel management for request routing. This approach allows for self-hosted control and customization of AI image generation processes.

Quick Start & Requirements

Installation is primarily via Docker. Build and run using docker build, docker push, and docker compose up -d. For multi-user stability, PostgreSQL is recommended. Configuration is managed via config.json or environment variables.

Highlighted Details

  • OpenAI-Compatible API: Exposes endpoints for image generation (/v1/images/generations), edits (/v1/images/edits), chat completions, and responses, supporting text streaming.
  • Flexible Storage: Supports local JSON (default), SQLite, PostgreSQL (recommended for concurrency), and Git private repositories.
  • Online Drawing Workbench: Features text-to-image, image-to-image, and multi-reference editing with presets, history, and image management.
  • Account Pool Management: Handles account refresh, round-robin execution, proxy support, and multiple import methods for managing OpenAI API keys.
  • Admin Panel: Includes user management, channel configuration, model management with billing standards, logging, and WebDAV integration for image archiving.
  • Multi-user Concurrency: Designed for stable multi-user operation, leveraging database transactions and row-level locking, especially with PostgreSQL.

Maintenance & Community

The project acknowledges inspiration from chatgpt2api and Banana Prompt Quicker. Community support is available via "L站" (LinuxDO).

Licensing & Compatibility

No explicit open-source license is provided. The project's disclaimer strictly prohibits commercial use, profit-making, mass operations, or resale, limiting its use to personal learning, technical research, and non-commercial exchange.

Limitations & Caveats

Due to its reliance on reverse-engineered interfaces, there is a significant risk of OpenAI account suspension or permanent bans. The system is explicitly not for commercial use, and experimental features like streaming require careful testing with reverse proxies.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
102 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.