Nodes/radiance/CDL Export
ComfyUI Node

CDL Export

Write the grade to a file so it can leave ComfyUI

By FXTD-Studios·Created 8 months ago·Updated about 18 hours ago· 246
CDL Export
    • file_path
    ◄file_pathgrading/shot_01_output.cdl►
    ◄slope_r1.000►
    ◄slope_g1.000►
    ◄slope_b1.000►
    ◄offset_r0.0000►
    ◄offset_g0.0000►
    ◄offset_b0.0000►
    ◄power_r1.000►
    ◄power_g1.000►
    ◄power_b1.000►
    ◄saturation1.000►
    ◄cdl_data—►

    What it does

    Writes an ASC-compliant .cdl or .cc file from a set of CDL values. That's it - no pixels in, no pixels out, one file path string as its return value.

    It's the output end of the CDL trio. CDL Import reads a grade in, CDL applies one, and this writes one back out so it can go to Resolve, to a colourist, or into an archive. On its own it does nothing visible; in the loop, it's how a grade stops being trapped inside a ComfyUI workflow.

    Inputs

    file_path is the destination. The default is grading/shot_01_output.cdl, and the path rules are the mirror image of CDL Import's: a relative path is written under ComfyUI's output/ folder, and an absolute path is used as given. So the default writes to ComfyUI/output/grading/shot_01_output.cdl and creates what it needs.

    Then the ten CDL values as required widgets: slope_r/g/b (default 1), offset_r/g/b (default 0), power_r/g/b (default 1) and saturation (default 1). The ranges are tighter than the CDL node's on some fields - offset is ±1 and power runs 0.01 to 4 - because these are values being written to a spec-compliant file and the format has opinions.

    And the important one: the optional cdl_data STRING input. Wire it from CDL Import or from the cdl_info output of CDL and its values replace the sliders. That's how you round-trip a grade: read a file, apply it to an image, and export the result without ever transcribing a number by hand. Which is also how you avoid the classic failure of transcribing a number by hand.

    The output

    file_path - the path that was written, as a STRING. Wire it into a note, a log, or a downstream node that needs to know where the grade landed. It's the only output, which tells you what this node is: a side effect with a receipt.

    Why the round trip matters

    Because it's the only lossless way to move a grade between tools. A screenshot of your sliders is not a grade. Ten numbers in a chat message is almost a grade, and it's the version that gets a decimal wrong.

    Concretely, the workflow this enables: you match a look in ComfyUI, export the CDL, hand the file to the person finishing the shot in Resolve, and they apply it to the plate. Their Resolve sees exactly the correction you built. If they change it, they export it back and you import it. That's it - that's the whole collaboration model, and it's about forty years old, which is why it works.

    One caveat worth stating plainly, because it's the thing that breaks this in practice: a CDL is a fixed set of primitives, and it's applied blind to whatever encoding the receiving tool has. The tool's documentation for CDL says to feed it the encoding the CDL was authored in, and the same applies at both ends of the file. Export a grade authored on display-encoded sRGB, apply it to LogC footage, and you'll both be confused.

    Install

    ComfyUI Manager → search Radiance → install → restart → refresh the browser. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxtd-studios/radiance.git
    cd radiance
    python -m pip install -r requirements.txt
    

    Use ComfyUI's bundled python_embeded\python.exe for the pip step on Windows portable. No extra models or configs; the XML writing path uses defusedxml, which is already in the pack's requirements.

    Gotchas

    • Relative path confusion. Relative goes under output/. If you're trying to write into a project folder elsewhere on disk, use an absolute path.
    • Wired cdl_data, ignored sliders. By design, and it surprises people every time.
    • Exporting before you've made the grade portable. A CDL can't express a curve, a hue shift or a selective correction. If your look depends on those, the file is a summary of it, not the grade.
    • Nothing to wire file_path into. It's a string; a note node or a text preview is fine. You don't need to consume it for the write to happen.
    • Sliders outside the allowed range. The ranges here are the file format's, not a UI preference - a value from another node may not be representable.
    CategoryFXTD STUDIOS/Radiance/Color

    Inputs (12)

    NameTypeDefaultDescription
    file_pathSTRINGgrading/shot_01_output.cdlDestination .cdl path. A relative path is written under ComfyUI's output/ folder; absolute paths are used as given.
    slope_rFLOAT1.0000–4Red slope (gain) written to the file. 1.0 = unity.
    slope_gFLOAT1.0000–4Green slope (gain) written to the file. 1.0 = unity.
    slope_bFLOAT1.0000–4Blue slope (gain) written to the file. 1.0 = unity.
    offset_rFLOAT0.0000-1–1Red offset written to the file. 0.0 = no shift.
    offset_gFLOAT0.0000-1–1Green offset written to the file. 0.0 = no shift.
    offset_bFLOAT0.0000-1–1Blue offset written to the file. 0.0 = no shift.
    power_rFLOAT1.0000.01–4Red power (exponent) written to the file. 1.0 = unity.
    power_gFLOAT1.0000.01–4Green power (exponent) written to the file. 1.0 = unity.
    power_bFLOAT1.0000.01–4Blue power (exponent) written to the file. 1.0 = unity.
    saturationFLOAT1.0000–4Saturation written to the file's SaturationNode. 1.0 = unity.
    cdl_dataoptSTRINGJSON CDL data (from CDL Import or the cdl_info output of CDL Transform). When connected, its values replace the sliders above.

    Outputs (1)

    NameTypeDescription
    file_pathSTRING—