Files
Robin Collins d2871d75fd Add initial implementation of ComfyUI-TechsToolz package with modular architecture and advanced dependency management
- Introduced `__init__.py` for package initialization, dependency checking, and node management.
- Added `image_nodes.py` with nodes for model name extraction and image saving with metadata.
- Created `install.py` for dependency installation and ComfyUI Manager integration setup.
- Included configuration files: `node_config.json`, `.manager_info.json`, and `CHANGELOG.md`.
- Established `.gitignore` to exclude auto-generated files and unnecessary directories.
- Added `README.md` for comprehensive project documentation and usage instructions.
- Implemented `DependencyChecker` and `NodeManager` classes for enhanced functionality.
- Updated `FILETREE.md` to reflect project structure and organization.
2025-06-20 09:55:35 +09:30

7.8 KiB

File Tree

This document describes the structure and organization of the ComfyUI-TechsToolz project.

ComfyUI-TechsToolz/
├── __init__.py                    # Enhanced initialization with dependency checking and node management
├── image_nodes.py                 # Image processing and metadata nodes
├── install.py                     # Custom installation script with dependency management
├── node_list.json                 # ComfyUI Manager node definitions and metadata
├── requirements.txt               # Python package dependencies
├── node_config.json               # Runtime configuration storage (auto-generated, ignored)
├── .manager_info.json             # ComfyUI Manager integration metadata (auto-generated, ignored)
├── README.md                      # Comprehensive project documentation
├── CHANGELOG.md                   # Project changelog and version history
├── CLAUDE.md                      # Claude Code guidance for development
├── FILETREE.md                    # This file - project structure documentation
├── LICENSE                        # GNU General Public License v3
├── pyproject.toml                 # Python project configuration and dependencies
├── .editorconfig                  # Editor configuration for consistent formatting
├── .gitignore                     # Git ignore patterns
├── .pre-commit-config.yaml        # Pre-commit hooks configuration
├── .cursorindexingignore          # Cursor IDE indexing exclusions
├── .specstory/                    # SpecStory development files
└── references/                    # Reference implementations and documentation
    ├── comfyui-python/           # ComfyUI Python reference code
    │   ├── auto_layout.py        # Auto-layout workflow functionality
    │   └── image-saver-nodes.py  # Original image saver node implementations
    └── custom-nodes-docs/        # ComfyUI custom node documentation
        ├── overview.mdx          # Custom node development overview
        ├── help_page.mdx         # Help and support documentation
        ├── tips.mdx              # Development tips and best practices
        ├── walkthrough.mdx       # Step-by-step development guide
        ├── workflow_templates.mdx # Workflow template examples
        ├── backend/              # Backend development documentation
        │   ├── datatypes.mdx     # Data types and structures
        │   ├── expansion.mdx     # Node expansion concepts
        │   ├── images_and_masks.mdx # Image and mask handling
        │   ├── interface.mdx     # Interface design patterns
        │   ├── lazy_evaluation.mdx # Lazy evaluation techniques
        │   ├── lifecycle.mdx     # Node lifecycle management
        │   ├── lists.mdx         # List handling and operations
        │   ├── manager.mdx       # Node manager functionality
        │   ├── more_on_inputs.mdx # Advanced input handling
        │   ├── server_overview.mdx # Server architecture overview
        │   ├── snippets.mdx      # Code snippets and examples
        │   └── tensors.mdx       # Tensor operations and handling
        └── js/                   # JavaScript/Frontend documentation
            ├── javascript_about_panel_badges.mdx # UI badges and indicators
            ├── javascript_bottom_panel_tabs.mdx  # Bottom panel tab system
            ├── javascript_commands_keybindings.mdx # Command and key bindings
            ├── javascript_dialog.mdx # Dialog and modal systems
            ├── javascript_examples.mdx # JavaScript code examples
            ├── javascript_hooks.mdx # Hook system for extensions
            ├── javascript_objects_and_hijacking.mdx # Object manipulation
            ├── javascript_overview.mdx # JavaScript architecture overview
            ├── javascript_settings.mdx # Settings and configuration
            ├── javascript_sidebar_tabs.mdx # Sidebar tab functionality
            ├── javascript_toast.mdx # Toast notification system
            └── javascript_topbar_menu.mdx # Top bar menu system

Key Files

Core System Files

  • __init__.py - Enhanced initialization module with dependency checking, node management, and ComfyUI Manager integration
  • image_nodes.py - Image processing and metadata handling nodes with utility functions
  • install.py - Custom installation script with dependency management and environment validation

ComfyUI Manager Integration

  • node_list.json - Manual node definitions and metadata for ComfyUI Manager
  • node_config.json - Runtime configuration storage for module states (auto-generated, ignored)
  • .manager_info.json - ComfyUI Manager integration metadata (auto-generated, ignored)

Documentation & Configuration

  • README.md - Comprehensive project documentation with usage examples and API reference
  • requirements.txt - Python package dependencies for installation
  • pyproject.toml - Defines project metadata, dependencies, and development tools configuration
  • references/ - Contains reference implementations and ComfyUI development documentation
  • Configuration files - Various dotfiles for development environment setup and tooling

Modular Architecture

The project uses a modular design for scalability:

Current Modules

  • image_nodes.py - Contains:
    • ModelNameExtractor - Extracts model names from ComfyUI MODEL objects
    • ImageSaveWithMetadata - Advanced image saving with embedded metadata
    • Utility functions for file handling, timestamps, and metadata processing

Advanced Systems

  • DependencyChecker (in __init__.py) - Automated dependency scanning and validation:
    • AST-based Python file analysis
    • Import statement extraction and categorization
    • Real-time package availability checking
    • Comprehensive reporting with installation suggestions
  • NodeManager (in __init__.py) - Dynamic module loading and configuration:
    • Module enable/disable functionality
    • Persistent configuration storage
    • ComfyUI Manager API integration
    • Dynamic node registration based on module state

Future Expansion

The architecture is designed to easily accommodate new modules:

  • utility_nodes.py - General utility nodes (string manipulation, math operations, etc.)
  • workflow_nodes.py - Workflow management and automation nodes
  • ai_nodes.py - AI/ML specific processing nodes
  • file_nodes.py - File system operations and management

Registration System

  • Each module exports NODE_CLASSES and NODE_DISPLAY_NAMES dictionaries
  • __init__.py dynamically imports enabled modules only
  • Module states are controlled via NodeManager and stored in node_config.json
  • ComfyUI Manager integration allows runtime enable/disable of modules
  • New modules require adding to available_modules dict in __init__.py
  • All nodes use "🖥️🛠TechsToolz" category prefix for consistent branding

ComfyUI Manager Integration

  • API Functions: Complete set of functions for ComfyUI Manager interaction
  • Configuration Management: JSON-based persistent configuration system
  • Node Metadata: Detailed node information in node_list.json
  • Installation Automation: Custom install.py script handles setup process

Development Guidelines

  • Node classes should be organized by functionality into appropriate modules
  • Each module should export NODE_CLASSES and NODE_DISPLAY_NAMES dictionaries
  • Utility functions should be placed in the same module as the nodes that use them
  • All nodes must follow ComfyUI's standard architecture patterns
  • Comprehensive documentation and type hints are required throughout