How tamikip/ai-gal works
Project type and purpose
• This is a desktop visual‐novel “launcher” and generator built on Ren’Py (script.rpy) that integrates multiple AI services (text, image, voice, music).
• Purpose: let end users configure and generate galgame storylines, images, voice lines, and background music via local or cloud AI models, then run the generated content in Ren’Py.
File structure
• Top‑level Python modules:
• gui.py, main.py – the launcher’s GUI entrypoint and controller
• config.ini – user settings for choosing local vs. cloud, API keys, themes
• update.py & update_docx.txt – built‑in update/fixer service
• script.rpy – the Ren’Py game script template into which generated assets are injected
• Generator modules by domain:
• GPT.py, trs2.py – story and dialogue generation (LLM interfaces)
• local_image_generator.py / cloud_image_generator.py – Stable Diffusion interfaces
• local_vocal_generator.py / cloud_vocal_generator.py – SOVITS TTS interfaces
• music_generator.py – AI music composer
• Supporting scripts:
• cloud_image_generator.py and cloud_vocal_generator.py – wrappers for remote API calls
• update.py – checks and pulls bug fixes or new versions
Insights from the README
• Dual‐mode AI: local vs. cloud for image and voice
• Dependencies: stable diffusion API, gpt-sovits API or local LLM
• Features: story branching, snapshots, multi‐language support, custom themes
• Output pipeline: generate text → generate images/audio/music → assemble into Ren’Py project
a. Main components
• User Interface (GUI Launcher)
• Configuration Store (config.ini, logs, snapshots)
• Story Generator (GPT module + branching logic)
• Image Generator (local & cloud SD)
• Voice Generator (local & cloud SOVITS)
• Music Generator
• Update Service
• Ren’Py Engine (script.rpy + assets)
• External AI Services (LLM endpoints, ComfyUI, gpt-sovits API)
• Local AI Engines (local Stable Diffusion, local gpt-sovits)
b. Relationships & data flow
1. UI reads config → user clicks “Generate”
2. Story Generator invokes GPT module → returns dialogue/branch choices
3. For each scene:
• Image Generator ↔ (local SD or cloud API) → image assets
• Voice Generator ↔ (local SOVITS or cloud API) → audio files
4. Music Generator → background music file
5. Assets + script.rpy → Ren’Py Engine → game runtime
6. Update Service runs in parallel to check for new code/bug fixes
c. Architectural patterns & principles
• Modular separation by concern (Story vs. Image vs. Voice vs. Music)
• Strategy pattern for local vs. cloud AI providers
• Pipeline assembly pattern: sequential content generation steps
• Configuration‐driven behavior (mode switching)
d. Key technologies & libraries
• Python 3.x and Ren’Py
• stable-diffusion (ComfyUI plugin)
• gpt-sovits TTS models
• OpenAI or local LLM endpoints
• Ren’Py script integration