# akatz-ai/comfyui-depthflow-nodes architecture

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

- Interactive diagram: https://gitdiagram.com/akatz-ai/comfyui-depthflow-nodes
- Repository: https://github.com/akatz-ai/comfyui-depthflow-nodes

## Overview

##### Project type and purpose
- This is an open-source ComfyUI custom node pack (“Depthflow Node Pack for ComfyUI”) that implements the Depthflow library inside ComfyUI. It extends RyanOnTheInside’s Flex System to provide a set of nodes for generating 2.5D parallax animations from 2D images and depth maps.

##### File structure
- Top-level:
- example_workflows/      → sample JSON workflows
- src/                    → Python source code
– base_flex.py          → glue code integrating Flex System
– depthflow.py          → core Depthflow node definition
– effects/              → depthflow_effects.py (DOF, vignette)
– motion/               → motion_base, motion_components, motion_presets
- Config & metadata:
- pyproject.toml, requirements.txt → Python package metadata & dependencies
- .github/workflows/publish_action.yml → CI for publishing the node pack

##### README for additional insights
- Purpose: turn images + depth maps into parallax animation
- Core components documented: Depthflow node, Effects nodes, Motion Presets, Motion Components
- External dependencies: ComfyUI, Flex System, Depthflow library

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Host Layer
    subgraph "Host Components"
        ComfyUI["ComfyUI Host"]:::host
        FlexSystem["Flex System"]:::flex
    end

    %% Custom Node Pack
    subgraph "Depthflow Node Pack" 
        BaseFlex["BaseFlex Integration"]:::custom
        CoreNode["Core Depthflow Node"]:::custom
        Effects["Effects Module"]:::custom
        subgraph "Motion Module"
            MotionBase["Motion Base"]:::custom
            MotionComponents["Motion Components"]:::custom
            MotionPresets["Motion Presets"]:::custom
        end
    end

    %% External Dependencies
    subgraph "External Dependency"
        DepthflowLib["Depthflow Library"]:::external
    end

    %% Consumers
    subgraph "Example Workflows" 
        ExampleWF["Example Workflows JSON"]:::consumer
    end

    %% Configuration & CI
    subgraph "Config & CI"
        CI["CI Publishing Action"]:::config
        Metadata["Package Metadata (pyproject.toml)"]:::config
        Requirements["Runtime Dependencies (requirements.txt)"]:::config
    end

    %% Relationships
    ComfyUI -->|"loads/registers"| BaseFlex
    BaseFlex -->|"registers nodes via Flex System"| CoreNode
    BaseFlex -->|"registers nodes via Flex System"| Effects
    BaseFlex -->|"registers nodes via Flex System"| MotionBase
    CoreNode -->|"calls frame generation"| DepthflowLib
    Effects -->|"injects config into"| CoreNode
    MotionBase -->|"injects config into"| CoreNode
    MotionComponents -->|"extends Motion Base"| MotionBase
    MotionPresets -->|"extends Motion Base"| MotionBase
    ExampleWF -->|"consumes workflows via ComfyUI"| ComfyUI

    %% Click Events
    click BaseFlex "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/src/base_flex.py"
    click CoreNode "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/src/depthflow.py"
    click Effects "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/src/effects/depthflow_effects.py"
    click MotionBase "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/src/motion/depthflow_motion_base.py"
    click MotionComponents "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/src/motion/depthflow_motion_components.py"
    click MotionPresets "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/src/motion/depthflow_motion_presets.py"
    click ExampleWF "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/example_workflows/depthflow_showcase_v2_1.json"
    click CI "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/.github/workflows/publish_action.yml"
    click Metadata "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/pyproject.toml"
    click Requirements "https://github.com/akatz-ai/comfyui-depthflow-nodes/blob/main/requirements.txt"

    %% Styles
    classDef host fill:#f9f,stroke:#333,stroke-width:2px
    classDef flex fill:#bbf,stroke:#333,stroke-width:2px
    classDef custom fill:#bfb,stroke:#333,stroke-width:2px
    classDef external fill:#ffb,stroke:#333,stroke-width:2px
    classDef consumer fill:#eee,stroke:#333,stroke-dasharray:5 5
    classDef config fill:#ffd,stroke:#333,stroke-width:2px
```
