ComfyUI Extension: NBA-ComfyUINode

Authored by enternalsaga

Created

Updated

0 stars

Version 1.2.1 - Dependency cleanup and archived LineSelector node A comprehensive collection of custom nodes for ComfyUI, providing advanced image processing, workflow control, and utility functions to enhance your AI image generation workflows.

Custom Nodes (0)

    README

    NBA-ComfyUINode

    Version 1.2.1 - Dependency cleanup and archived LineSelector node

    A comprehensive collection of custom nodes for ComfyUI, providing advanced image processing, workflow control, and utility functions to enhance your AI image generation workflows.

    šŸš€ Features

    • Flow Control Nodes: Advanced workflow management with gates, branches, and state management
    • Image Processing: Specialized nodes for image manipulation, resizing, and enhancement
    • File Management: Advanced image loading, saving, and organization tools
    • Utility Nodes: Text processing, list management, and data conversion utilities
    • Hugging Face Integration: Direct integration with HF models for captioning and control
    • JavaScript Extensions: Enhanced UI components for better user experience

    šŸ“¦ Installation

    Prerequisites

    • ComfyUI installed and running
    • Python 3.8 or higher
    • Required dependencies (see requirements.txt)

    Installation Steps

    1. Clone the repository:

      git clone https://github.com/enternalsaga/NBA-ComfyUINode.git
      cd NBA-ComfyUINode
      
    2. Copy to ComfyUI custom_nodes directory:

      cp -r NBA-ComfyUINode /path/to/ComfyUI/custom_nodes/
      
    3. Install dependencies:

      pip install -r requirements.txt
      
    4. Restart ComfyUI and the nodes will be automatically discovered and loaded.

    🧩 Available Nodes

    Flow Control Nodes

    • NBA Flow Any Gate: Conditional workflow execution based on any input
    • NBA Flow Branch: Multi-path workflow branching
    • NBA Flow Gate: Simple conditional execution
    • NBA Flow Multi Gate: Multiple condition evaluation
    • NBA Flow Sequence: Sequential workflow execution
    • NBA Flow Set State: State management for workflows
    • NBA Flow Any Checker: Input validation and checking

    Image Processing Nodes

    • NBA Match Size: Resize images to match dimensions
    • NBA Remove Banding Artifacts: Eliminate banding in generated images
    • NBA Resize By Pixel Ratio: Proportional image resizing
    • NBA Scale To Pixels: Precise pixel-based scaling
    • NBA Colorize Depthmap: Convert depth maps to colored images
    • NBA Kontext Diff Merge: Advanced image merging with context

    File Management Nodes

    • NBA Image Output: Advanced image saving with metadata
    • NBA Image Output Adv: Enhanced image output with additional features
    • NBA Load Image: Flexible image loading from various sources
    • NBA Load Image Input: Advanced image input with folder support
    • NBA Load Image Input Advanced: Enhanced image loading with subfolder support
    • NBA Load Image From Folder: Batch image loading from directories
    • NBA Save Image To Path: Direct image saving to specified paths
    • NBA Extract File Names: Extract and process filenames
    • NBA List Image Files: List and process image files
    • NBA List Text Files: List and process text files

    Utility Nodes

    • NBA Any To Any: Universal data type conversion
    • NBA Text Split By Delimiter: Split/truncate by characters, words, or delimiters with forward/backward slicing, start position, and smart numbering removal
    • NBA List Info: Information extraction from lists
    • NBA Image Filename Info: Extract metadata from image filenames
    • NBA Process Tags: Tag processing and management
    • NBA Save Text File To Path: Text file saving utilities
    • NBA Sym Link: Symbolic link creation utilities

    Hugging Face Integration

    • NBA Hf Zen Ctrl: Zen control model integration
    • NBA Hf Joy Caption: Joy captioning model
    • NBA Hf Ic Light V2: IC Light V2 model integration
    • NBA Hf Image2Body: Image to body conversion

    Advanced Nodes

    • NBA Kontext Inpainting Conditioning: Advanced inpainting with context
    • NBA Multi Slider: Multi-value slider interface
    • NBA Float Ramp: Float value ramping utilities
    • NBA Dual Condition: Dual condition evaluation
    • NBA OLM Dragcrop: Drag and crop functionality

    šŸŽÆ Usage Examples

    Basic Image Processing Workflow

    # Load image and resize
    image = LoadImageInput(image_path="input.jpg")
    resized = MatchSize(image=image, target_size=(512, 512))
    
    # Process and save
    processed = RemoveBandingArtifacts(image=resized)
    output = ImageOutput(
        image=processed,
        output_path="./output/",
        save_prefix="processed",
        file_type="png"
    )
    

    Advanced Flow Control

    # Conditional processing based on image size
    checker = FlowAnyChecker(condition="image_width > 512")
    gate = FlowAnyGate(
        condition=checker,
        true_branch=ScaleToPixels(image=image, target_pixels=262144),
        false_branch=image
    )
    

    Batch Processing with Organization

    # Load multiple images from folder
    images = LoadImageFromFolder(
        folder_path="./input/",
        file_types=["jpg", "png"]
    )
    
    # Process each image with organized output
    for image in images:
        processed = RemoveBandingArtifacts(image=image)
        ImageOutput(
            image=processed,
            output_path="./output/%date:yyyy-MM-dd%/",
            save_prefix="batch_%date:HHmmss%",
            prefix_sub="processed",
            number_padding=4
        )
    

    šŸ“ Project Structure

    NBA-ComfyUINode/
    ā”œā”€ā”€ __init__.py              # Auto-discovery and registration
    ā”œā”€ā”€ nodes/                   # All node implementations
    │   ā”œā”€ā”€ Flow*.py            # Flow control nodes
    │   ā”œā”€ā”€ Image*.py           # Image processing nodes
    │   ā”œā”€ā”€ Load*.py            # Image loading nodes
    │   ā”œā”€ā”€ Hf*.py              # Hugging Face integration
    │   └── *.py                # Utility and other nodes
    ā”œā”€ā”€ js/                     # JavaScript UI extensions
    │   ā”œā”€ā”€ *.js               # UI enhancement scripts
    │   └── *.js.backup        # Backup files
    ā”œā”€ā”€ examples/               # Usage examples and tutorials
    │   └── usage_examples.py  # Comprehensive examples
    ā”œā”€ā”€ web/                    # Web assets
    ā”œā”€ā”€ lists/                  # Configuration lists
    ā”œā”€ā”€ requirements.txt        # Python dependencies
    └── README.md              # This file
    

    šŸ”§ Configuration

    Node Auto-Discovery

    The project uses automatic node discovery. Simply place your node classes in the nodes/ directory with the required attributes:

    • INPUT_TYPES: Define input parameters
    • RETURN_TYPES: Define output types
    • FUNCTION: Main processing function
    • CATEGORY: Node category for organization

    JavaScript Extensions

    Custom UI components are automatically loaded from the js/ directory. These enhance the user experience with:

    • Dynamic widgets
    • Advanced input controls
    • Drag-and-drop functionality
    • Real-time preview updates

    šŸ¤ Contributing

    1. Fork the repository
    2. Create a feature branch (git checkout -b feature/amazing-feature)
    3. Add your nodes to the nodes/ directory
    4. Add any JavaScript extensions to the js/ directory
    5. Update documentation and examples
    6. Commit your changes (git commit -m 'Add amazing feature')
    7. Push to the branch (git push origin feature/amazing-feature)
    8. Open a Pull Request

    šŸ“ License

    This project is licensed under the MIT License - see the LICENSE file for details.

    šŸ™ Acknowledgments

    • ComfyUI community for the excellent framework
    • Hugging Face for model integrations
    • All contributors who have helped improve these nodes

    šŸ“ž Support

    • Issues: Report bugs and request features on GitHub
    • Discussions: Join community discussions for help and ideas
    • Documentation: Check the examples folder for detailed usage examples

    Happy Node Building! šŸŽØ