Nodes/Strata-T8/Strata JSON 数值 / Number
ComfyUI Node

Strata JSON 数值 / Number

One JSON field, one FLOAT, no hand-typing

By T8mars·Created 21 days ago·Updated 10 days ago· 20
Strata JSON 数值 / Number
    • number
    ◄json_text—►
    ◄pointer/shots/0/duration►

    The smallest node in the pack, and the one that closes the loop between "the model planned a shot" and "the sampler does something with that number". It takes JSON, a JSON Pointer, and outputs a single FLOAT.

    What it's for

    Every other extraction path gives you text. Samplers, video nodes, resize nodes and duration fields want numbers. StrataT8Number is the adapter: point it at /shots/0/duration on a validated storyboard and the model's plan becomes a value a node can actually consume. Convert a widget to an input on your sampler, wire this in, and now your shot length is decided by the language model instead of by you eyeballing it.

    It's the same family as the primitive value nodes the KB covers under the plumbing layer - a value broken out of a widget so it can travel on a wire - just with a JSON document as the source instead of a literal.

    Inputs and output

    • json_text - a force-input, so it must come from a node. Wire it from StrataT8Structured's json, from StrataT8Extract's value, or from Video Analyze's analysis_json.
    • pointer - default /shots/0/duration. Standard JSON Pointer: leading /, ~0/~1 escapes for literal ~ and /, array indices as plain decimals with no leading zeros. Point it at /shots/2/duration to grab the third shot.
    • number - the only output, a FLOAT.

    The validation, which is stricter than you'd guess

    The field has to be a number, and the pack means it:

    • Booleans are rejected even though Python thinks True == 1. "duration": true is an error, not a 1.0.
    • Strings are rejected. If your model wrote "duration": "4.5", you get "The selected JSON field must be a number" - fix it in the schema ("type": "number" on that field does the job, and the default storyboard schema already does) rather than in a downstream node.
    • Non-finite values and anything outside FLOAT range are rejected, so you can't smuggle a NaN into your sampler.
    • A missing path errors out with "JSON Pointer does not identify an existing field".

    Install

    Same as the rest of the pack - there's nothing special here, because this node has no dependencies at all:

    cd ComfyUI/custom_nodes
    git clone https://github.com/T8mars/Comfyui-Strata-T8.git
    python -m pip install -r Comfyui-Strata-T8/requirements.txt
    

    Or install Strata-T8 from ComfyUI-Manager (node ID strata-t8, publisher t8star) and restart. The engine, its Python/CUDA stack and the model data live in the separate portable runtime plus a Strata-data folder; the node pack downloads nothing and needs no profile of its own to run - though you'll want a Connection node and a saved profile upstream so something actually generates the JSON you're poking at.

    Where people get burned

    It doesn't loop. Ask for a field on an array and you get the error about descending into a scalar or a missing key - this node resolves one path to one number. Need the duration of every shot? Feed the object list through a downstream node per item, or run one number node per index.

    It's a cached value. ComfyUI caches by inputs, so the same JSON gives the same FLOAT with no re-execution. That's correct behaviour; just don't expect a refresh by re-queueing the same graph. Re-generating the JSON upstream (different prompt, different refresh) is what moves the number.

    Don't use it to round or scale. There's no arithmetic here. Multiply it downstream with whatever maths node you already have, then feed the sampler - the pack deliberately keeps this to one field, one number.

    CategoryStrata-T8

    Inputs (2)

    NameTypeDefaultDescription
    json_textSTRING—
    pointerSTRING/shots/0/duration—

    Outputs (1)

    NameTypeDescription
    numberFLOAT—