ComfyUI Node

TCL Parse (MEC)

Paste Nuke TCL in, get a subgraph JSON out

By Code2Collapse·Created 6 months ago·Updated a day ago· 52
TCL Parse (MEC)
    • subgraph_json
    • node_count
    tcl

    If you've ever copied nodes inside The Foundry's Nuke, you know the clipboard is TCL - a block of set n0 [make ...] commands that rebuilds the selected nodes. TclParseMEC is the node that takes that TCL, parses it, and hands you a JSON description of the subgraph it describes. It's one of the pair of clipboard-bridge nodes in the ComfyUI-CustomNodePacks pack (with TclSerializeMEC doing the reverse), and it exists for the people who live in both worlds: Nuke comps on one side, ComfyUI graphs on the other.

    Let me level with you: this is a niche-of-a-niche node. The pack's audience is VFX/compositing artists who want Nuke-grade tools inside ComfyUI, and the KB's own coverage notes that this whole "Nuke bridge" corner of the ecosystem gets almost no community discussion - the people who need it are compositors talking in VFX channels, not on r/StableDiffusion. If that's not you, this node isn't for you. If it is, this is the missing glue.

    How it works

    The node takes one multiline tcl input, runs it through the pack's TCL parser, and returns a subgraph description as JSON - a {"nodes": [...], "links": [...]} structure that mirrors how the pack represents graphs internally. Alongside the JSON it returns node_count (INT), the number of nodes the TCL described, which is a handy sanity check: if you pasted a four-node selection and get 2, the TCL wasn't what you thought.

    It's a pure text processor - no models, no VRAM, no file access. Paste, parse, done.

    Inputs and outputs

    • tcl (STRING, multiline) - the Nuke clipboard content, e.g. set n0 [make ...] lines.
    • subgraph_json (STRING) - the parsed graph, pretty-printed.
    • node_count (INT) - how many nodes were found.

    The natural pairing is the pack's TclSerializeMEC: parse TCL into JSON, edit or analyze the JSON, serialize it back to TCL. In a pipeline that treats ComfyUI as a node inside Nuke, that round-trip is how a comp's wiring becomes data you can reason about.

    Installing it

    Install the pack:

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

    then restart ComfyUI, or find "CustomNodePacks" in ComfyUI Manager. Confirm the [MEC] Loading MaskEditControl node pack … line in the console. No extra dependencies - this is pure string parsing, so skip the pack's requirements.txt unless the mask/VAE nodes are in your future.

    The honest caveat

    TCL from Nuke is only as parseable as Nuke's node API output is stable, and Nuke's clipboard TCL can include version and project specifics. If a paste fails or counts wrong, the JSON tells you exactly what it saw - but don't expect it to reconstruct every Nuke node type faithfully on day one. For simple node selections and standard ops, it does what it says, and knowing the node count up front saves you from feeding garbage downstream.

    CategoryMaskEditControl/Clipboard

    Inputs (1)

    NameTypeDefaultDescription
    tclSTRING

    Outputs (2)

    NameTypeDescription
    subgraph_jsonSTRING
    node_countINT