LUT Bake Inject
Grade once, get your photo and a .cube file out the other side
- photo
- identity_lattice
- batched_image
- bake_meta
Here's the workflow problem Darkroom solves: you build a beautiful grade in ComfyUI, and then you want it as a 3D LUT for DaVinci or Premiere. The old way was running your grading chain twice - once on your photo, once on a neutral lattice - and praying the settings matched. LUT Bake Inject kills that whole dance: it pairs your photo with the identity lattice into a single 2-image batch, so your grading chain processes both with identical settings in one run. Grade once, get both outputs out the back.
It's part of ComfyUI-Darkroom's LUT pipeline, and it's the node that makes the pack's "grade your photo and export a LUT in one pass" workflow possible. Inject is always the first node in the bake chain; LUT Bake Extract is the last.
How it works
You feed it your photo, an identity lattice (from the pack's LUT Identity Generator), and a lut_size. It pads the photo and the lattice to a shared canvas - edge-replicate padding, so nothing fake gets invented at the borders - and stacks them as a batch of 2. Because every Darkroom color node iterates the batch dimension, the same transform lands on both images with zero duplicated settings. Along the way it validates your setup: if lut_size doesn't match the lattice's dimensions, or the channels don't line up, it raises a clear error instead of silently producing garbage.
The inputs that matter
- photo - your real image. It gets graded by the chain and comes out the other side as the graded photo.
- identity_lattice - from LUT Identity Generator. It's the "blank" that records the transform so it can become a LUT.
- lut_size - must match the LUT Identity Generator's size (default 33, range 2–129). It's passed through the chain for Extract to crop correctly.
Outputs are batched_image (the 2-image batch, wired into your grading chain) and bake_meta (the metadata Extract needs). A typical chain looks like:
Load Image ──► photo ──────┐
├─► LUT Bake Inject ─► [grading chain] ─► LUT Bake Extract ─► graded_photo ──► Preview
LUT Identity ─► lattice ───┤ └─► graded_lattice ──► LUT Export
Install and gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/jeremieLouvaert/ComfyUI-Darkroom
pip install -r ComfyUI-Darkroom/requirements.txt
Or search "Darkroom" in ComfyUI Manager and restart. It's under AKURATE/Darkroom/Pipeline.
The one rule that actually matters: only per-pixel color nodes go in the chain. A LUT is a per-pixel lookup - it has no idea about neighboring pixels. Film Stock, Tone Curve, Lift Gamma Gain, HSL, Hue vs X, Color Warper, Cross Process - all fine. Film Grain, Halation, Adjacency Acutance, lens effects, sharpening, anything spatial - not allowed; they'll corrupt the lattice and your LUT comes out mangled. The README keeps the exact allowed/not-allowed list. Apply spatial effects to graded_photo after Extract instead.
Also watch for any node that collapses a batch - if Extract throws "expected batch of 2, got 1", something in your chain ate the second image, and that's a wiring bug, not a pack bug. The example workflow ships in the repo (workflows/lut_bake_and_apply.json) if you want a known-good starting point.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| photo | IMAGE | Your real photo. Will be graded by the chain and come out the other side via LUT Bake Extract. | |
| identity_lattice | IMAGE | From LUT Identity Generator. Will be batched alongside the photo so the grading chain transforms both identically. | |
| lut_size | INT | 332–129 | Must match the LUT Identity Generator size. Passed through to LUT Bake Extract for cropping. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| batched_image | IMAGE | — |
| bake_meta | LUT_BAKE_META | — |