Anlayer Studio
Type: Asset Splitter + AI Image Generation Platform
Status: Production-ready (deployed via Coolify)
License: MIT
Last Updated: 2026-04-16
Overview
Anlayer Studio is a full-stack web application for splitting game/art character assets into layers and generating AI images. It combines computer vision (VLM-based asset detection) with AI image generation (6 distinct skills) in a single workspace.
Tech Stack
Backend
- Framework: FastAPI + Uvicorn (Python)
- AI Models: VectorEngine (image gen), OpenRouter/Nvidia Nemotron (VLM detection)
- Image Processing: OpenCV, Pillow
- Auth: API key via X-API-Key header, CORS origin whitelisting
- Rate Limiting: Per-route limits (5-30 req/min)
Frontend
- Framework: React 18 + TypeScript
- Build: Vite
- Styling: Tailwind CSS
- Components: ImageUpload, AssetSelector, LayerPreview, AssetDownload
Deployment
- Platform: Coolify (self-hosted)
- Containerization: Docker Compose (nginx frontend proxy → FastAPI backend)
- CI/CD: GitHub Actions (.github/workflows/ci.yml)
Core Features
- Asset Detection — VLM-based detection of individual assets within a character image
- AI-Powered Splitting — Separates detected assets into individual layers
- Background Removal — Standalone background removal tool
- Image Generation — 6 skill modes (see below)
- Style Library — Extract and save visual styles for reuse
- Style Extraction — Reverse-engineer styles from reference images
Image Generation Skills
| Skill | Description |
|---|---|
| cover-image | Article covers with 5D customization (type × palette × rendering × text × mood) |
| comic | Knowledge comics (art × tone × layout) |
| image-gen | General image generation with 18 art styles |
| xhs-images | Xiaohongshu infographic series |
| infographic | Professional infographics (20 layouts × 29 styles) |
| instagram-carousel | Multi-slide Instagram posts |
Cover Image Prompt System
Uses a 5-dimensional parameterization:
- Type: hero, conceptual, typography, metaphor, scene, minimal
- Palette: warm, elegant, cool, dark, earth, vivid, pastel, mono, retro
- Rendering: flat-vector, hand-drawn, painterly, digital, pixel, chalk
- Text Level: none, title-only, title-subtitle, text-rich
- Mood: subtle, balanced, bold
API Endpoints
| Endpoint | Description |
|---|---|
POST /api/v1/detect | Detect assets in character image |
POST /api/v1/split | Split image into individual assets |
POST /api/v1/remove-bg | Remove background from image |
POST /api/v1/generate | Generate images (6 skills) |
POST /api/v1/styles/extract | Extract visual style from image |
GET /api/v1/styles | List saved styles |
GET /api/v1/health | Health check with dependency status |
Security
- API key authentication (X-API-Key header)
- CORS origin whitelisting
- Rate limiting per route
- Upload size limits (default 20MB)
- Sentry error tracking integration
- DEBUG=false in production
Monitoring & Observability
- Health endpoint: Returns service + dependency status (VectorEngine, OpenRouter)
- Structured logging: Daily log files, 7-day retention (30 days for errors), 10MB rotation
- Sentry: Automatic error + performance tracking
- Uptime monitoring: Compatible with Uptime Kuma, Betterstack, Pingdom
- Key metrics: Response time (<30s target), error rate (<5%), rate limit hits, disk usage
Infrastructure
Deployment (Coolify)
- Docker Compose: single resource, nginx proxy → backend
- Option B: two separate services for independent scaling
- Auto HTTPS via Let’s Encrypt
- Git-based deploys with auto-redeploy on push
Environment Variables (Production)
VECTORENGINE_API_KEY— Image generationOPENROUTER_API_KEY— VLM asset detectionAPI_KEY— Endpoint protectionALLOWED_ORIGINS— CORS lock-downSENTRY_DSN— Error trackingREDIS_URL— Multi-instance rate limiting (optional)
Related Project: VIP (Video Inference Product)
A separate MVP-stage product in the same repo: video analysis service using SmolVLM2-500M to extract insights from social media videos (YouTube/Instagram/TikTok). Uses RunPod Serverless for compute. Planned subscription tiers ($4.99-$39.99/mo) with 76-88% margins.
Project Structure
asset-splitter/
├── app/ # FastAPI backend
│ ├── main.py # App + security middleware
│ ├── config.py # Settings (from .env)
│ ├── api/routes.py # API endpoints
│ ├── models/schemas.py # Pydantic models
│ └── services/ # Business logic
│ ├── asset_detection.py # VLM-based detection
│ ├── baoyu_generator.py # Image generation (6 skills)
│ ├── image_processing.py # OpenCV/Pillow processing
│ ├── orchestrator.py # Pipeline coordinator
│ ├── prompt_generator.py # Prompt construction
│ ├── style_extractor.py # Style reverse-engineering
│ └── style_store.py # Style persistence
├── frontend/ # React + Vite + Tailwind
│ └── src/components/ # UI components
├── prompts/ # Skill prompt definitions
├── tests/ # pytest suite
├── docs/ # Deployment & ops docs
├── Dockerfile # Backend container
├── docker-compose.yml # Full-stack deployment
└── .env.example # Configuration reference
Development
# Backend
cd asset-splitter && pip install -r requirements.txt
cp .env.example .env # Add API keys, DEBUG=true
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080
# Frontend
cd frontend && npm install && npm run dev # → http://localhost:5173
# Docker
docker compose up --build # → http://localhost:3000Links
- Repo: /mnt/c/Users/hanse/anlayer/
- Backend Docs: http://localhost:8080/docs (Swagger)
- Deploy Guide: asset-splitter/docs/DEPLOY_COOLIFY.md
- Hardening Checklist: asset-splitter/docs/HARDEN.md
- Monitoring Guide: asset-splitter/docs/MONITORING.md