comfyui-inputswitch
A custom node collection for ComfyUI designed to handle advanced media operations including switching between image and video inputs, face swapping, color matching, and video frame interpolation.
Nodes (11)
Match one image's color grade to another
The roop port ComfyUI forgot (and when to still use it)
Turn a decimal into a whole number, floor or ceiling
One socket that eats an image or a video and caps its size
Add 2 to 10 numbers in one node instead of a chain
Divide without the divide-by-zero crash
The 2-to-10-input multiplier that respects your ints
Order matters, and this node is why
The tiny node that fixes tensors sitting on the wrong hardware
Smooth motion in ComfyUI video without re-rendering anything
Because diffusion models are allergic to odd numbers
ComfyUI InputSwitch Custom Node
Repository: https://github.com/bmgjet/comfyui-inputswitch
Overview
ComfyUI InputSwitch is a custom node collection for ComfyUI designed to handle advanced media operations including:
- Switching between image and video inputs.
- Face swapping using InsightFace.
- Color matching across images.
- Video frame interpolation via RIFE.
- Device management and tensor utilities.
This node set is intended to provide flexible preprocessing and transformation utilities in ComfyUI workflows.
Features
InputSwitch
- Automatically resizes images or videos to a specified maximum width and height.
- Supports both single images and multi-frame videos.
- Outputs resized media along with width, height, and frame count.
RIFE VFI
- Performs video frame interpolation.
- Supports multiple RIFE model versions (4.0 – 4.7).
- Adjustable multiplier, fast mode, ensemble, and scaling options.
FaceSwapNode
- Swap faces between a source image and target images.
- Utilizes InsightFace with pre-trained models.
- Optimized caching for repeated source images.
ColorMatch
- Matches the color profile of images to a reference image.
- Adjustable match strength.
- GPU-accelerated with PyTorch and Kornia.
MoveToDevice
- Utility node to move tensors to the active Torch device (CPU or CUDA).
RoundToEven
- Rounds integers to the nearest even number.
Requirements
- CUDA 12.8 SDK recommended (will fall back to CPU if unavailable).
- Python 3.12 recommended. 3.13 may work.
- Python packages (provided in
requirements.txt):
torch==2.9.1
opencv-python
kornia
Cython
packaging
onnxruntime-gpu>=1.23.2
meson-python
requests
Note: Special pre-built wheels for NumPy and InsightFace are installed automatically for Windows and Linux systems.
Installation
- Clone this repository into your ComfyUI
custom_nodesdirectory:
git clone https://github.com/bmgjet/comfyui-inputswitch.git
-
Launch ComfyUI. The node will automatically install dependencies on first load via
__init__.py. -
Restart ComfyUI once dependencies are installed.
Usage
- InputSwitch: Connect either an image or video input. Set mode to
"Image"or"Video"and specify maximum dimensions. - RIFE VFI: Input frames to interpolate additional frames for smooth video output.
- FaceSwapNode: Provide a source image and target images for face swapping.
- ColorMatch: Provide images and a reference image to match color grading.
- MoveToDevice: Move tensors to GPU/CPU dynamically.
- RoundToEven: Round numeric values to the nearest even integer.
Notes
- GPU acceleration is utilized when available.
- InsightFace and RIFE models are downloaded automatically if missing.
- All nodes include optional progress reporting for integration with ComfyUI pipelines.