A high-performance, decoupled generative AI platform featuring a pure FastAPI backend engineered for cloud GPUs (Lightning AI) and a modular, sleek light-mode frontend designed for zero-build deployment on Cloudflare Pages.
Inspired by modern creation studios like SeaArt.ai and Midjourney Web, the platform provides a unified interface for both image and video generation across styles (Anime, Photorealistic, Digital Art, 3D CGI, and Raw).
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLOUDFLARE PAGES FRONTEND β
β (frontend/) β
β β
β - Modern SeaArt / Midjourney 2-Column Interface (No Left Sidebar) β
β - Topbar: Brand, Model badge, Live VRAM meter & Memory Flush button β
β - Center Workspace: Scrollable feed stream + Docked bottom prompt bar β
β - Right Studio Drawer: Modality selector, reference dropzone, β
β denoising strength slider, universal style presets, ratio grid, β
β and safe 4k+1 temporal stride video controls β
β - Live Hugging Face Model Hub with automatic VRAM feasibility check β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTPS / REST (CORS enabled)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LIGHTNING AI CLOUD GPU BACKEND β
β (FastAPI) β
β β
β - 4 Modalities Supported: txt2img, img2img, txt2vid, img2vid β
β - Asynchronous Background Queue with Step-by-Step Progress Callbacks β
β - Strict VRAM Reclamation: gc.collect() + torch.cuda.empty_cache() β
β - Dynamic Model Swapping via config.yaml β
β - OpenAI-Compatible Endpoint: POST /v1/images/generations β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
txt2img):
img2img):
txt2vid):
img2vid):
Treat Lightning AI as your dedicated GPU server.
In Lightning.ai, launch a Studio with an NVIDIA GPU (e.g. T4 16GB, L4 24GB, or A10G).
Open the Terminal inside your Lightning AI Studio:
git clone <your-repo-url>
cd anime_ai
pip install -r requirements.txt
python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000
In Lightning AI Studio:
8000.https://8000-xxx.cloudspaces.litng.ai).The frontend is a modular, zero-build, static web application in frontend/:
index.html: Modern SeaArt layout with topbar, center feed, bottom prompt dock, and right control drawer.css/: styles.css, feed.css, settings.css.js/: api.js, settings.js, feed.js, model-hub.js, app.js.frontend/ directory into Cloudflare.https://8000-xxx.cloudspaces.litng.ai).config.yaml)Models are never hardcoded. The backend reads and writes active models to config.yaml:
active_models:
image_model: "cagliostrolab/animagine-xl-3.1"
video_model: "IndexTeam/Index-anisora"
hardware:
device: "cuda"
dtype: "fp16"
Click the active model pill in the topbar to open the Model Hub:
Every generation cycle executes strict VRAM reclamation to prevent OOM errors:
del pipeline
gc.collect()
torch.cuda.empty_cache()
torch.cuda.ipc_collect()
Users can also click the Flush button in the topbar at any time to purge PyTorch CUDA allocations.
The test suite validates all endpoints, asynchronous workers, polling loops, model switches, and frontend assets:
pytest tests/test_full_suite.py -v
Tests verify:
outputs/history.json)/v1/images/generationsA high-performance, decoupled generative AI platform featuring a pure FastAPI backend engineered for cloud GPUs (Lightning AI) and a modular, sleek light-mode frontend designed for zero-build deployment on Cloudflare Pages.
Inspired by modern creation studios like SeaArt.ai and Midjourney Web, the platform provides a unified interface for both image and video generation across styles (Anime, Photorealistic, Digital Art, 3D CGI, and Raw).
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLOUDFLARE PAGES FRONTEND β
β (frontend/) β
β β
β - Modern SeaArt / Midjourney 2-Column Interface (No Left Sidebar) β
β - Topbar: Brand, Model badge, Live VRAM meter & Memory Flush button β
β - Center Workspace: Scrollable feed stream + Docked bottom prompt bar β
β - Right Studio Drawer: Modality selector, reference dropzone, β
β denoising strength slider, universal style presets, ratio grid, β
β and safe 4k+1 temporal stride video controls β
β - Live Hugging Face Model Hub with automatic VRAM feasibility check β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTPS / REST (CORS enabled)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LIGHTNING AI CLOUD GPU BACKEND β
β (FastAPI) β
β β
β - 4 Modalities Supported: txt2img, img2img, txt2vid, img2vid β
β - Asynchronous Background Queue with Step-by-Step Progress Callbacks β
β - Strict VRAM Reclamation: gc.collect() + torch.cuda.empty_cache() β
β - Dynamic Model Swapping via config.yaml β
β - OpenAI-Compatible Endpoint: POST /v1/images/generations β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
txt2img):
img2img):
txt2vid):
img2vid):
Treat Lightning AI as your dedicated GPU server.
In Lightning.ai, launch a Studio with an NVIDIA GPU (e.g. T4 16GB, L4 24GB, or A10G).
Open the Terminal inside your Lightning AI Studio:
git clone <your-repo-url>
cd anime_ai
pip install -r requirements.txt
python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000
In Lightning AI Studio:
8000.https://8000-xxx.cloudspaces.litng.ai).The frontend is a modular, zero-build, static web application in frontend/:
index.html: Modern SeaArt layout with topbar, center feed, bottom prompt dock, and right control drawer.css/: styles.css, feed.css, settings.css.js/: api.js, settings.js, feed.js, model-hub.js, app.js.frontend/ directory into Cloudflare.https://8000-xxx.cloudspaces.litng.ai).config.yaml)Models are never hardcoded. The backend reads and writes active models to config.yaml:
active_models:
image_model: "cagliostrolab/animagine-xl-3.1"
video_model: "IndexTeam/Index-anisora"
hardware:
device: "cuda"
dtype: "fp16"
Click the active model pill in the topbar to open the Model Hub:
Every generation cycle executes strict VRAM reclamation to prevent OOM errors:
del pipeline
gc.collect()
torch.cuda.empty_cache()
torch.cuda.ipc_collect()
Users can also click the Flush button in the topbar at any time to purge PyTorch CUDA allocations.
The test suite validates all endpoints, asynchronous workers, polling loops, model switches, and frontend assets:
pytest tests/test_full_suite.py -v
Tests verify:
outputs/history.json)/v1/images/generations