No description
- Dart 94.2%
- CMake 3.3%
- C++ 2.2%
- C 0.3%
|
|
||
|---|---|---|
| android | ||
| lib | ||
| linux | ||
| packages | ||
| test | ||
| .gitignore | ||
| .gitmodules | ||
| .metadata | ||
| analysis_options.yaml | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| LICENSE | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
NAI Chat
A chat-based anime image generation app powered by NovelAI.
Users chat with an AI agent that searches, browses, and suggests booru tags, builds structured prompts, and generates images — all through a conversational interface.
Features
- AI agent loop — chat with an AI that researches booru tags, configures settings, and generates images autonomously
- 9 agent tools — search/browse/suggest/detail booru tags, edit generation settings, generate images, read/write knowledge base, set chat title
- Knowledge base — persistent notes the AI reads and writes across chats (How-To guides, user preferences, tag discoveries); pinned entries are included in the system prompt
- Structured prompt builder — layered tag system with scene-level and per-character categories
- Generation settings per chat — resolution, aspect ratio, number of images
- Engine selection — Diffusion 4.5 or Diffusion 5; style reference is a 4.5-only feature (the picker disables itself under V5)
- Manual generation — trigger image generation directly from the panel without the AI
- Tool activity UI — collapsible, per-tool summaries showing what the agent did
- Image viewer — fullscreen viewer with arrow key navigation and save-to-file
- Vision support — attach images to messages when the selected model supports it
- Auto chat titles — AI automatically names chats based on conversation content
- Model selection — browse and search OpenRouter models from settings; vision badge on capable models
- Global settings — API keys, model, sampler, guidance, steps, style reference, default meta tags
- Responsive layout — side-by-side on desktop, navigation-based on mobile
- Dark Material 3 theme
Architecture
- State management: Riverpod
- Persistence: JSON files for chats, SharedPreferences for settings
- Image storage: App-managed directory (safe across platforms)
- Tag system: Uses booru_tag_db_dart for categorized danbooru tags and novelai_image_gen for the NovelAI API
Getting Started
flutter pub get
flutter run
Requires API keys configured in Settings:
- OpenRouter API Key — for the AI chat backend
- NovelAI API Key — for image generation
Project Structure
lib/
main.dart
models/ # Data models (chat, messages, settings, tags)
providers/ # Riverpod state management
screens/ # Top-level screens
services/ # Persistence services
tools/ # AI agent tools (edit settings, generate images)
theme/ # Material 3 theme
widgets/ # UI components
chat_list/ # Chat list sidebar
chat_view/ # Message bubbles, input, chat area
generation_panel/ # Tag editor, generation params
knowledge_base/ # Knowledge base list panel
settings/ # Settings form widgets
License
MIT — see LICENSE.