# beeefx/comfyui-bat-nodepack architecture

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

- Interactive diagram: https://gitdiagram.com/beeefx/comfyui-bat-nodepack
- Repository: https://github.com/beeefx/comfyui-bat-nodepack

## Overview

BAT is a ComfyUI custom-node pack for loading, transforming, masking, compositing, and exporting image and video workflows. Users assemble nodes in ComfyUI; media flows through the chosen graph to an exported result or a downstream workflow. The map preserves the README’s major capability branches and shows SeC’s inference layer. README workflows support the representative media-flow edges; source excerpts are partial, so unverified internal wiring and frontend-to-backend relationships are omitted.

Main entry points: [`bat_loader.py`](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_loader.py) (Loader), [`bat_video_loader.py`](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_video_loader.py) (Video Loader), [`bat_animated_grade.py`](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_animated_grade.py) (Animated Grade), [`__init__.py`](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/__init__.py) (BAT node pack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow entry"]
  node_comfy["ComfyUI graph"]
  node_pack["BAT node pack<br/>[__init__.py]"]
  node_node_preview["Node previews<br/>[bat_preview.py]"]
end

subgraph group_media["Media I/O"]
  node_loader["Loader<br/>[bat_loader.py]"]
  node_video_loader["Video Loader"]
  node_exr_layer["EXR Layer<br/>[bat_exr_layers.py]"]
  node_frame_picker["Frame Picker"]
  node_video_combine["Video Combine"]
end

subgraph group_edit["Animation and masks"]
  node_animated_crop["Animated Crop"]
  node_animated_grade["Animated Grade"]
  node_roto["Roto mask<br/>[bat_roto.py]"]
  node_uncrop["Uncrop<br/>[bat_uncrop.py]"]
  node_mask_morph["Mask morph<br/>[bat_mask_morph.py]"]
end

subgraph group_composite["Compositing"]
  node_grade["Grade<br/>[bat_grade.py]"]
  node_advanced_blend["Advanced Blend"]
  node_layered_images["Layered Images"]
  node_hdr["HDR tools"]
end

subgraph group_special["Specialized tools"]
  node_sec_segmenter["SeC Segmenter"]
  node_sec_runtime["SeC runtime<br/>[bat_sec_runtime.py]"]
  node_sec_inference["SeC inference stack"]
  node_vace["VACE batch tool<br/>[bat_vace_batch.py]"]
  node_wan_tools["WAN helpers"]
  node_profiler["BAT Profiler<br/>[bat_profiler.py]"]
end

node_artist(("Workflow author"))

node_artist -->|"builds graph"| node_comfy
node_comfy -->|"loads nodes"| node_pack
node_pack -->|"registers nodes"| node_loader
node_comfy -->|"executes graph"| node_loader
node_comfy -->|"executes graph"| node_video_loader
node_loader -->|"passes EXR"| node_exr_layer
node_loader -->|"passes frames"| node_frame_picker
node_video_loader -->|"passes video"| node_video_combine
node_loader -->|"passes images"| node_animated_crop
node_animated_crop -->|"passes cropped frames"| node_animated_grade
node_animated_grade -->|"passes processed crop"| node_uncrop
node_uncrop -->|"passes frames"| node_video_combine
node_video_loader -->|"passes video"| node_roto
node_roto -->|"passes mask"| node_animated_grade
node_loader -->|"passes images"| node_grade
node_grade -->|"passes images"| node_advanced_blend
node_loader -->|"passes layers"| node_layered_images
node_hdr -->|"passes HDR"| node_advanced_blend
node_video_loader -->|"passes video"| node_sec_segmenter
node_sec_segmenter -->|"requests tracking"| node_sec_runtime
node_sec_runtime -->|"runs inference"| node_sec_inference
node_comfy -->|"executes graph"| node_vace
node_comfy -->|"executes graph"| node_wan_tools
node_comfy -->|"records runs"| node_profiler
node_loader -->|"generates preview"| node_node_preview

click node_pack "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/__init__.py"
click node_loader "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_loader.py"
click node_video_loader "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_video_loader.py"
click node_exr_layer "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_exr_layers.py"
click node_frame_picker "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_frame_picker.py"
click node_video_combine "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_video_combine.py"
click node_animated_crop "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_animated_crop.py"
click node_animated_grade "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_animated_grade.py"
click node_roto "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_roto.py"
click node_uncrop "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_uncrop.py"
click node_mask_morph "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_mask_morph.py"
click node_grade "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_grade.py"
click node_advanced_blend "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_advanced_blend.py"
click node_layered_images "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_layered_images.py"
click node_hdr "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_exposure_bracket.py"
click node_sec_segmenter "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_sec_segmenter.py"
click node_sec_runtime "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_sec_runtime.py"
click node_sec_inference "https://github.com/beeefx/comfyui-bat-nodepack/tree/main/bat_sec/inference"
click node_vace "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_vace_batch.py"
click node_wan_tools "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_wan_context_calculator.py"
click node_profiler "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_profiler.py"
click node_node_preview "https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_preview.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_comfy,node_pack,node_node_preview toneBlue
class node_loader,node_video_loader,node_exr_layer,node_frame_picker,node_video_combine toneAmber
class node_animated_crop,node_animated_grade,node_roto,node_uncrop,node_mask_morph toneMint
class node_grade,node_advanced_blend,node_layered_images,node_hdr toneRose
class node_sec_segmenter,node_sec_runtime,node_sec_inference,node_vace,node_wan_tools,node_profiler,node_artist toneIndigo
```

## Components

### Workflow entry

- **ComfyUI graph**
- [BAT node pack](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/__init__.py): `__init__.py`
- [Node previews](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_preview.py): `bat_preview.py`

### Media I/O

- [Loader](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_loader.py): `bat_loader.py`
- [Video Loader](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_video_loader.py): `bat_video_loader.py`
- [EXR Layer](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_exr_layers.py): `bat_exr_layers.py`
- [Frame Picker](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_frame_picker.py): `bat_frame_picker.py`
- [Video Combine](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_video_combine.py): `bat_video_combine.py`

### Animation and masks

- [Animated Crop](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_animated_crop.py): `bat_animated_crop.py`
- [Animated Grade](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_animated_grade.py): `bat_animated_grade.py`
- [Roto mask](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_roto.py): `bat_roto.py`
- [Uncrop](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_uncrop.py): `bat_uncrop.py`
- [Mask morph](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_mask_morph.py): `bat_mask_morph.py`

### Compositing

- [Grade](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_grade.py): `bat_grade.py`
- [Advanced Blend](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_advanced_blend.py): `bat_advanced_blend.py`
- [Layered Images](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_layered_images.py): `bat_layered_images.py`
- [HDR tools](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_exposure_bracket.py): `bat_exposure_bracket.py`

### Specialized tools

- [SeC Segmenter](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_sec_segmenter.py): `bat_sec_segmenter.py`
- [SeC runtime](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_sec_runtime.py): `bat_sec_runtime.py`
- [SeC inference stack](https://github.com/beeefx/comfyui-bat-nodepack/tree/main/bat_sec/inference): `bat_sec/inference`
- [VACE batch tool](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_vace_batch.py): `bat_vace_batch.py`
- [WAN helpers](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_wan_context_calculator.py): `bat_wan_context_calculator.py`
- [BAT Profiler](https://github.com/beeefx/comfyui-bat-nodepack/blob/main/bat_profiler.py): `bat_profiler.py`

### Other components

- **Workflow author**

## Connections

- Workflow author → ComfyUI graph: builds graph
- ComfyUI graph → BAT node pack: loads nodes
- BAT node pack → Loader: registers nodes
- ComfyUI graph → Loader: executes graph
- ComfyUI graph → Video Loader: executes graph
- Loader → EXR Layer: passes EXR
- Loader → Frame Picker: passes frames
- Video Loader → Video Combine: passes video
- Loader → Animated Crop: passes images
- Animated Crop → Animated Grade: passes cropped frames
- Animated Grade → Uncrop: passes processed crop
- Uncrop → Video Combine: passes frames
- Video Loader → Roto mask: passes video
- Roto mask → Animated Grade: passes mask
- Loader → Grade: passes images
- Grade → Advanced Blend: passes images
- Loader → Layered Images: passes layers
- HDR tools → Advanced Blend: passes HDR
- Video Loader → SeC Segmenter: passes video
- SeC Segmenter → SeC runtime: requests tracking
- SeC runtime → SeC inference stack: runs inference
- ComfyUI graph → VACE batch tool: executes graph
- ComfyUI graph → WAN helpers: executes graph
- ComfyUI graph → BAT Profiler: records runs
- Loader → Node previews: generates preview
