π¨ LUT Generator
Turn a before/after pair into a real .cube LUT
- image_before
- image_after
- test_image
- preview_image
- tested_image
- lut_path
Here's a workflow that used to make people leave ComfyUI entirely: you have a reference image with a color grade you love, and you want your generations to carry that look. The naive move is img2img - which is a coin flip with your seed and your faces. The professional move is a 3D LUT: a lookup table that maps every input color to an output color, deterministically, in milliseconds, across an entire batch. The LUT Generator is the tool that builds that LUT for you, straight from a before/after pair of images.
That's the core idea, and it's genuinely good: give it the "before" and the "after" of the same scene, and it learns the color transformation between them, then exports it as a .cube file (or .3dl or .csp) that any node or any video editor can apply. It's the "capture the look of an existing grade" node the README promises. There's even a calibration folder (lut_files/images_calibration/) with sample images so you can test the pipeline.
How it works
Under the hood it samples sample_count pixels from the before image, finds where each of them landed in the after image, and fits a color mapping onto a 3D grid of size lut_size (9 to 65 per axis; bigger = more accurate, much more memory). Interpolation between grid points can be linear, nearest, or cubic, and there's a gaussian smoothing_factor plus an anchor_strength that pins the LUT near identity so neutral colors don't drift.
Two settings shape the workflow. processing_scale (default 0.5) downsamples the images before sampling, so you trade a little accuracy for speed on big files. And save_lut is the big one: set it false and the node computes the LUT in memory only - perfect for testing a grade without writing a file to disk. The test_image input plus the preview_image/tested_image outputs let you see exactly what your LUT will do before you commit to it.
Inputs and outputs
- Inputs:
image_before(required),image_afterorimage_after_path(whichever is easier), optionaltest_image, then the tuning knobs:lut_size,sample_count,processing_scale,interpolation_method,smoothing_factor,anchor_strength,save_lut,export_format,export_path,lut_name. - Outputs:
preview_image(IMAGE),tested_image(IMAGE), andlut_path(STRING) - the path of the exported LUT, ready to feed into the LUT Manager.
The most important outputs for a beginner are tested_image (is the grade right?) and lut_path (where did it land?).
The dependency catch
The README lists scipy and opencv-python as optional dependencies for this node - and by "optional" it means "you get much better results with them." Without scipy, the LUT generation falls back to a cKDTree nearest-neighbor method, which the code itself describes as reduced quality. If your exported LUT looks blocky or banded, this is why:
pip install scipy opencv-python
Troubleshooting
- Banded or rough LUT? Install scipy. The fallback path is noticeably worse.
- Slower than expected? Crank
sample_countdown or dropprocessing_scaleto 0.25 for a rough test run. - The grade shifts colors you wanted kept? Raise
anchor_strengthto hold neutral colors closer to identity.
Installing it
It's part of Orion4D_MetaNode:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Orion4D_MetaNode
Or via ComfyUI Manager (search "Orion4D_MetaNode") and restart. It appears under Orion4D_MetaNode β LUT. Add the optional scipy/opencv-python deps for full quality. Honest context: this is a young, single-developer pack with a modest footprint - and LUT tooling in ComfyUI is generally thin, so this node quietly fills a real gap for anyone doing serious color work.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image_before | IMAGE | β | |
| lut_size | INT | 179β65 | β |
| sample_count | INT | 50001000β50000 | β |
| processing_scale | FLOAT | 0.50.1β1 | β |
| interpolation_method | COMBO | linear | 3 options: linear, nearest, cubic |
| smoothing_factor | FLOAT | 0.10β1 | β |
| anchor_strength | FLOAT | 0.150β1 | β |
| save_lut | BOOLEAN | true | β |
| export_format | COMBO | cube | 3 options: cube, 3dl, csp |
| export_path | STRING | ./lut_files | β |
| lut_name | STRING | generated_lut | β |
| image_afteropt | IMAGE | β | |
| image_after_pathopt | STRING | β | |
| test_imageopt | IMAGE | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| preview_image | IMAGE | β |
| tested_image | IMAGE | β |
| lut_path | STRING | β |