Nodes/ComfyUI-CustomNodePacks/LUT Apply (.cube) (MEC)
ComfyUI Node

LUT Apply (.cube) (MEC)

Drop a film-grade LUT on any image in ComfyUI

By Code2Collapse·Created 6 months ago·Updated a day ago· 52
LUT Apply (.cube) (MEC)
  • image
  • image
  • info_json
lut_path
strength1.00

If you have a .cube LUT - from DaVinci Resolve, an emulation pack, a film-stock preset, whatever - this is the node that applies it inside ComfyUI. LUT Apply (.cube) (MEC) parses an Adobe-format .cube file (1D or 3D), remaps your image through it, and lets you blend the result back with a strength slider. That's the whole node, and it's the most direct way to get a consistent grade onto generated images.

It lives in the pack's VFX/color-science corner, alongside the color-space convert and exposure/grade nodes. The pitch: generate your base image, then grade it the way you'd grade real footage - with the same LUTs you already own.

How it works

On load, it parses the .cube text file: LUT_1D_SIZE or LUT_3D_SIZE, optional DOMAIN_MIN/DOMAIN_MAX, then the data rows (R fastest, per the format spec). A 1D LUT is a per-channel curve lookup with linear interpolation; a 3D LUT is a trilinear interpolation through the cube. If the file declares a size that doesn't match its row count, the node refuses and tells you - a decent sanity check against corrupt or mismatched LUT files.

The two required inputs:

  • image - what you're grading.
  • lut_path - a filesystem path to the .cube file, typed as a string. This is a text field, not a file-drop widget; the node raises FileNotFoundError if the path is wrong or the file isn't there.

The one knob: strength (0–1, default 1.0). At 1.0 the LUT is applied at full strength; at 0.5 it's a 50/50 blend of the graded and original image. This is more useful than it sounds - most film LUTs are too aggressive on synthetic images, and dropping strength to 0.4–0.7 gets you the look without the crushed blacks. Outputs: image (graded, clamped to [0,1]) and info_json (a small JSON with the LUT's dim, size, and the strength used - handy for logging a pass).

Notes and gotchas

  • Linear vs. display. The node grades whatever pixel space you feed it. If your image is in a linear working space and your LUT expects Rec.709 video (or vice versa), the result will look wrong - color-managed workflows should convert first with the pack's Color Space Convert node. For the average ComfyUI pipeline (sRGB/Rec.709 images from a VAE), it just works.
  • Full path, not relative to models. lut_path is resolved as an absolute path on disk. Keep your LUTs in one folder and wire the path from a string node or just type it.
  • 1D LUTs exist. Don't assume every .cube is a 3D cube; the node handles both, and info_json tells you which it found.

Install

Same pack install as the rest:

cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git

or ComfyUI Manager → search "CustomNodePacks", then restart and confirm the [MEC] Loaded ... console line. Zero extra Python dependencies - the LUT math is torch tensors. If you get FileNotFoundError, it's the path, not the node.

CategoryMaskEditControl/Color

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
lut_pathSTRING
strengthoptFLOAT1.000–1

Outputs (2)

NameTypeDescription
imageIMAGE
info_jsonSTRING