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

  1. Asset Detection — VLM-based detection of individual assets within a character image
  2. AI-Powered Splitting — Separates detected assets into individual layers
  3. Background Removal — Standalone background removal tool
  4. Image Generation — 6 skill modes (see below)
  5. Style Library — Extract and save visual styles for reuse
  6. Style Extraction — Reverse-engineer styles from reference images

Image Generation Skills

SkillDescription
cover-imageArticle covers with 5D customization (type × palette × rendering × text × mood)
comicKnowledge comics (art × tone × layout)
image-genGeneral image generation with 18 art styles
xhs-imagesXiaohongshu infographic series
infographicProfessional infographics (20 layouts × 29 styles)
instagram-carouselMulti-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

EndpointDescription
POST /api/v1/detectDetect assets in character image
POST /api/v1/splitSplit image into individual assets
POST /api/v1/remove-bgRemove background from image
POST /api/v1/generateGenerate images (6 skills)
POST /api/v1/styles/extractExtract visual style from image
GET /api/v1/stylesList saved styles
GET /api/v1/healthHealth 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 generation
  • OPENROUTER_API_KEY — VLM asset detection
  • API_KEY — Endpoint protection
  • ALLOWED_ORIGINS — CORS lock-down
  • SENTRY_DSN — Error tracking
  • REDIS_URL — Multi-instance rate limiting (optional)

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:3000

  • 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

0 items under this folder.