Skip to content

Repository files navigation

Agnes AI Platform

Python Vue License

🌐 Language / 语言

English | 中文

An all-in-one AI creation platform — chat with AI, generate images & videos, and compose on an infinite canvas. Powered by Agnes AI, with a Vue 3 + FastAPI full-stack architecture that keeps your API key secure on the server.

What Is Agnes AI Platform

Agnes AI Platform is a self-hosted web application that brings together multiple AI capabilities into a single, cohesive experience:

  • AI Chat — Conversational AI with tool calling. Chat naturally, and the AI can automatically trigger image or video generation when it detects your intent.
  • Image Generation — Text-to-image and image-to-image, with multiple models and size options.
  • Video Generation — Text-to-video, image-to-video, and keyframe animation, with async polling and real-time progress.
  • Infinite Canvas — A free-form workspace where you can place generated images as nodes, connect them, and re-generate or remix with context-aware operations.
  • Multi-Provider Management — Add and switch between multiple AI API providers (different base URLs, API keys) from the settings page. No need to edit .env files after initial setup.
  • Generation History — Persistent history with thumbnails, GIF previews, filtering, and batch operations.

All API keys are encrypted and stored on the server — they never reach the browser.

How We Got Here

Agnes AI Platform started as a simple image & video generation tool. Here's how it evolved:

Phase What Changed
v1 — Generator Text-to-image, image-to-image, text-to-video, image-to-video. A clean tool with async polling and history.
v2 — Multi-Provider Replaced the single .env API key with a database-backed provider system. Add, edit, and switch providers from the UI. API keys encrypted at rest.
v3 — AI Chat Added a conversational AI interface with tool calling. The AI can detect your intent and trigger image/video generation automatically. Full SSE streaming.
v4 — Infinite Canvas Introduced a free-form canvas for composing and remixing generated images. Nodes, connections, mask editing, and context-aware re-generation.

The platform continues to grow, but the core principle remains the same: a self-hosted, secure, all-in-one AI creation workspace.

Quick Start

Prerequisites

Tool Version Why
Python 3.10+ (3.11+ recommended) Backend runtime
Node.js 18+ (20+ LTS recommended) Frontend build

1. One-Click Start

Open a terminal in the project root and run:

# macOS / Linux — first time: grant execute permission
chmod +x start.sh
./start.sh

# Windows
start.bat

# Or use the Python launcher (cross-platform, no permission needed)
python start.py

macOS / Linux first run: Shell scripts (.sh) downloaded from Git or copied between machines may not have execute permission. Run chmod +x start.sh once before the first ./start.sh. If you skip this, you'll get a "permission denied" error.

macOS Gatekeeper: If macOS blocks the script with "cannot be opened because it is from an unidentified developer", go to System Settings → Privacy & Security and click "Open Anyway", or run xattr -d com.apple.quarantine start.sh in Terminal.

Windows: .bat files run directly without extra permission. If Windows SmartScreen blocks it, click "More info → Run anyway".

This automatically starts both the backend and frontend in one command. On first run it will prompt you to configure your API key.

Default Admin Account: The startup script automatically initializes the database and creates a super admin:

  • Username: admin
  • Password: admin123

You can customize these via environment variables ADMIN_USERNAME / ADMIN_PASSWORD / ADMIN_EMAIL / ADMIN_CREDITS before first run. Please change the default password after first login.

2. Manual Start

Backend

cd backend

# Create virtual environment
python -m venv .venv
source .venv/bin/activate      # macOS / Linux
# Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env — at minimum, set AGNES_API_KEY for the initial default provider.
# After first launch, you can manage providers from the frontend settings page.

Start the backend (macOS/Linux):

./start.sh

Start the backend (Windows):

start.bat

Or manually:

python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

Verify: http://localhost:8000/health or http://localhost:8000/docs

Frontend

Open a new terminal:

cd frontend

# Install dependencies
npm install

# Start dev server (port 5173, auto-proxies /api → backend:8000)
npm run dev

Visit http://localhost:5173 — you're ready to go.

3. First-Time Setup

  1. Open the Settings page (/settings).
  2. Your .env API key is automatically loaded as the default provider.
  3. Add more providers if needed — each with its own base URL and API key.
  4. Start creating — chat, generate images/videos, or open the canvas.

Tech Stack

Layer Technology
Frontend Vue 3 (Composition API) + Vite + TypeScript + Vue Router + Pinia + Element Plus
Backend Python 3.10+ · FastAPI · SQLAlchemy 2.0 (async) · httpx (async HTTP client)
Database SQLite (default, zero-config) / PostgreSQL (optional)
AI Provider Agnes AI API (OpenAI-compatible)

FAQ

Q: Why a BFF layer instead of calling the AI API directly from the browser?

A: Two reasons — (1) your API key stays on the server and never reaches the browser, (2) the server handles async task polling, history persistence, and media processing that a pure frontend can't do reliably.

Q: How long does video generation take?

A: Usually 2–6 minutes. The platform polls in the background — you can navigate away and check back later.

Q: Can I use other OpenAI-compatible APIs?

A: Yes. Add a new provider in Settings with your custom base URL and API key. The platform supports any OpenAI-compatible chat, image, and video endpoints.

Q: Can I deploy this to production?

A: Yes. Build the frontend (npm run build) and serve it statically. Deploy the backend with any ASGI host. Set FRONTEND_ORIGINS and DATABASE_URL for your production environment.

License

Apache License 2.0 with Commons Clause — source code is open and free to use for personal, educational, and research purposes. Commercial use is prohibited. See LICENSE for details.

About

A full-stack image & video generation platform powered by Agnes AI. 一站式由AgnesAi实现的图片,视频生成平台。

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages