# pythongosssss/comfyui-custom-scripts architecture

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

- Interactive diagram: https://gitdiagram.com/pythongosssss/comfyui-custom-scripts
- Repository: https://github.com/pythongosssss/comfyui-custom-scripts

## Overview

ComfyUI-Custom-Scripts is an extension of ComfyUI with Python custom nodes and browser-side graph and workflow enhancements. Users work in the ComfyUI graph: they configure prompts and nodes, inspect or arrange graph content, and receive generated-image or execution feedback. The repository also provides model information, workflow management, and image utilities. The entry point dynamically loads Python node modules; browser modules register UI features. Relationships between unsampled feature modules are not inferred beyond documented capabilities.

Main entry points: [`__init__.py`](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/__init__.py) (Extension loader), [`web/js/autocompleter.js`](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/autocompleter.js) (Prompt autocomplete), [`web/js/common/modelInfoDialog.js`](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/modelInfoDialog.js) (Model info dialog), [`web/js/modelInfo.js`](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/modelInfo.js) (Model info UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Extension Entry"]
  node_loader["Extension loader<br/>[__init__.py]"]
  node_runtime["Extension utilities<br/>[pysssss.py]"]
end

subgraph group_prompt["Prompt and Graph Tools"]
  node_prompt_nodes["Prompt nodes"]
  node_autocomplete["Prompt autocomplete<br/>[autocompleter.js]"]
  node_autocomplete_core["Autocomplete engine<br/>[autocomplete.js]"]
  node_better_combos["Better loader lists<br/>[betterCombos.js]"]
  node_math["Math expression<br/>[mathExpression.js]"]
  node_preset["Preset text<br/>[presetText.js]"]
  node_string["String function<br/>[stringFunction.js]"]
  node_repeater["Repeater<br/>[repeater.js]"]
  node_reroute["Reroute primitive"]
  node_quick_nodes["Quick nodes<br/>[quickNodes.js]"]
  node_graph_tools["Graph navigation<br/>[graphArrange.js]"]
  node_colors["Custom colors<br/>[customColors.js]"]
  node_snap["Grid snapping<br/>[snapToGrid.js]"]
  node_node_finder["Node finder<br/>[nodeFinder.js]"]
end

subgraph group_models["Model and Workflow Tools"]
  node_model_info["Model info UI<br/>[modelInfo.js]"]
  node_model_dialog["Model info dialog<br/>[modelInfoDialog.js]"]
  node_model_backend["Model metadata service<br/>[model_info.py]"]
  node_workflows["Workflow management<br/>[workflows.js]"]
  node_workflow_api["Workflow storage API<br/>[workflows.py]"]
  node_image_tools["Image constraints<br/>[constrain_image.py]"]
end

subgraph group_feedback["Generation Feedback"]
  node_image_feed["Generated image feed<br/>[imageFeed.js]"]
  node_lightbox["Image lightbox<br/>[lightbox.js]"]
  node_show_image["Menu image preview<br/>[showImageOnMenu.js]"]
  node_show_text["Text display<br/>[showText.js]"]
  node_sound["Execution sound<br/>[playSound.js]"]
  node_notification["System notification"]
  node_status["Favicon status<br/>[faviconStatus.js]"]
end

node_user(("ComfyUI user"))

node_user -->|"installs extension"| node_loader
node_loader -->|"initializes"| node_runtime
node_loader -->|"loads node modules"| node_prompt_nodes
node_user -->|"uses prompt tools"| node_autocomplete
node_autocomplete -->|"uses engine"| node_autocomplete_core
node_autocomplete -->|"opens embedding info"| node_model_dialog
node_model_info -->|"extends dialog"| node_model_dialog
node_model_dialog -->|"requests metadata"| node_model_backend
node_workflows -.->|"uses workflow API"| node_workflow_api
node_user -->|"views generated images"| node_image_feed
node_image_feed -->|"opens images"| node_lightbox
node_user -->|"inspects models"| node_model_info
node_user -->|"manages workflows"| node_workflows
node_user -->|"resizes images"| node_image_tools
node_user -->|"selects models"| node_better_combos
node_user -->|"evaluates expressions"| node_math
node_user -->|"uses text presets"| node_preset
node_user -->|"transforms strings"| node_string
node_user -->|"repeats graph inputs"| node_repeater
node_user -->|"builds graph sections"| node_quick_nodes
node_user -->|"arranges graph"| node_graph_tools
node_user -->|"configures execution alerts"| node_sound
node_user -->|"configures notifications"| node_notification

click node_loader "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/__init__.py"
click node_runtime "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/pysssss.py"
click node_prompt_nodes "https://github.com/pythongosssss/comfyui-custom-scripts/tree/main/py"
click node_autocomplete "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/autocompleter.js"
click node_autocomplete_core "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/autocomplete.js"
click node_better_combos "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/betterCombos.js"
click node_math "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/mathExpression.js"
click node_preset "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/presetText.js"
click node_string "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/stringFunction.js"
click node_repeater "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/repeater.js"
click node_reroute "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/reroutePrimitive.js"
click node_quick_nodes "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/quickNodes.js"
click node_graph_tools "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/graphArrange.js"
click node_model_info "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/modelInfo.js"
click node_model_dialog "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/modelInfoDialog.js"
click node_model_backend "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/py/model_info.py"
click node_workflows "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/workflows.js"
click node_workflow_api "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/py/workflows.py"
click node_image_tools "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/py/constrain_image.py"
click node_image_feed "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/imageFeed.js"
click node_lightbox "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/lightbox.js"
click node_show_image "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/showImageOnMenu.js"
click node_show_text "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/showText.js"
click node_sound "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/playSound.js"
click node_notification "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/systemNotification.js"
click node_status "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/faviconStatus.js"
click node_colors "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/customColors.js"
click node_snap "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/snapToGrid.js"
click node_node_finder "https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/nodeFinder.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_loader,node_runtime,node_user toneBlue
class node_prompt_nodes,node_autocomplete,node_autocomplete_core,node_better_combos,node_math,node_preset,node_string,node_repeater,node_reroute,node_quick_nodes,node_graph_tools,node_colors,node_snap,node_node_finder toneAmber
class node_model_info,node_model_dialog,node_model_backend,node_workflows,node_workflow_api,node_image_tools toneMint
class node_image_feed,node_lightbox,node_show_image,node_show_text,node_sound,node_notification,node_status toneRose
```

## Components

### Extension Entry

- [Extension loader](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/__init__.py): `__init__.py`
- [Extension utilities](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/pysssss.py): `pysssss.py`

### Prompt and Graph Tools

- [Prompt nodes](https://github.com/pythongosssss/comfyui-custom-scripts/tree/main/py): `py`
- [Prompt autocomplete](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/autocompleter.js): `web/js/autocompleter.js`
- [Autocomplete engine](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/autocomplete.js): `web/js/common/autocomplete.js`
- [Better loader lists](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/betterCombos.js): `web/js/betterCombos.js`
- [Math expression](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/mathExpression.js): `web/js/mathExpression.js`
- [Preset text](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/presetText.js): `web/js/presetText.js`
- [String function](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/stringFunction.js): `web/js/stringFunction.js`
- [Repeater](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/repeater.js): `web/js/repeater.js`
- [Reroute primitive](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/reroutePrimitive.js): `web/js/reroutePrimitive.js`
- [Quick nodes](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/quickNodes.js): `web/js/quickNodes.js`
- [Graph navigation](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/graphArrange.js): `web/js/graphArrange.js`
- [Custom colors](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/customColors.js): `web/js/customColors.js`
- [Grid snapping](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/snapToGrid.js): `web/js/snapToGrid.js`
- [Node finder](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/nodeFinder.js): `web/js/nodeFinder.js`

### Model and Workflow Tools

- [Model info UI](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/modelInfo.js): `web/js/modelInfo.js`
- [Model info dialog](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/modelInfoDialog.js): `web/js/common/modelInfoDialog.js`
- [Model metadata service](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/py/model_info.py): `py/model_info.py`
- [Workflow management](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/workflows.js): `web/js/workflows.js`
- [Workflow storage API](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/py/workflows.py): `py/workflows.py`
- [Image constraints](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/py/constrain_image.py): `py/constrain_image.py`

### Generation Feedback

- [Generated image feed](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/imageFeed.js): `web/js/imageFeed.js`
- [Image lightbox](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/common/lightbox.js): `web/js/common/lightbox.js`
- [Menu image preview](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/showImageOnMenu.js): `web/js/showImageOnMenu.js`
- [Text display](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/showText.js): `web/js/showText.js`
- [Execution sound](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/playSound.js): `web/js/playSound.js`
- [System notification](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/systemNotification.js): `web/js/systemNotification.js`
- [Favicon status](https://github.com/pythongosssss/comfyui-custom-scripts/blob/main/web/js/faviconStatus.js): `web/js/faviconStatus.js`

### Other components

- **ComfyUI user**

## Connections

- ComfyUI user → Extension loader: installs extension
- Extension loader → Extension utilities: initializes (evidence: `__init__.py`)
- Extension loader → Prompt nodes: loads node modules (evidence: `__init__.py`)
- ComfyUI user → Prompt autocomplete: uses prompt tools
- Prompt autocomplete → Autocomplete engine: uses engine (evidence: `web/js/autocompleter.js`)
- Prompt autocomplete → Model info dialog: opens embedding info (evidence: `web/js/autocompleter.js`)
- Model info UI → Model info dialog: extends dialog (evidence: `web/js/modelInfo.js`)
- Model info dialog → Model metadata service: requests metadata (evidence: `web/js/common/modelInfoDialog.js`)
- Workflow management → Workflow storage API: uses workflow API
- ComfyUI user → Generated image feed: views generated images
- Generated image feed → Image lightbox: opens images (evidence: `web/js/imageFeed.js`)
- ComfyUI user → Model info UI: inspects models
- ComfyUI user → Workflow management: manages workflows
- ComfyUI user → Image constraints: resizes images
- ComfyUI user → Better loader lists: selects models
- ComfyUI user → Math expression: evaluates expressions
- ComfyUI user → Preset text: uses text presets
- ComfyUI user → String function: transforms strings
- ComfyUI user → Repeater: repeats graph inputs
- ComfyUI user → Quick nodes: builds graph sections
- ComfyUI user → Graph navigation: arranges graph
- ComfyUI user → Execution sound: configures execution alerts
- ComfyUI user → System notification: configures notifications
