ComfyUI Extension: ComfyUI-TechsToolz

Authored by robin-collins

Created

Updated

0 stars

A modular collection of ComfyUI custom nodes with advanced dependency management and ComfyUI Manager integration.

Custom Nodes (0)

    README

    ComfyUI-TechsToolz

    A modular collection of ComfyUI custom nodes with advanced dependency management and ComfyUI Manager integration.

    πŸš€ Features

    πŸ–₯οΈπŸ›  Available Nodes

    • πŸ–₯οΈπŸ› TechsToolz: Model Name Extractor - Extracts model names from ComfyUI MODEL objects
    • πŸ–₯οΈπŸ› TechsToolz: Save Image w/Metadata - Advanced image saving with embedded metadata

    πŸ” Dependency Management

    • Automatic Dependency Scanning - Scans all Python files and identifies dependencies
    • Runtime Dependency Checking - Validates dependencies at startup
    • Missing Dependency Reporting - Clear reports on missing packages with installation suggestions
    • Dependency Health Monitoring - Ongoing validation of package availability

    πŸ”§ ComfyUI Manager Integration

    • Node Enable/Disable - Toggle individual node modules on/off
    • Configuration Management - Persistent configuration storage
    • Manager API Support - Full integration with ComfyUI Manager
    • Modular Architecture - Easy addition of new node modules

    πŸ“¦ Installation

    Via ComfyUI Manager (Recommended)

    1. Open ComfyUI Manager
    2. Search for "ComfyUI-TechsToolz"
    3. Click Install
    4. Restart ComfyUI

    Manual Installation

    1. Clone this repository into your ComfyUI custom_nodes directory:
    cd ComfyUI/custom_nodes
    git clone https://github.com/robin-collins/ComfyUI-TechsToolz.git
    
    1. Run the installation script:
    cd ComfyUI-TechsToolz
    python install.py
    
    1. Restart ComfyUI

    πŸ”§ Dependencies

    Required

    • piexif - EXIF metadata handling
    • numpy - Numerical operations
    • Pillow (PIL) - Image processing

    ComfyUI Dependencies

    • folder_paths - ComfyUI path utilities
    • comfy - ComfyUI core modules
    • nodes - ComfyUI node system

    All dependencies are automatically checked and reported at startup.

    πŸ“– Usage

    Model Name Extractor

    Extracts the filename from ComfyUI MODEL objects:

    Inputs:

    • model (MODEL) - Any ComfyUI model object

    Outputs:

    • model_name (STRING) - Extracted model filename

    Supported Model Types:

    • GGUF models
    • Standard checkpoints (.ckpt, .safetensors)
    • Various model formats with fallback handling

    Save Image w/Metadata

    Advanced image saving with embedded generation metadata:

    Inputs:

    • images (IMAGE) - Images to save
    • filename (STRING) - Filename pattern with placeholders
    • path (STRING) - Output directory path
    • extension - Format: PNG, JPEG, WebP
    • steps, cfg, sampler_name, scheduler - Generation parameters
    • positive, negative - Prompts
    • modelname - Model identifier
    • And more configuration options...

    Features:

    • Metadata Embedding: PNG metadata and EXIF data
    • Filename Placeholders: %time, %seed, %model, %counter, %date
    • Directory Management: Automatic path creation
    • Quality Control: Configurable compression settings

    βš™οΈ Configuration

    Node Configuration

    Configuration is stored in node_config.json:

    {
      "enabled_modules": ["image_nodes"],
      "disabled_modules": [],
      "package_info": {
        "name": "ComfyUI-TechsToolz",
        "version": "0.0.1",
        "supports_manager": true
      }
    }
    

    ComfyUI Manager Integration

    The package provides several API functions for ComfyUI Manager:

    • get_node_list() - List available nodes
    • get_package_info() - Package metadata
    • enable_node_module(module_name) - Enable a module
    • disable_node_module(module_name) - Disable a module
    • get_dependency_report() - Current dependency status

    πŸ—οΈ Architecture

    Modular Design

    ComfyUI-TechsToolz/
    β”œβ”€β”€ __init__.py                 # Main initialization with dependency checking
    β”œβ”€β”€ image_nodes.py              # Image processing nodes
    β”œβ”€β”€ node_list.json             # ComfyUI Manager node definitions
    β”œβ”€β”€ install.py                 # Installation script
    β”œβ”€β”€ node_config.json           # Configuration storage
    └── requirements.txt           # Python dependencies
    

    Dependency Checking System

    The DependencyChecker class:

    1. Scans all Python files using AST parsing
    2. Extracts import statements
    3. Validates package availability
    4. Generates detailed reports
    5. Provides installation suggestions

    Node Manager System

    The NodeManager class:

    1. Loads configuration from JSON
    2. Manages module enable/disable states
    3. Dynamically imports enabled modules
    4. Provides ComfyUI Manager API functions

    🚧 Development

    Adding New Modules

    1. Create your module file (e.g., utility_nodes.py)
    2. Export NODE_CLASSES and NODE_DISPLAY_NAMES dictionaries
    3. Add the module to available_modules in __init__.py
    4. Update node_list.json with new node definitions

    Example module structure:

    # utility_nodes.py
    class MyUtilityNode:
        # ... node implementation ...
    
    NODE_CLASSES = {
        "MyUtilityNode": MyUtilityNode,
    }
    
    NODE_DISPLAY_NAMES = {
        "MyUtilityNode": "πŸ–₯οΈπŸ› TechsToolz: My Utility Node",
    }
    

    Code Standards

    • Type Hints: Full type annotation required
    • Documentation: Comprehensive docstrings
    • Error Handling: Graceful failure handling
    • Logging: Structured logging throughout
    • Testing: Pytest for unit tests

    Tools

    # Linting and formatting
    ruff check --fix .
    ruff format .
    
    # Type checking
    mypy .
    
    # Testing
    pytest
    

    πŸ“Š Dependency Report Example

    ============================================================
    ComfyUI-TechsToolz Dependency Report
    ============================================================
    Python files scanned: 3
    Total unique dependencies: 8
    Available dependencies: 6
    Missing dependencies: 2
    
    βœ… Available Dependencies:
    ------------------------------
      βœ“ numpy
      βœ“ piexif
      βœ“ PIL
      βœ“ folder_paths
      βœ“ comfy
      βœ“ json
    
    ❌ Missing Dependencies:
    ------------------------------
      βœ— some_package
      βœ— another_package
    
    Installation suggestions:
    pip install some_package another_package
    ============================================================
    

    🀝 Contributing

    1. Fork the repository
    2. Create a feature branch
    3. Make your changes
    4. Add tests if applicable
    5. Update documentation
    6. Submit a pull request

    πŸ“„ License

    GNU General Public License v3.0

    πŸ™ Acknowledgments

    • ComfyUI community for the excellent platform
    • ComfyUI Manager for the integration framework
    • All contributors and users of this project

    πŸ“ž Support


    Built with ❀️ for the ComfyUI community