# anxety-solo/sdaigen architecture

> Architecture diagram of the GitHub repository anxety-solo/sdaigen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anxety-solo/sdaigen
- Repository: https://github.com/anxety-solo/sdaigen

## Overview

SDAIGEN is a notebook-driven Stable Diffusion setup and download toolkit for Colab and Kaggle. Users choose a supported WebUI and settings through notebook widgets, prepare that environment, then download models and assets; optional Google Drive syncing and CivitAI preview/metadata support extend the workflow. The repository also includes result cleanup, seasonal notebook presentation, and a tag-file downloader. Some subsystem relationships below follow documented capabilities or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`scripts/downloading.py`](https://github.com/anxety-solo/sdaigen/blob/main/scripts/downloading.py) (Setup and asset downloads), [`sdai/webui_meta.py`](https://github.com/anxety-solo/sdaigen/blob/main/sdai/webui_meta.py) (WebUI registry), [`scripts/launch.py`](https://github.com/anxety-solo/sdaigen/blob/main/scripts/launch.py) (Environment launcher), [`sdai/services/manager.py`](https://github.com/anxety-solo/sdaigen/blob/main/sdai/services/manager.py) (Download manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_notebook["Notebook experience"]
  node_notebooks["Colab and Kaggle notebooks"]
  node_widgets["Interactive widgets<br/>[widgets.py]"]
  node_widget_factory["Widget builders<br/>[factory.py]"]
  node_season["Seasonal info card<br/>[season.py]"]
end

subgraph group_setup["Environment setup"]
  node_webui_choice["WebUI registry<br/>[webui_meta.py]"]
  node_launcher["Environment launcher<br/>[launch.py]"]
  node_installer["WebUI installer<br/>[webui_installer.py]"]
  node_webui_state["WebUI state and paths<br/>[webui.py]"]
  node_webui_configs["WebUI presets"]
end

subgraph group_downloads["Downloads and assets"]
  node_download_orchestrator["Setup and asset downloads<br/>[downloading.py]"]
  node_download_manager["Download manager<br/>[manager.py]"]
  node_model_catalog["Model catalog<br/>[models.py]"]
  node_civitai["CivitAI resolver<br/>[civitai.py]"]
  node_result_download["Generated result download<br/>[download_result.py]"]
  node_auto_cleaner["Output cleanup<br/>[auto_cleaner.py]"]
  node_tag_parser["Tag-file downloader"]
  node_gdrive["Google Drive sync<br/>[downloading.py]"]
end

subgraph group_support["Shared services"]
  node_tunnel["Tunnel services<br/>[tunnel_hub.py]"]
  node_json_settings["JSON settings<br/>[json.py]"]
  node_constants["Runtime paths<br/>[constants.py]"]
end

node_user(("Notebook user"))
node_webui_service["Stable Diffusion WebUI or ComfyUI"]
node_civitai_service["CivitAI"]
node_huggingface_service["Hugging Face"]
node_google_drive_service[("Google Drive")]
node_github_service["GitHub tag sources"]

node_user -->|"runs"| node_notebooks
node_notebooks -.->|"uses controls"| node_widgets
node_widgets -->|"builds widgets"| node_widget_factory
node_notebooks -.->|"shows card"| node_season
node_widgets -->|"reads registry"| node_webui_choice
node_launcher -->|"reads metadata"| node_webui_choice
node_installer -->|"reads metadata"| node_webui_choice
node_webui_state -->|"reads and writes"| node_json_settings
node_webui_state -->|"reads paths"| node_webui_choice
node_launcher -->|"configures tunnel"| node_tunnel
node_launcher -.->|"launches"| node_webui_service
node_launcher -->|"reads settings"| node_json_settings
node_webui_choice -->|"selects presets"| node_webui_configs
node_download_orchestrator -->|"requests downloads"| node_download_manager
node_download_orchestrator -->|"reads catalog"| node_model_catalog
node_download_orchestrator -->|"reads UI metadata"| node_webui_choice
node_download_orchestrator -->|"uses resolver"| node_civitai
node_download_manager -->|"resolves model URLs"| node_civitai
node_civitai -->|"requests metadata"| node_civitai_service
node_download_manager -.->|"downloads files"| node_huggingface_service
node_download_orchestrator -->|"syncs files"| node_google_drive_service
node_download_orchestrator -->|"reads settings"| node_json_settings
node_result_download -->|"uses downloads"| node_download_manager
node_auto_cleaner -->|"reads configuration"| node_json_settings
node_tag_parser -->|"fetches tag files"| node_github_service
node_download_orchestrator -->|"uses runtime paths"| node_constants
node_auto_cleaner -->|"uses runtime paths"| node_constants

click node_notebooks "https://github.com/anxety-solo/sdaigen/tree/main/notebook"
click node_widgets "https://github.com/anxety-solo/sdaigen/blob/main/scripts/widgets.py"
click node_widget_factory "https://github.com/anxety-solo/sdaigen/blob/main/sdai/factory.py"
click node_season "https://github.com/anxety-solo/sdaigen/blob/main/sdai/season.py"
click node_webui_choice "https://github.com/anxety-solo/sdaigen/blob/main/sdai/webui_meta.py"
click node_launcher "https://github.com/anxety-solo/sdaigen/blob/main/scripts/launch.py"
click node_installer "https://github.com/anxety-solo/sdaigen/blob/main/scripts/webui_installer.py"
click node_webui_state "https://github.com/anxety-solo/sdaigen/blob/main/sdai/utils/webui.py"
click node_webui_configs "https://github.com/anxety-solo/sdaigen/tree/main/configs"
click node_download_orchestrator "https://github.com/anxety-solo/sdaigen/blob/main/scripts/downloading.py"
click node_download_manager "https://github.com/anxety-solo/sdaigen/blob/main/sdai/services/manager.py"
click node_model_catalog "https://github.com/anxety-solo/sdaigen/blob/main/sdai/models.py"
click node_civitai "https://github.com/anxety-solo/sdaigen/blob/main/sdai/api/civitai.py"
click node_result_download "https://github.com/anxety-solo/sdaigen/blob/main/scripts/download_result.py"
click node_auto_cleaner "https://github.com/anxety-solo/sdaigen/blob/main/scripts/auto_cleaner.py"
click node_tag_parser "https://github.com/anxety-solo/sdaigen/blob/main/configs/_shared/tagcomplete-tags-parser.py"
click node_gdrive "https://github.com/anxety-solo/sdaigen/blob/main/scripts/downloading.py"
click node_tunnel "https://github.com/anxety-solo/sdaigen/blob/main/sdai/services/tunnel_hub.py"
click node_json_settings "https://github.com/anxety-solo/sdaigen/blob/main/sdai/utils/json.py"
click node_constants "https://github.com/anxety-solo/sdaigen/blob/main/sdai/constants.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_notebooks,node_widgets,node_widget_factory,node_season,node_user,node_webui_service toneBlue
class node_webui_choice,node_launcher,node_installer,node_webui_state,node_webui_configs,node_google_drive_service toneAmber
class node_download_orchestrator,node_download_manager,node_model_catalog,node_civitai,node_result_download,node_auto_cleaner,node_tag_parser,node_gdrive toneMint
class node_tunnel,node_json_settings,node_constants toneRose
class node_civitai_service,node_huggingface_service,node_github_service toneIndigo
```

## Components

### Notebook experience

- [Colab and Kaggle notebooks](https://github.com/anxety-solo/sdaigen/tree/main/notebook): `notebook`
- [Interactive widgets](https://github.com/anxety-solo/sdaigen/blob/main/scripts/widgets.py): `scripts/widgets.py`
- [Widget builders](https://github.com/anxety-solo/sdaigen/blob/main/sdai/factory.py): `sdai/factory.py`
- [Seasonal info card](https://github.com/anxety-solo/sdaigen/blob/main/sdai/season.py): `sdai/season.py`

### Environment setup

- [WebUI registry](https://github.com/anxety-solo/sdaigen/blob/main/sdai/webui_meta.py): `sdai/webui_meta.py`
- [Environment launcher](https://github.com/anxety-solo/sdaigen/blob/main/scripts/launch.py): `scripts/launch.py`
- [WebUI installer](https://github.com/anxety-solo/sdaigen/blob/main/scripts/webui_installer.py): `scripts/webui_installer.py`
- [WebUI state and paths](https://github.com/anxety-solo/sdaigen/blob/main/sdai/utils/webui.py): `sdai/utils/webui.py`
- [WebUI presets](https://github.com/anxety-solo/sdaigen/tree/main/configs): `configs`

### Downloads and assets

- [Setup and asset downloads](https://github.com/anxety-solo/sdaigen/blob/main/scripts/downloading.py): `scripts/downloading.py`
- [Download manager](https://github.com/anxety-solo/sdaigen/blob/main/sdai/services/manager.py): `sdai/services/manager.py`
- [Model catalog](https://github.com/anxety-solo/sdaigen/blob/main/sdai/models.py): `sdai/models.py`
- [CivitAI resolver](https://github.com/anxety-solo/sdaigen/blob/main/sdai/api/civitai.py): `sdai/api/civitai.py`
- [Generated result download](https://github.com/anxety-solo/sdaigen/blob/main/scripts/download_result.py): `scripts/download_result.py`
- [Output cleanup](https://github.com/anxety-solo/sdaigen/blob/main/scripts/auto_cleaner.py): `scripts/auto_cleaner.py`
- [Tag-file downloader](https://github.com/anxety-solo/sdaigen/blob/main/configs/_shared/tagcomplete-tags-parser.py): `configs/_shared/tagcomplete-tags-parser.py`
- [Google Drive sync](https://github.com/anxety-solo/sdaigen/blob/main/scripts/downloading.py): `scripts/downloading.py`

### Shared services

- [Tunnel services](https://github.com/anxety-solo/sdaigen/blob/main/sdai/services/tunnel_hub.py): `sdai/services/tunnel_hub.py`
- [JSON settings](https://github.com/anxety-solo/sdaigen/blob/main/sdai/utils/json.py): `sdai/utils/json.py`
- [Runtime paths](https://github.com/anxety-solo/sdaigen/blob/main/sdai/constants.py): `sdai/constants.py`

### Other components

- **Notebook user**
- **Stable Diffusion WebUI or ComfyUI**
- **CivitAI**
- **Hugging Face**
- **Google Drive**
- **GitHub tag sources**

## Connections

- Notebook user → Colab and Kaggle notebooks: runs (evidence: `README.md`)
- Colab and Kaggle notebooks → Interactive widgets: uses controls
- Interactive widgets → Widget builders: builds widgets (evidence: `scripts/widgets.py`)
- Colab and Kaggle notebooks → Seasonal info card: shows card
- Interactive widgets → WebUI registry: reads registry (evidence: `scripts/widgets.py`)
- Environment launcher → WebUI registry: reads metadata (evidence: `scripts/launch.py`)
- WebUI installer → WebUI registry: reads metadata (evidence: `scripts/webui_installer.py`)
- WebUI state and paths → JSON settings: reads and writes (evidence: `sdai/utils/webui.py`)
- WebUI state and paths → WebUI registry: reads paths (evidence: `sdai/utils/webui.py`)
- Environment launcher → Tunnel services: configures tunnel (evidence: `scripts/launch.py`)
- Environment launcher → Stable Diffusion WebUI or ComfyUI: launches
- Environment launcher → JSON settings: reads settings (evidence: `scripts/launch.py`)
- WebUI registry → WebUI presets: selects presets (evidence: `sdai/webui_meta.py`)
- Setup and asset downloads → Download manager: requests downloads (evidence: `scripts/downloading.py`)
- Setup and asset downloads → Model catalog: reads catalog (evidence: `scripts/downloading.py`)
- Setup and asset downloads → WebUI registry: reads UI metadata (evidence: `scripts/downloading.py`)
- Setup and asset downloads → CivitAI resolver: uses resolver (evidence: `scripts/downloading.py`)
- Download manager → CivitAI resolver: resolves model URLs (evidence: `sdai/services/manager.py`)
- CivitAI resolver → CivitAI: requests metadata (evidence: `sdai/api/civitai.py`)
- Download manager → Hugging Face: downloads files
- Setup and asset downloads → Google Drive: syncs files (evidence: `README.md`)
- Setup and asset downloads → JSON settings: reads settings (evidence: `scripts/downloading.py`)
- Generated result download → Download manager: uses downloads (evidence: `scripts/download_result.py`)
- Output cleanup → JSON settings: reads configuration (evidence: `scripts/auto_cleaner.py`)
- Tag-file downloader → GitHub tag sources: fetches tag files (evidence: `configs/_shared/tagcomplete-tags-parser.py`)
- Setup and asset downloads → Runtime paths: uses runtime paths (evidence: `scripts/downloading.py`)
- Output cleanup → Runtime paths: uses runtime paths (evidence: `scripts/auto_cleaner.py`)
