Skip to content

Repository files navigation

Apex.ai

Self-hosted multi-user AI studio built on FastAPI and ComfyUI.

Features

  • Image, video, music, SFX, and TTS generation workflows.
  • Personal generation chats with inline results.
  • Shared gallery with likes, comments, privacy controls, share links, and ZIP downloads.
  • Built-in direct messages, profiles, posts, follows, and notifications.
  • Prompt Enhancer with Google AI Studio and OpenRouter fallbacks.
  • Separate LLM chat area with provider failover.
  • Admin panel for user management, moderation, and maintenance mode.

Stack

  • Python + FastAPI
  • SQLite
  • ComfyUI
  • Jinja templates + static frontend assets

Quick Start

  1. Copy .env.example to .env.
  2. Set a strong APP_SECRET.
  3. Before the first launch, set:
INITIAL_ADMIN_USERNAME=admin
INITIAL_ADMIN_PASSWORD=change-this-before-launch
INITIAL_ADMIN_NICKNAME=Administrator
  1. Add any API keys you want to use.
  2. Start ComfyUI on 127.0.0.1:8188.
  3. Start Apex.ai with run.bat on Windows or ./run.sh on Linux/macOS.
  4. Open http://127.0.0.1:8000.

The first admin account is created automatically only when the database is empty and INITIAL_ADMIN_USERNAME plus INITIAL_ADMIN_PASSWORD are set.

Environment

Important variables:

APP_SECRET=replace-with-a-long-random-secret
INITIAL_ADMIN_USERNAME=
INITIAL_ADMIN_PASSWORD=
INITIAL_ADMIN_NICKNAME=Administrator

GOOGLE_AI_STUDIO_API_KEY=
OPENROUTER_API_KEY=
GROQ_API_KEY=
OLLAMA_API_KEYS=

Optional bulk user seed:

FRIEND_USERS=alice:password123,bob:password456
FRIEND_NICKNAMES=alice:Alice,bob:Bob
ADMIN_USERS=alice
NO_GALLERY_USERS=
NO_PUBLISH_USERS=

Public Tunnel

Tunnel autostart is disabled in .env.example on purpose. Turn it on only if you really want to expose the site publicly.

Example:

TUNNEL_AUTOSTART=true
TUNNEL_PROVIDER=localhostrun
LOCALHOST_RUN_USER=nokey@localhost.run

Cloudflare named tunnels are also supported:

TUNNEL_PROVIDER=cloudflared
CLOUDFLARED_TUNNEL_TOKEN=your-cloudflare-token

Expose only Apex.ai. Do not expose the ComfyUI 8188 port directly.

Project Layout

  • app/ application code
  • templates/ Jinja templates
  • static/ frontend assets
  • workflows/ ComfyUI API workflows
  • config/models.json available models

Runtime files such as .env, SQLite databases, logs, tunnels, and generated media are ignored by .gitignore and should not be committed.

Release Notes

This repository is prepared for public publishing:

  • real secrets are expected only in local .env
  • example config no longer contains personal logins or passwords
  • no default public tunnel is enabled
  • no hardcoded default admin account is created from code

Notes

  • The database is created automatically at data/app.sqlite3.
  • Media files are stored under media/.
  • Audio workflows live in workflows/ and require matching ComfyUI models/custom nodes.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages