OmniShotCut ShortCount
How many shots did the detector find?
- count
OmniShotCutShortCount does exactly one thing: it takes the shots_json output of the OmniShotCut Detector and returns the number of shots in it as an INT. That's it. One input, one number. It's the kind of node that makes you say "sure, that's trivial" - and then you wire it into a workflow and realize it was exactly the missing piece.
Where it earns its keep: the Detector's JSON is a string, and the interesting number - "how many cuts did it find?" - is buried inside. Counting shots is the first thing you want to do whether you're about to split the video, decide the output is too fragmented to use, or just log what a long render actually contains. Wire count into a text node or a PrimitiveInt-style value and you can even gate a workflow on it: fewer than two shots means the scene was one continuous take, so skip the splitter entirely.
How it works
Under the hood it's a three-line parser. It reads the shots_json string (or a dict/list that an upstream node passed through), digs out the pred_ranges array from the Detector's output, and returns len(pred_ranges). If the JSON is malformed or empty, it returns 0 instead of blowing up the graph - which is a small mercy, because a broken JSON parser would otherwise take down your whole run with a red error box.
Inputs and outputs
- shots_json (
STRING, forced input) - theshots_jsonoutput ofOmniShotCutDetector. It's markedforceInput, meaning you can't type JSON into the widget; it has to be wired from the Detector. Good - you shouldn't be hand-typing that blob anyway. - count (
INT) - the number of detected shots, i.e. the length ofpred_ranges.
Install
Same pack, same steps as the rest of the nodes:
# in ComfyUI/custom_nodes
git clone https://github.com/GG-A9/ComfyUI_OmniShotCut
cd ComfyUI_OmniShotCut
pip install -r requirements.txt
No model, no checkpoint, no special setup - this node never touches the neural net. If the Loader and Detector work, this works. ComfyUI Manager (search "ComfyUI_OmniShotCut") installs the whole pack including this node.
Common issues
Honestly? There's not much to trip on. The one realistic failure is feeding it something that isn't the Detector's JSON - say a path string to a file, or an empty string from a node that never ran. You'll get 0 back, which is a silent "nothing here" rather than an error. If your count always reads zero, check that the Detector actually produced pred_ranges (the Detector's JSON should show a non-empty array) rather than an error string.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| shots_json | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| count | INT | — |