How matthew-kissinger/2dgag works
This archived Flask application generates 2D game assets through a user-guided workflow: describe a world, review its asset list, develop an aesthetic, approve image prompts, generate or regenerate images, then download a ZIP. The modular app registers separate route blueprints, with shared in-memory session storage and LM Studio and Stable Diffusion services. The README documents the product stages; source excerpts show the modular route calls. The repository also contains a legacy monolithic app.py implementation. Frontend-to-route wiring is not evidenced in the sampled files, so those links are omitted.
Main entry points: lm_studio_service.py LM Studio generation · __init__.py App factory · helpers.py Session asset state · images.py Image and export routes
Components 16
Web application
- Studio interface
static/js/main.js - App factory
app/__init__.py - Studio page
app/templates/index.html
Asset workflow
- World and assets
app/routes/game_world.py - Aesthetic route
app/routes/aesthetic.py - Prompt routes
app/routes/image_prompts.py - Image and export routes
app/routes/images.py - Legacy monolithic app
app.py
Generation services
- LM Studio generation
app/services/lm_studio_service.py - Stable Diffusion generation
app/services/sd3_service.py - Service configuration
config.py
Session and export
- Session asset state
app/utils/helpers.py - ZIP export
app/utils/helpers.py
Other components
- Creator
- LM Studio
- Automatic1111 SD Web UI
Connections 22
- Creator → Studio interface: uses
- App factory → Studio page: renders
app/__init__.py - App factory → World and assets: registers
app/__init__.py - App factory → Aesthetic route: registers
app/__init__.py - App factory → Prompt routes: registers
app/__init__.py - App factory → Image and export routes: registers
app/__init__.py - World and assets → LM Studio generation: generates world
app/routes/game_world.py - World and assets → Session asset state: stores assets
app/routes/game_world.py - Aesthetic route → LM Studio generation: generates theme
app/routes/aesthetic.py - Aesthetic route → Session asset state: reads and stores
app/routes/aesthetic.py - Prompt routes → LM Studio generation: generates prompts
app/routes/image_prompts.py - Prompt routes → Session asset state: reads and stores
app/routes/image_prompts.py - Image and export routes → Stable Diffusion generation: generates images
app/routes/images.py - Image and export routes → Session asset state: reads and stores
app/routes/images.py - Image and export routes → ZIP export: creates archive
app/routes/images.py - ZIP export → Session asset state: reads image state
app/utils/helpers.py - LM Studio generation → LM Studio: requests completions
app/services/lm_studio_service.py - Stable Diffusion generation → Automatic1111 SD Web UI: requests images
app/services/sd3_service.py - LM Studio generation → Service configuration: reads URL
app/services/lm_studio_service.py - Stable Diffusion generation → Service configuration: reads URL
app/services/sd3_service.py - Legacy monolithic app → LM Studio generation: calls generation
app.py - Legacy monolithic app → Automatic1111 SD Web UI: requests images
app.py