# rgthree/rgthree-comfy architecture

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

- Interactive diagram: https://gitdiagram.com/rgthree/rgthree-comfy
- Repository: https://github.com/rgthree/rgthree-comfy

## Overview

rgthree-comfy is a ComfyUI extension combining custom workflow nodes, canvas and workflow usability features, and model-information/configuration services. Users build or adjust graphs in ComfyUI; its execution invokes the extension’s backend nodes and returns workflow outputs, while frontend services track execution and support graph interactions. The README documents more node capabilities than the sampled source verifies; those are represented at their existing source paths without asserting internal wiring. Backend model routes and frontend model-info calls are included where excerpts show their responsibilities.

Main entry points: [`src_web/common/model_info_service.ts`](https://github.com/rgthree/rgthree-comfy/blob/main/src_web/common/model_info_service.ts) (Model Info Service), [`py/server/routes_model_info.py`](https://github.com/rgthree/rgthree-comfy/blob/main/py/server/routes_model_info.py) (Model Info Routes), [`py/context.py`](https://github.com/rgthree/rgthree-comfy/blob/main/py/context.py) (Context Nodes), [`py/server/routes_config.py`](https://github.com/rgthree/rgthree-comfy/blob/main/py/server/routes_config.py) (Config Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow Nodes"]
  node_context_nodes["Context Nodes<br/>[context.py]"]
  node_context_switch["Context Switches<br/>[context_switch.py]"]
  node_context_merge["Context Merges<br/>[context_merge.py]"]
  node_prompts["Prompt Nodes<br/>[power_prompt.py]"]
  node_lora["Power LoRA Loader"]
  node_seed["Seed Node<br/>[seed.py]"]
  node_image_nodes["Image Nodes<br/>[image_comparer.py]"]
  node_display["Display Any<br/>[display_any.py]"]
end

subgraph group_canvas["Canvas Features"]
  node_bookmarks["Bookmarks<br/>[bookmark.js]"]
  node_graph_controls["Graph Controls"]
  node_reroute["Reroute Node<br/>[reroute.js]"]
  node_context_ui["Context UI<br/>[context.js]"]
end

subgraph group_services["Frontend Services"]
  node_prompt_service["Prompt Tracking<br/>[prompt_service.ts]"]
  node_model_service["Model Info Service"]
  node_config_service["Config Service<br/>[config_service.js]"]
  node_model_page["Model Info Page"]
end

subgraph group_backend["Backend APIs"]
  node_model_routes["Model Info Routes"]
  node_config_routes["Config Routes<br/>[routes_config.py]"]
end

node_user(("ComfyUI User"))
node_comfyui["ComfyUI"]
node_model_files[("ComfyUI Model Files")]

node_user -->|"edits workflow"| node_comfyui
node_comfyui -->|"executes nodes"| node_context_nodes
node_comfyui -->|"executes nodes"| node_context_switch
node_comfyui -->|"executes nodes"| node_context_merge
node_comfyui -->|"executes nodes"| node_prompts
node_comfyui -->|"executes nodes"| node_lora
node_comfyui -->|"executes nodes"| node_seed
node_comfyui -->|"executes nodes"| node_image_nodes
node_comfyui -->|"executes nodes"| node_display
node_user -->|"navigates graph"| node_bookmarks
node_user -->|"toggles groups"| node_graph_controls
node_user -->|"routes connections"| node_reroute
node_context_ui -->|"configures slots"| node_context_nodes
node_comfyui -->|"queues prompts"| node_prompt_service
node_model_page -->|"requests model info"| node_model_service
node_model_service -->|"fetches and updates"| node_model_routes
node_model_routes -->|"lists model files"| node_model_files
node_user -->|"configures extension"| node_config_routes
node_config_service -->|"reads configuration"| node_config_routes

click node_context_nodes "https://github.com/rgthree/rgthree-comfy/blob/main/py/context.py"
click node_context_switch "https://github.com/rgthree/rgthree-comfy/blob/main/py/context_switch.py"
click node_context_merge "https://github.com/rgthree/rgthree-comfy/blob/main/py/context_merge.py"
click node_prompts "https://github.com/rgthree/rgthree-comfy/blob/main/py/power_prompt.py"
click node_lora "https://github.com/rgthree/rgthree-comfy/blob/main/py/power_lora_loader.py"
click node_seed "https://github.com/rgthree/rgthree-comfy/blob/main/py/seed.py"
click node_image_nodes "https://github.com/rgthree/rgthree-comfy/blob/main/py/image_comparer.py"
click node_display "https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py"
click node_bookmarks "https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/bookmark.js"
click node_graph_controls "https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/fast_groups_muter.js"
click node_reroute "https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/reroute.js"
click node_context_ui "https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/context.js"
click node_prompt_service "https://github.com/rgthree/rgthree-comfy/blob/main/src_web/common/prompt_service.ts"
click node_model_service "https://github.com/rgthree/rgthree-comfy/blob/main/src_web/common/model_info_service.ts"
click node_config_service "https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/services/config_service.js"
click node_model_routes "https://github.com/rgthree/rgthree-comfy/blob/main/py/server/routes_model_info.py"
click node_config_routes "https://github.com/rgthree/rgthree-comfy/blob/main/py/server/routes_config.py"
click node_model_page "https://github.com/rgthree/rgthree-comfy/blob/main/web/models/models_info_page.js"

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_context_nodes,node_context_switch,node_context_merge,node_prompts,node_lora,node_seed,node_image_nodes,node_display,node_user,node_comfyui toneBlue
class node_bookmarks,node_graph_controls,node_reroute,node_context_ui,node_model_files toneAmber
class node_prompt_service,node_model_service,node_config_service,node_model_page toneMint
class node_model_routes,node_config_routes toneRose
```

## Components

### Workflow Nodes

- [Context Nodes](https://github.com/rgthree/rgthree-comfy/blob/main/py/context.py): `py/context.py`
- [Context Switches](https://github.com/rgthree/rgthree-comfy/blob/main/py/context_switch.py): `py/context_switch.py`
- [Context Merges](https://github.com/rgthree/rgthree-comfy/blob/main/py/context_merge.py): `py/context_merge.py`
- [Prompt Nodes](https://github.com/rgthree/rgthree-comfy/blob/main/py/power_prompt.py): `py/power_prompt.py`
- [Power LoRA Loader](https://github.com/rgthree/rgthree-comfy/blob/main/py/power_lora_loader.py): `py/power_lora_loader.py`
- [Seed Node](https://github.com/rgthree/rgthree-comfy/blob/main/py/seed.py): `py/seed.py`
- [Image Nodes](https://github.com/rgthree/rgthree-comfy/blob/main/py/image_comparer.py): `py/image_comparer.py`
- [Display Any](https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py): `py/display_any.py`

### Canvas Features

- [Bookmarks](https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/bookmark.js): `web/comfyui/bookmark.js`
- [Graph Controls](https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/fast_groups_muter.js): `web/comfyui/fast_groups_muter.js`
- [Reroute Node](https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/reroute.js): `web/comfyui/reroute.js`
- [Context UI](https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/context.js): `web/comfyui/context.js`

### Frontend Services

- [Prompt Tracking](https://github.com/rgthree/rgthree-comfy/blob/main/src_web/common/prompt_service.ts): `src_web/common/prompt_service.ts`
- [Model Info Service](https://github.com/rgthree/rgthree-comfy/blob/main/src_web/common/model_info_service.ts): `src_web/common/model_info_service.ts`
- [Config Service](https://github.com/rgthree/rgthree-comfy/blob/main/web/comfyui/services/config_service.js): `web/comfyui/services/config_service.js`
- [Model Info Page](https://github.com/rgthree/rgthree-comfy/blob/main/web/models/models_info_page.js): `web/models/models_info_page.js`

### Backend APIs

- [Model Info Routes](https://github.com/rgthree/rgthree-comfy/blob/main/py/server/routes_model_info.py): `py/server/routes_model_info.py`
- [Config Routes](https://github.com/rgthree/rgthree-comfy/blob/main/py/server/routes_config.py): `py/server/routes_config.py`

### Other components

- **ComfyUI User**
- **ComfyUI**
- **ComfyUI Model Files**

## Connections

- ComfyUI User → ComfyUI: edits workflow
- ComfyUI → Context Nodes: executes nodes
- ComfyUI → Context Switches: executes nodes
- ComfyUI → Context Merges: executes nodes
- ComfyUI → Prompt Nodes: executes nodes
- ComfyUI → Power LoRA Loader: executes nodes
- ComfyUI → Seed Node: executes nodes
- ComfyUI → Image Nodes: executes nodes
- ComfyUI → Display Any: executes nodes
- ComfyUI User → Bookmarks: navigates graph
- ComfyUI User → Graph Controls: toggles groups
- ComfyUI User → Reroute Node: routes connections
- Context UI → Context Nodes: configures slots
- ComfyUI → Prompt Tracking: queues prompts
- Model Info Page → Model Info Service: requests model info
- Model Info Service → Model Info Routes: fetches and updates
- Model Info Routes → ComfyUI Model Files: lists model files
- ComfyUI User → Config Routes: configures extension
- Config Service → Config Routes: reads configuration
