Nodes/ComfyUI-CustomNodePacks/TCL Serialize (MEC)
ComfyUI Node

TCL Serialize (MEC)

Turn subgraph JSON back into Nuke TCL

By Code2Collapse·Created 6 months ago·Updated a day ago· 52
TCL Serialize (MEC)
    • tcl
    subgraph_json{"nodes":[],"links":[]}

    TclSerializeMEC is the other half of the MEC pack's clipboard bridge: it takes a subgraph JSON description and serializes it into Nuke-style TCL. Where its sibling TclParseMEC turns pasted Nuke TCL into JSON, this node goes the other direction - JSON in, set n0 [make ...]-flavored TCL out. Same niche, same audience: people who move graphs between ComfyUI and Nuke rather than treating them as separate universes.

    Don't reach for this unless you have a reason to produce Nuke clipboard content from a ComfyUI graph. If you're just generating images, it's a curiosity. If you're building a pipeline where ComfyUI's output needs to land in an existing Nuke comp as pasteable TCL, it's the actual mechanism.

    How it works

    The input is subgraph_json, a multiline string describing the graph. The default is {"nodes":[],"links":[]} - the pack's internal empty-graph shape - and the node's serializer walks that structure and emits TCL that reconstructs the nodes and their connections. Feed it a full graph description and you get a TCL block back on the single tcl output, ready to paste into Nuke.

    It's pure text transformation: no models, no VRAM, nothing heavy. The interesting work is upstream - producing a well-formed subgraph JSON in the first place - which is exactly what TclParseMEC does when you round-trip an existing Nuke selection.

    Inputs and outputs

    • subgraph_json (STRING, multiline) - the graph description. Hand-written, produced by TclParseMEC, or built by whatever tooling you already have.
    • tcl (STRING) - the serialized Nuke TCL.

    Where it fits

    The round-trip pattern: parse a Nuke selection with TclParseMEC, inspect or transform the JSON, then serialize back with this node so the result is again pasteable into Nuke. In a world where ComfyUI is embedded inside Nuke as a node (the ComfyUI-for-Nuke approach the KB's post-processing doc covers), this is how you hand a finished graph back to the comp without re-typing it.

    Installing it

    Same pack, same install as everything else in it:

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

    restart ComfyUI (or use ComfyUI Manager → "CustomNodePacks"), and look for the [MEC] Loading MaskEditControl node pack … console line. No extra dependencies; skip the pack's requirements file unless the mask/VAE nodes are in your future.

    Bottom line

    TclParseMEC reads, this writes. Both are quiet text-processing nodes that only make sense if you actually live in the Nuke/ComfyUI overlap - and in that world, having both directions covered is what makes the bridge usable instead of a one-way trap.

    CategoryMaskEditControl/Clipboard

    Inputs (1)

    NameTypeDefaultDescription
    subgraph_jsonSTRING{"nodes":[],"links":[]}

    Outputs (1)

    NameTypeDescription
    tclSTRING