# biagiomaf/smart-comfyui-gallery architecture

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

- Interactive diagram: https://gitdiagram.com/biagiomaf/smart-comfyui-gallery
- Repository: https://github.com/biagiomaf/smart-comfyui-gallery

## Overview

SmartGallery DAM is a self-hosted digital asset manager for browsing, organizing, searching, reviewing, and remixing AI-production media, with ComfyUI-aware generation tools. The principal workflow is a creator using the web gallery to find and inspect an asset, then organize, share, or send work to the generation queue. The graph preserves documented search, collection, collaboration, media, and generation capabilities. Backend responsibilities are mapped to the application entry file because no backend excerpts were provided; feature relationships cite README claims, not inspected implementation.

Main entry points: [`templates/index.html`](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/index.html) (Gallery workspace), [`templates/js/generation_metadata.js`](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/js/generation_metadata.js) (Asset details), [`smartgallery.py`](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py) (Remix Engine), [`templates/modals/comfy_queue_manager.html`](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/modals/comfy_queue_manager.html) (ComfyUI Queue Deck)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gallery["Gallery and discovery"]
  node_gallery_ui["Gallery workspace<br/>[index.html]"]
  node_asset_browse["Grid and list browsing<br/>[smartgallery.py]"]
  node_search["Search and OmniQuery<br/>[smartgallery.py]"]
  node_asset_inspector["Asset details"]
end

subgraph group_library["Library management"]
  node_media_library["Media library indexing<br/>[smartgallery.py]"]
  node_file_manager["File management<br/>[smartgallery.py]"]
  node_collections["Collections and notes<br/>[collections.html]"]
  node_clustering["Asset clustering<br/>[smartgallery.py]"]
end

subgraph group_production["Production tools"]
  node_remix["Remix Engine<br/>[smartgallery.py]"]
  node_lora["LoRA Synergy<br/>[smartgallery.py]"]
  node_queue_deck["ComfyUI Queue Deck"]
end

subgraph group_sharing["Review and sharing"]
  node_client_portal["Client exhibition<br/>[exhibition.html]"]
  node_team_review["Ratings and comments<br/>[smartgallery.py]"]
end

node_creator(("Creator"))
node_comfyui["ComfyUI"]

node_creator -->|"opens"| node_gallery_ui
node_gallery_ui -->|"browses"| node_asset_browse
node_gallery_ui -->|"searches"| node_search
node_gallery_ui -->|"inspects"| node_asset_inspector
node_asset_inspector -->|"requests metadata"| node_media_library
node_gallery_ui -->|"views library"| node_media_library
node_creator -->|"manages files"| node_file_manager
node_creator -->|"organizes"| node_collections
node_gallery_ui -->|"groups assets"| node_clustering
node_creator -->|"creates variations"| node_remix
node_remix -->|"queues work"| node_queue_deck
node_creator -->|"matches models"| node_lora
node_queue_deck -->|"controls queue"| node_comfyui
node_creator -->|"shares collections"| node_client_portal
node_creator -->|"rates and comments"| node_team_review

click node_gallery_ui "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/index.html"
click node_asset_browse "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_search "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_asset_inspector "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/js/generation_metadata.js"
click node_media_library "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_file_manager "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_collections "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/collections.html"
click node_clustering "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_remix "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_lora "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py"
click node_queue_deck "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/modals/comfy_queue_manager.html"
click node_client_portal "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/exhibition.html"
click node_team_review "https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.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_gallery_ui,node_asset_browse,node_search,node_asset_inspector,node_comfyui toneBlue
class node_media_library,node_file_manager,node_collections,node_clustering toneAmber
class node_remix,node_lora,node_queue_deck toneMint
class node_client_portal,node_team_review toneRose
class node_creator toneIndigo
```

## Components

### Gallery and discovery

- [Gallery workspace](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/index.html): `templates/index.html`
- [Grid and list browsing](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`
- [Search and OmniQuery](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`
- [Asset details](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/js/generation_metadata.js): `templates/js/generation_metadata.js`

### Library management

- [Media library indexing](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`
- [File management](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`
- [Collections and notes](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/collections.html): `templates/collections.html`
- [Asset clustering](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`

### Production tools

- [Remix Engine](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`
- [LoRA Synergy](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`
- [ComfyUI Queue Deck](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/modals/comfy_queue_manager.html): `templates/modals/comfy_queue_manager.html`

### Review and sharing

- [Client exhibition](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/templates/exhibition.html): `templates/exhibition.html`
- [Ratings and comments](https://github.com/biagiomaf/smart-comfyui-gallery/blob/main/smartgallery.py): `smartgallery.py`

### Other components

- **Creator**
- **ComfyUI**

## Connections

- Creator → Gallery workspace: opens (evidence: `README.md`)
- Gallery workspace → Grid and list browsing: browses (evidence: `README.md`)
- Gallery workspace → Search and OmniQuery: searches (evidence: `README.md`)
- Gallery workspace → Asset details: inspects (evidence: `README.md`)
- Asset details → Media library indexing: requests metadata (evidence: `templates/js/generation_metadata.js`)
- Gallery workspace → Media library indexing: views library (evidence: `README.md`)
- Creator → File management: manages files (evidence: `README.md`)
- Creator → Collections and notes: organizes (evidence: `README.md`)
- Gallery workspace → Asset clustering: groups assets (evidence: `README.md`)
- Creator → Remix Engine: creates variations (evidence: `README.md`)
- Remix Engine → ComfyUI Queue Deck: queues work (evidence: `README.md`)
- Creator → LoRA Synergy: matches models (evidence: `README.md`)
- ComfyUI Queue Deck → ComfyUI: controls queue (evidence: `README.md`)
- Creator → Client exhibition: shares collections (evidence: `README.md`)
- Creator → Ratings and comments: rates and comments (evidence: `README.md`)
