Nodes/MKRShift_Nodes/Select Scene Range
ComfyUI Node

Select Scene Range

Pick one scene out of the detected list

By criskb·Created 7 months ago·Updated 5 months ago· 0
Select Scene Range
    • start_sec
    • end_sec
    • duration_sec
    • scene_json
    scene_ranges_json[]
    scene_index0

    This is a pure plumbing node, and it's honest about it. MKRSelectSceneRange takes the scene_ranges_json that MKRSceneCutDetector produces, you give it an index, and it hands back that one scene's start, end, and duration as clean numeric outputs. Nothing is generated, nothing is written - it exists to turn "scene list" into "the specific numbers I need for a trim or a crop."

    What it's for

    It's the socket between detection and action. Scene detection gives you a whole list; almost every real workflow then wants one of those scenes. Set scene_index to 2, and you get the third scene's timecode as actual float outputs you can wire into a trim node, a frame extractor, or anything else that wants seconds. The index clamps safely, so an out-of-range index returns the last scene instead of erroring out.

    Inputs and outputs

    Two inputs: scene_ranges_json (the scene list, typically straight from MKRSceneCutDetector) and scene_index (default 0). Four outputs:

    • start_sec and end_sec - the range in seconds.
    • duration_sec - end minus start, computed for you.
    • scene_json - the full selected scene object, in case a downstream node wants the whole record.

    Installing it

    Same pack install as everything else:

    cd ComfyUI/custom_nodes
    git clone https://github.com/criskb/MKRShift_Nodes
    

    restart ComfyUI, or search MKRShift_Nodes in ComfyUI Manager. No ffmpeg, no extra dependencies - pure JSON parsing and arithmetic.

    Common issues

    The one real gotcha: it's a dumb picker, so garbage in is garbage out. An empty scene_ranges_json (the default []) returns a zero-filled range {0.0, 0.0, 0.0} and a scene_json with index 0 - it won't tell you anything is wrong. If you're getting zeros everywhere, check that the detector actually ran and produced ranges, not that the selector is broken. Also remember the index is zero-based: scene 1 is scene_index = 0.

    CategoryMKRShift Nodes/Media/Timeline

    Inputs (2)

    NameTypeDefaultDescription
    scene_ranges_jsonSTRING[]
    scene_indexINT00–100000

    Outputs (4)

    NameTypeDescription
    start_secFLOAT
    end_secFLOAT
    duration_secFLOAT
    scene_jsonSTRING