Nodes/MAGICMATCH/MagicMatch Build LUT (CUDA)
ComfyUI Node

MagicMatch Build LUT (CUDA)

Faster LUT builds when the GPU is the bottleneck

By lookuters22·Created 3 months ago·Updated 3 months ago· 0
MagicMatch Build LUT (CUDA)
  • source
  • reference
  • lut

MagicMatch Build LUT (CUDA) is the same job as MagicMatch Build LUT with one surgical change: the color_match ONNX runs on CUDA instead of the CPU. Same inputs (source, reference), same lut output you feed to a Preview node. Everything around the network - the JPEG normalize, the luminance/base-adjustment pass, the develop@1600 render - stays on the CPU in parity mode, so the LUT should match the CPU build closely.

The README is upfront that this is experimental and the primary test bed is H100/Linux, but the swap itself is boring and mechanical. That's a feature. If your source/reference pairs are big and the CPU build's ten-second wait is eating your queue, this is the low-risk way to shave the ONNX part.

Install is the one genuinely different step in the whole pack, because onnxruntime and onnxruntime-gpu are mutually exclusive on many builds:

# In ComfyUI's venv
pip uninstall -y onnxruntime
pip install -r MAGICMATCH/requirements-cuda.txt

Restart, and the nodes land under MAGICMATCH/CUDA (experimental). No CUDA available? They fall back to CPU execution providers automatically, so nothing breaks - you just don't get the speedup. Set MAGICMATCH_CUDA_NODES=0 before starting ComfyUI if you'd rather hide the whole CUDA trio.

Known caveats, straight from the maintainer: GPU face-detect scores can drift slightly from CPU f16 quirks, so the LUT hash may differ from the CPU golden - lut_max_abs_delta in the bench report is the number to watch. And for the apply side, you want the matching MagicMatch Preview CUDA LUT rather than the plain Preview. Batch size 1, as always.

CategoryMAGICMATCH/CUDA (experimental)

Inputs (2)

NameTypeDefaultDescription
sourceIMAGE
referenceIMAGE

Outputs (1)

NameTypeDescription
lutMAGICMATCH_LUT