This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Since this is a ComfyUI node collection without a traditional build system, most development is done directly with ComfyUI:
- Testing nodes: Load ComfyUI with the nodes and test in the UI
- Dependencies: Install via pip as needed (see StyleTransfer requirements.txt for optional deps)
- Main dependencies:
pip install tensorflow==2.11.0 tensorflow-hub==0.12.0 keras==2.11.0(for StyleTransfer features)
This is a collection of 13 independent ComfyUI custom nodes, each implementing different image processing and utility functions. Each node is self-contained in its own directory following the pattern:
ComfyUI_{NodeName}/
├── __init__.py # Node registration (NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS)
└── {implementation}.py # Main node class with INPUT_TYPES, RETURN_TYPES, FUNCTION
Node Registration: All nodes use the standard ComfyUI registration pattern via NODE_CLASS_MAPPINGS and NODE_DISPLAY_NAME_MAPPINGS in __init__.py.
Class Structure: Each node class implements:
INPUT_TYPES()classmethod defining required/optional inputsRETURN_TYPEStuple defining output typesFUNCTIONstring naming the main execution methodCATEGORYfor UI organization
Tensor Conventions: All nodes follow ComfyUI's tensor format [Batch, Height, Width, Channels] with float32 values in 0-1 range.
Image Processing: StyleTransfer (neural style transfer), FaceDetectionNode (OpenCV face detection), channel manipulation nodes Utilities: MemoryOptimizer (GPU/CPU management), RandomSeedGenerator (cross-library seed sync), ImageReloader (dynamic loading) Integration: HoudiniBridge (external 3D software integration) Specialized: NaiveBayesNode (statistical computations)
The FaceDetectionNode demonstrates advanced ComfyUI version compatibility - it detects ComfyUI v3 API availability and provides dual implementations, using modern schema definitions when available while falling back to legacy patterns for v1/v2.
Most nodes use core dependencies (torch, numpy, PIL). Optional dependencies include:
- opencv-cv2 (face detection)
- tensorflow + tensorflow-hub (style transfer)
- scikit-image (enhanced color processing)
- psutil, watchdog, requests (utility functions)
When creating new nodes:
- Follow the established directory structure and naming conventions
- Implement proper error handling and fallback strategies
- Ensure tensor format compatibility (BHWC, float32, 0-1 range)
- Add proper logging with configurable levels via environment variables
- Consider memory management for GPU/CPU operations
- Implement
IS_CHANGED()method for caching behavior
The collection demonstrates several integration approaches:
- Pipeline Integration: Standard ComfyUI workflow nodes
- External Tool Integration: Houdini bridge with HTTP API communication
- Web UI Extensions: Custom JavaScript for enhanced interactions (see reload_image_node)
- Cross-Platform: Graceful handling of CUDA availability and library dependencies