Nodes/ComfyUI-CustomNodePacks/Shot Metadata Reader (MEC)
ComfyUI Node

Shot Metadata Reader (MEC)

Shot.json, read straight into the graph

By Code2Collapse·Created 6 months ago·Updated a day ago· 52
Shot Metadata Reader (MEC)
    • show
    • shot
    • task
    • frame_in
    • frame_out
    • fps
    • raw_json
    shot_json_path

    If you've ever come at ComfyUI from a VFX or post house, you know the drill: every shot has a descriptor file - show, shot number, task, frame range, fps - and every tool in the pipeline needs it. ShotMetadataNodeMEC is the node that reads that shot.json from disk and hands the fields to your graph as plain outputs. It's from the ComfyUI-CustomNodePacks pack (the big MEC suite), and it exists to make the "generation respects the shot's frame range and naming" part of a pipeline not-stupid.

    Be honest about the audience before you install: if you're a solo image generator, this node is useless to you. It earns its keep in batch pipelines where a per-shot descriptor already lives on disk and you want ComfyUI to just know the metadata instead of retyping it.

    How it works

    The node takes one input, shot_json_path (STRING), which should point at a JSON file with keys like show, shot, task, frame_in, frame_out, and fps. It loads the file, and pulls each field out - with a sensible fallback for anything missing: strings come back empty, frame_in/frame_out default to 0, and fps defaults to 24.0. That tolerance for missing fields is the author's stated design, and it means one template handles both well-formed and half-empty descriptors without exploding.

    If the path doesn't exist or the file isn't a JSON object, it raises - so check your path before queueing. There's no watching or polling; it reads once per run.

    The outputs

    Seven outputs, all mapped to the obvious keys:

    • show, shot, task (STRING) - the identifiers you'll paste into filenames and prompts.
    • frame_in, frame_out (INT) - the shot's frame range, for trimming or frame-accurate work.
    • fps (FLOAT) - frame rate, default 24.
    • raw_json (STRING) - the whole descriptor as pretty-printed JSON, for anything the dedicated outputs don't cover.

    The natural downstream pairing inside this same pack is TextTemplateMEC: feed show/shot/task into {a}/{b}/{c} placeholders and every prompt is already labeled with its shot. Combined with the pack's versioning nodes, you get shot-aware, versioned output files without string wrangling.

    Installing it

    This is one node in the ComfyUI-CustomNodePacks umbrella, so install the pack:

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

    then restart ComfyUI, or use ComfyUI Manager and search "CustomNodePacks". Confirm it loaded via the [MEC] Loading MaskEditControl node pack … console line. No extra dependencies for this node - it's pure JSON reading. (If you do install the pack's full requirements.txt, comment out the packages ComfyUI already ships, because a blind install can overwrite its torch/numpy.)

    The catch

    It reads a file path, not a URL and not a pasted blob - so in a shared-pipeline world you'll want the descriptor written to disk by whatever upstream step produces it. Given that one caveat, this is a quiet, dependable little node that only does one thing: makes your graph aware of the shot it's working on.

    CategoryMaskEditControl/Metadata

    Inputs (1)

    NameTypeDefaultDescription
    shot_json_pathSTRING

    Outputs (7)

    NameTypeDescription
    showSTRING
    shotSTRING
    taskSTRING
    frame_inINT
    frame_outINT
    fpsFLOAT
    raw_jsonSTRING