Extensions/comfyui-inputswitch
ComfyUI Extension

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.

By bmgjet·Created 10 months ago·Updated 10 months ago· 1
bmgjet/comfyui-inputswitch
Nodes11
On cloudLocal install
Categorybmgjet, bmgjet/math
Stars1
Updated10 months ago
Readme

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

  1. Clone this repository into your ComfyUI custom_nodes directory:
git clone https://github.com/bmgjet/comfyui-inputswitch.git
  1. Launch ComfyUI. The node will automatically install dependencies on first load via __init__.py.

  2. 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.