跳到正文
GitHub·· 8 天前AI 评分22

Lumira:具备情绪、记忆与创作自主性的自主 AI 艺术家

forbiddenlink/lumira

AI 导读

Lumira 是一个具备人格、情绪与记忆的自主 AI 艺术家,拥有 10 种情绪状态和三层记忆系统,能自主决定创作主题并记录创作后的思考。其生成速度提升 10 倍,首次生成仅需 3-5 秒,并支持 PWA 离线使用与 WebSocket 实时预览。项目基于 Stable Diffusion XL 与 LoRA,采用 MIT 许可证开源。

正文

An autonomous AI artist with personality, moods, memory, and creative independence. A lightweight "gallery + cloud-generation" build (Dockerfile.gallery, no local ML/GPU, generation via Replicate/Magica) deploys to Railway; see docs/DEPLOYMENT.md.

✨ What Makes Lumira Different

Lumira isn't a tool - she's an artist you collaborate with:

  • Has Moods: 10 emotional states that influence her art
  • Remembers: Episodic + semantic memory learns what works
  • Reflects: Journals her thoughts after each creation (visible thinking with ReAct pattern)
  • Chooses: Makes autonomous decisions about what to paint
  • Evolves: Artistic style develops through experience and adaptive learning
  • Ethical AI: Built-in bias mitigation to ensure fair and diverse output
  • Production-Ready: 10x faster generation, PWA support, real-time monitoring

🚀 Performance Highlights

  • ⚡ 10x Faster: First generation in 3-5s (was 35s) with model pool preloading
  • 🎯 Smart Curation: GPU-parallel batch processing (3x faster quality scoring)
  • 🧠 Adaptive Learning: Multi-armed bandit algorithm learns from user feedback
  • 📱 Progressive Web App: Install as native app, works offline
  • 🔴 Real-time Preview: WebSocket streaming shows generation progress
  • 📊 Production Monitoring: Prometheus metrics + health checks for Kubernetes

Quick Start

# Clone and setup
cd lumira
python -m venv venv
source venv/bin/activate
pip install -r requirements-full.txt
pip install -e .

# Configure
cp config/config.example.yaml config/config.yaml

# Let Lumira create (she chooses based on mood)
python -m ai_artist.main

# Or suggest a theme
python -m ai_artist.main --theme "twilight dreams"

# Web gallery
python -m ai_artist.web.app

If you only want the web gallery (no ML generation), use:

pip install -r requirements.txt
pip install -e .

Project Structure

lumira/
├── src/ai_artist/
│   ├── personality/    # Moods, memory, identity
│   ├── core/           # Image generation
│   ├── curation/       # CLIP-based quality scoring
│   ├── scheduling/     # Autonomous creation
│   └── web/            # FastAPI gallery
├── config/             # Configuration
├── gallery/            # Generated artwork
└── docs/               # Documentation

📚 Documentation

Document Purpose
docs/ARCHITECTURE.md System architecture and design choices
docs/QUICKSTART.md Step-by-step setup guide
docs/SETUP.md Detailed installation
docs/TROUBLESHOOTING.md Common issues
docs/LORA_GUIDE.md Custom style training
docs/WEBSOCKET.md Real-time updates guide
docs/API.md API documentation
docs/DEPLOYMENT.md Production deployment
docs/ROADMAP.md What's next
docs/ Full technical documentation

📊 Current Status

See CLAUDE.md for the maintained current-state summary (stack, commands, gotchas). Highlights:

  • 10-mood personality system with dynamic state
  • 3-layer memory (episodic/semantic/working)
  • Visible thinking process (ReAct pattern - observe/reflect/decide/express/create)
  • Adaptive learning from user feedback (multi-armed bandit)
  • Critique system for iterative improvement

Performance & Scale:

  • Model pool with pre-warming (10x faster first generation)
  • GPU-parallel batch curation (3x faster quality scoring)
  • Kubernetes-ready health checks (liveness/readiness)
  • Prometheus metrics (15+ production metrics)

User Experience:

  • Progressive Web App (PWA) with offline support
  • Real-time generation preview via WebSocket
  • Modern, accessible dark UI with animations
  • Autonomous scheduling
  • FastAPI web gallery with WebSocket
  • Service worker caching (3-tier strategy)

Quality & Safety:

  • CLIP-based quality curation
  • Ensemble curation framework
  • Bias mitigation in prompt generation
  • Intelligent prompt filtering
  • Advanced prompt features (Matrix, Emphasis, Style Presets)
  • Comprehensive test coverage (400+ tests)

See docs/ROADMAP.md for what's actively planned, and docs/ADVANCED_PROMPTS.md for prompt utilities.

🛠️ Tech Stack

Core:

  • Stable Diffusion XL (diffusers + xFormers + SDPA)
  • LoRA for style training
  • PyTorch with torch.compile optimization

Backend:

  • FastAPI + WebSocket for real-time updates
  • SQLite + SQLAlchemy
  • CLIP for quality curation
  • Multi-armed bandit for adaptive learning

Frontend:

  • Progressive Web App (PWA)
  • Service Worker with 3-tier caching
  • Modern responsive UI with WebSocket streaming

Production:

  • Prometheus metrics
  • Kubernetes health checks
  • Sentry error tracking
  • Comprehensive logging (structlog)

License

MIT License

来源:GitHub · github.com