# amgasanoff-bot/am-studio architecture

> Architecture diagram of the GitHub repository amgasanoff-bot/am-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amgasanoff-bot/am-studio
- Repository: https://github.com/amgasanoff-bot/am-studio

## Overview

AM-Studio is a native desktop application for local AI image generation, photo restoration, and upscaling. The main workflow is choosing a model and text/image mode, configuring a prompt and parameters, invoking the bundled sd-cli, then reviewing outputs in the gallery. README capabilities include batch processing, model downloads, presets, history restore, comparison, themes, and language switching. The main UI is a large monolithic module; some feature-specific wiring is not visible in the excerpts, so those relationships are cited only where documented.

Main entry points: [`am_studio.py`](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py) (Studio UI), [`model_manager.py`](https://github.com/amgasanoff-bot/am-studio/blob/main/model_manager.py) (Model Manager), [`i18n.py`](https://github.com/amgasanoff-bot/am-studio/blob/main/i18n.py) (Language Text), [`presets.py`](https://github.com/amgasanoff-bot/am-studio/blob/main/presets.py) (Preset Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Generation Workflow"]
  node_studio["Studio UI<br/>[am_studio.py]"]
  node_generation["Generation Controls<br/>[am_studio.py]"]
  node_batch["Batch Processing<br/>[am_studio.py]"]
  node_engine["sd-cli Engine"]
end

subgraph group_library["Models and Presets"]
  node_model_manager["Model Manager<br/>[model_manager.py]"]
  node_model_files[("Model Files<br/>[am_studio.py]")]
  node_presets["Preset Catalog<br/>[presets.py]"]
  node_user_presets[("User Presets<br/>[am_studio.py]")]
end

subgraph group_review["Output Review"]
  node_gallery["Output Gallery<br/>[am_studio.py]"]
  node_history[("Generation History<br/>[am_studio.py]")]
  node_comparison["Before / After<br/>[am_studio.py]"]
  node_upscaler["AI Upscaling<br/>[am_studio.py]"]
end

subgraph group_preferences["Preferences"]
  node_settings[("App Settings<br/>[am_studio.py]")]
  node_translation["Language Text<br/>[i18n.py]"]
end

node_user(("Desktop User"))
node_model_host["Hugging Face"]

node_user -->|"uses"| node_studio
node_studio -->|"configures"| node_generation
node_generation -->|"invokes"| node_engine
node_engine -.->|"produces outputs"| node_gallery
node_user -->|"selects folder"| node_batch
node_batch -.->|"processes images"| node_generation
node_studio -->|"opens"| node_model_manager
node_model_manager -->|"downloads files"| node_model_host
node_model_manager -->|"installs files"| node_model_files
node_studio -.->|"reads models"| node_model_files
node_studio -->|"loads presets"| node_presets
node_studio -->|"saves presets"| node_user_presets
node_studio -->|"records settings"| node_history
node_gallery -->|"restores settings"| node_history
node_gallery -->|"compares images"| node_comparison
node_gallery -->|"requests upscale"| node_upscaler
node_studio -->|"reads and saves"| node_settings
node_studio -->|"gets translations"| node_translation
node_model_manager -->|"gets translations"| node_translation
node_studio -->|"shows results"| node_user

click node_studio "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_generation "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_batch "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_model_manager "https://github.com/amgasanoff-bot/am-studio/blob/main/model_manager.py"
click node_model_files "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_presets "https://github.com/amgasanoff-bot/am-studio/blob/main/presets.py"
click node_user_presets "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_gallery "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_history "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_comparison "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_upscaler "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_settings "https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py"
click node_translation "https://github.com/amgasanoff-bot/am-studio/blob/main/i18n.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_studio,node_generation,node_batch,node_engine,node_user toneBlue
class node_model_manager,node_model_files,node_presets,node_user_presets toneAmber
class node_gallery,node_history,node_comparison,node_upscaler toneMint
class node_settings,node_translation toneRose
class node_model_host toneIndigo
```

## Components

### Generation Workflow

- [Studio UI](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [Generation Controls](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [Batch Processing](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- **sd-cli Engine**

### Models and Presets

- [Model Manager](https://github.com/amgasanoff-bot/am-studio/blob/main/model_manager.py): `model_manager.py`
- [Model Files](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [Preset Catalog](https://github.com/amgasanoff-bot/am-studio/blob/main/presets.py): `presets.py`
- [User Presets](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`

### Output Review

- [Output Gallery](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [Generation History](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [Before / After](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [AI Upscaling](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`

### Preferences

- [App Settings](https://github.com/amgasanoff-bot/am-studio/blob/main/am_studio.py): `am_studio.py`
- [Language Text](https://github.com/amgasanoff-bot/am-studio/blob/main/i18n.py): `i18n.py`

### Other components

- **Desktop User**
- **Hugging Face**

## Connections

- Desktop User → Studio UI: uses (evidence: `README.md`)
- Studio UI → Generation Controls: configures (evidence: `am_studio.py`)
- Generation Controls → sd-cli Engine: invokes (evidence: `am_studio.py`)
- sd-cli Engine → Output Gallery: produces outputs (evidence: `README.md`)
- Desktop User → Batch Processing: selects folder (evidence: `README.md`)
- Batch Processing → Generation Controls: processes images (evidence: `am_studio.py`)
- Studio UI → Model Manager: opens (evidence: `README.md`)
- Model Manager → Hugging Face: downloads files (evidence: `model_manager.py`)
- Model Manager → Model Files: installs files (evidence: `model_manager.py`)
- Studio UI → Model Files: reads models (evidence: `README.md`)
- Studio UI → Preset Catalog: loads presets (evidence: `am_studio.py`)
- Studio UI → User Presets: saves presets (evidence: `am_studio.py`)
- Studio UI → Generation History: records settings (evidence: `README.md`)
- Output Gallery → Generation History: restores settings (evidence: `am_studio.py`)
- Output Gallery → Before / After: compares images (evidence: `README.md`)
- Output Gallery → AI Upscaling: requests upscale (evidence: `README.md`)
- Studio UI → App Settings: reads and saves (evidence: `am_studio.py`)
- Studio UI → Language Text: gets translations (evidence: `am_studio.py`)
- Model Manager → Language Text: gets translations (evidence: `model_manager.py`)
- Studio UI → Desktop User: shows results (evidence: `README.md`)
