# whatdreamscost/whatdreamscost-comfyui architecture

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

- Interactive diagram: https://gitdiagram.com/whatdreamscost/whatdreamscost-comfyui
- Repository: https://github.com/whatdreamscost/whatdreamscost-comfyui

## Overview

This repository provides custom ComfyUI nodes and browser interfaces for preparing media and building LTX video-generation timelines. The central workflow is LTX Director: users edit video, image, prompt, and audio segments, then use the node with ComfyUI generation; the guide node adds image and motion guidance. Separate nodes load and trim audio/video, insert keyframes, sequence image guides, and estimate spoken-dialogue duration. The excerpts show Director references to prompt-relay and model-patching code; browser-to-backend wiring and several unsampled node internals are not shown, so those connections are omitted.

Main entry points: [`__init__.py`](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/__init__.py) (ComfyUI Nodes), [`ltx_director.py`](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_director.py) (Timeline Generation), [`ltx_director_guide.py`](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_director_guide.py) (Guide Processing), [`patches.py`](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/patches.py) (Attention Patches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_director["LTX Director"]
  node_director_backend["Timeline Generation<br/>[ltx_director.py]"]
  node_director_ui["Timeline Editor<br/>[ltx_director.js]"]
  node_prompt_relay["Prompt Relay<br/>[prompt_relay.py]"]
  node_model_patches["Attention Patches<br/>[patches.py]"]
  node_guide_backend["Guide Processing"]
  node_guide_ui["Guide Interface"]
end

subgraph group_media["Media Tools"]
  node_audio_loader["Audio Loader<br/>[load_audio_ui.py]"]
  node_audio_ui["Audio Interface<br/>[load_audio_ui.js]"]
  node_video_loader["Video Loader<br/>[load_video_ui.py]"]
  node_video_ui["Video Interface<br/>[load_video_ui.js]"]
end

subgraph group_guides["Image Guidance"]
  node_image_loader["Multi Image Loader"]
  node_image_loader_ui["Image Interface"]
  node_keyframer["LTX Keyframer<br/>[ltx_keyframer.py]"]
  node_keyframer_ui["Keyframer Interface<br/>[ltx_keyframer.js]"]
  node_sequencer["LTX Sequencer<br/>[ltx_sequencer.py]"]
  node_sequencer_ui["Sequencer Interface<br/>[ltx_sequencer.js]"]
end

subgraph group_utilities["Workflow Utilities"]
  node_speech_calculator["Speech Length"]
  node_speech_ui["Speech Interface"]
end

node_user(("Creator"))
node_registry["ComfyUI Nodes<br/>[__init__.py]"]

node_user -->|"uses nodes"| node_registry
node_registry -->|"registers"| node_director_backend
node_registry -->|"registers"| node_guide_backend
node_registry -->|"registers"| node_audio_loader
node_registry -->|"registers"| node_video_loader
node_registry -->|"registers"| node_image_loader
node_registry -->|"registers"| node_keyframer
node_registry -->|"registers"| node_sequencer
node_registry -->|"registers"| node_speech_calculator
node_director_backend -->|"references"| node_prompt_relay
node_director_backend -->|"references"| node_model_patches
node_guide_backend -->|"references"| node_model_patches

click node_registry "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/__init__.py"
click node_director_backend "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_director.py"
click node_director_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_director.js"
click node_prompt_relay "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/prompt_relay.py"
click node_model_patches "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/patches.py"
click node_guide_backend "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_director_guide.py"
click node_guide_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_director_guide.js"
click node_audio_loader "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/load_audio_ui.py"
click node_audio_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/load_audio_ui.js"
click node_video_loader "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/load_video_ui.py"
click node_video_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/load_video_ui.js"
click node_image_loader "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/multi_image_loader.py"
click node_image_loader_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/multi_image_loader.js"
click node_keyframer "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_keyframer.py"
click node_keyframer_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_keyframer.js"
click node_sequencer "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_sequencer.py"
click node_sequencer_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_sequencer.js"
click node_speech_calculator "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/speech_length_calculator.py"
click node_speech_ui "https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/speech_length_calculator.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_director_backend,node_director_ui,node_prompt_relay,node_model_patches,node_guide_backend,node_guide_ui,node_registry toneBlue
class node_audio_loader,node_audio_ui,node_video_loader,node_video_ui toneAmber
class node_image_loader,node_image_loader_ui,node_keyframer,node_keyframer_ui,node_sequencer,node_sequencer_ui toneMint
class node_speech_calculator,node_speech_ui toneRose
class node_user toneIndigo
```

## Components

### LTX Director

- [Timeline Generation](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_director.py): `ltx_director.py`
- [Timeline Editor](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_director.js): `js/ltx_director.js`
- [Prompt Relay](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/prompt_relay.py): `prompt_relay.py`
- [Attention Patches](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/patches.py): `patches.py`
- [Guide Processing](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_director_guide.py): `ltx_director_guide.py`
- [Guide Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_director_guide.js): `js/ltx_director_guide.js`

### Media Tools

- [Audio Loader](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/load_audio_ui.py): `load_audio_ui.py`
- [Audio Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/load_audio_ui.js): `js/load_audio_ui.js`
- [Video Loader](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/load_video_ui.py): `load_video_ui.py`
- [Video Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/load_video_ui.js): `js/load_video_ui.js`

### Image Guidance

- [Multi Image Loader](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/multi_image_loader.py): `multi_image_loader.py`
- [Image Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/multi_image_loader.js): `js/multi_image_loader.js`
- [LTX Keyframer](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_keyframer.py): `ltx_keyframer.py`
- [Keyframer Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_keyframer.js): `js/ltx_keyframer.js`
- [LTX Sequencer](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/ltx_sequencer.py): `ltx_sequencer.py`
- [Sequencer Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/ltx_sequencer.js): `js/ltx_sequencer.js`

### Workflow Utilities

- [Speech Length](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/speech_length_calculator.py): `speech_length_calculator.py`
- [Speech Interface](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/js/speech_length_calculator.js): `js/speech_length_calculator.js`

### Other components

- **Creator**
- [ComfyUI Nodes](https://github.com/whatdreamscost/whatdreamscost-comfyui/blob/main/__init__.py): `__init__.py`

## Connections

- Creator → ComfyUI Nodes: uses nodes (evidence: `README.md`)
- ComfyUI Nodes → Timeline Generation: registers (evidence: `__init__.py`)
- ComfyUI Nodes → Guide Processing: registers (evidence: `__init__.py`)
- ComfyUI Nodes → Audio Loader: registers (evidence: `__init__.py`)
- ComfyUI Nodes → Video Loader: registers (evidence: `__init__.py`)
- ComfyUI Nodes → Multi Image Loader: registers (evidence: `__init__.py`)
- ComfyUI Nodes → LTX Keyframer: registers (evidence: `__init__.py`)
- ComfyUI Nodes → LTX Sequencer: registers (evidence: `__init__.py`)
- ComfyUI Nodes → Speech Length: registers (evidence: `__init__.py`)
- Timeline Generation → Prompt Relay: references (evidence: `ltx_director.py`)
- Timeline Generation → Attention Patches: references (evidence: `ltx_director.py`)
- Guide Processing → Attention Patches: references (evidence: `ltx_director_guide.py`)
