ComfyUI-ReiyaNodes
A ComfyUI extension with 1 custom node.
Nodes (1)
ComfyUI-ReiyaNodes
Custom ComfyUI nodes for image stitching and variable management.
Installation
- Navigate to your ComfyUI
custom_nodesdirectory - Clone or copy this repository:
git clone https://github.com/FemReiyaDev/ComfyUI-ReiyaNodes.git - Restart ComfyUI
Features
- Rei-ImageStitch: Horizontally stitch multiple images together with dynamic input slots
- Rei-GetNode: Custom Get node with for improved workflow organization - Only variation right now being it renames the title to "Get-" instead of "Get_" when you add a variable
Nodes
Rei-ImageStitch
Stitches multiple images together horizontally (side by side).
Inputs
| Name | Type | Default | Description | |------|------|---------|-------------| | num_images | INT | 3 | Number of images to stitch (2-10) | | match_image_size | BOOLEAN | True | Resize images to match the height of the first image | | image_1 | IMAGE | - | First image (required) | | image_2 through image_10 | IMAGE | - | Additional images (optional, appears based on num_images) |
Outputs
| Name | Type | Description | |------|------|-------------| | IMAGE | IMAGE | The horizontally stitched image |
Behavior
- Dynamic Inputs: The node dynamically shows/hides image input slots based on the
num_imagesparameter - Batch Handling: Automatically matches batch sizes by repeating the last image from smaller batches
- Size Matching: When
match_image_sizeis True, all images are resized to match the height of the first image while preserving aspect ratio - Channel Matching: Automatically pads images with fewer channels to match the maximum number of channels (e.g., RGB to RGBA)
- Ordering: Images are arranged left-to-right: image_1 | image_2 | image_3 | ...
Technical Details
- Upscale Method: Uses Lanczos resampling for high-quality resizing
- Batch Processing: Supports batched images with different batch sizes
- Channel Support: Handles images with varying channel counts (1-4 channels)
- Device: Operates on the same device (CPU/GPU) as input images
Example Usage
- Set
num_imagesto the number of images you want to stitch (e.g., 3) - Connect your image outputs to
image_1,image_2, andimage_3 - Adjust
match_image_sizeto control whether images are resized to match heights - The node will output a single image with all input images stitched horizontally
Rei-GetNode
A modified Get node that improves workflow organization and visual clarity.
Features
- Auto-type Detection: Automatically detects and matches the type from corresponding SetNode
- Auto-coloring: Automatically colors the node based on data type (when KJNodes auto-coloring is enabled)
- Virtual Link Visualization: Option to show/hide virtual connections to the corresponding SetNode
- Navigation: Right-click menu option to jump to the corresponding SetNode
Usage
- Add a Rei-GetNode to your graph
- Select the variable name from the dropdown (must match a SetNode variable)
- The node will automatically configure its output type to match the SetNode
- Connect the right-side output to other nodes
Right-click Menu Options
- Go to setter: Centers the camera on the corresponding SetNode
- Show/Hide connections: Toggle visualization of virtual link to SetNode
Technical Details
- Node Type: Virtual node (does not impact the resulting prompt)
- Compatibility: Works with KJNodes SetNode
- Color Mapping: Supports all standard ComfyUI data type colors (MODEL, LATENT, IMAGE, etc.)
Technical Information
Dependencies
- PyTorch
- ComfyUI
- LiteGraph.js (for UI components)
File Structure
ComfyUI-ReiyaNodes/
├── __init__.py # Node registration and mappings
├── nodes.py # Python node implementations
├── pyproject.toml # Project metadata
├── web/
│ └── js/
│ ├── reiImageStitch.js # Dynamic input management for ReiImageStitch
│ └── reiGetNode.js # ReiGetNode UI implementation
Python API
ReiImageStitch Class
class ReiImageStitch:
MAX_IMAGES = 10
RETURN_TYPES = ("IMAGE",)
FUNCTION = "stitch"
CATEGORY = "ReiyaNodes/image"
Methods:
INPUT_TYPES(cls): Defines input parameters and dynamic image slotsstitch(self, num_images, match_image_size, image_1, **kwargs): Main stitching function
Processing Pipeline
- Image Collection: Gathers all provided images up to
num_images - Batch Normalization: Matches all images to the largest batch size
- Size Normalization: Optionally resizes images to match first image height
- Channel Normalization: Pads images to match maximum channel count
- Concatenation: Combines images horizontally along dimension 2
JavaScript Extensions
ReiImageStitch Extension
Manages dynamic input slot creation/removal based on num_images widget value.
Key Functions:
updateInputs(): Adds or removes image input slotsnodeCreated(): Initializes the node and sets up callbacksloadedGraphNode(): Restores correct input count when loading saved graphs
ReiGetNode Extension
Implements the custom Get node.
Key Features:
- Custom node class extending
LGraphNode - Virtual node that doesn't affect prompt generation
- Dynamic type matching with SetNode
- Visual connection rendering
License
MIT License
Credits
- ReiGetNode is based on KJNodes SetGet by diffus3