Nodes/MKRShift_Nodes/Addon Stats
ComfyUI Node

Addon Stats

A quick vitals check on your addon payload before you ship it

By criskb·Created 7 months ago·Updated 5 months ago· 0
Addon Stats
    • stats_json
    • stats_lines
    • summary_json
    payload_json{}
    watch_path
    endpoint_plan_json{}

    The MKRShift addon lane runs on JSON plans and payloads, and the most common failure isn't the network - it's the data. A payload that's too big, missing its schema, or pointed at a watch folder that doesn't exist yet will produce a whole chain of confusing downstream errors. Addon Stats is the node that catches those before they cost you a render. Feed it any payload JSON and it hands back a compact health report: byte size, key count, declared schema, plus a quick look at a watch folder if you give it one.

    It's from the "debug" corner of MKRShift Nodes, Cris K B's production pack, and it does zero network calls - this is local diagnostics, the node you drop inline to sanity-check what's about to leave the graph.

    How it works

    Give it payload_json and it measures the thing directly: payload_bytes (how big the string is on the wire), payload_key_count (how many top-level keys it has), and payload_schema (the schema field, if the payload declares one - the MKRShift plans all carry mkrshift_* schema names). That last one is quietly useful: a payload with the wrong schema name is usually a sign you wired the wrong plan into the wrong runtime node.

    The two optional inputs extend it in opposite directions. watch_path points at a folder on disk and stats report whether it exists, how many files it holds, and the latest modification time - handy when you're handoff-ing via a watched folder (there's a whole Watch Folder transport plan in this pack) and want to confirm the host actually wrote its output before you read it. endpoint_plan_json pulls the endpoint's base_url and protocol out of a plan and echoes them into the stats, so you can confirm the payload is heading for the endpoint you think it is.

    Outputs

    • stats_json - the full stats object as formatted JSON
    • stats_lines - a plain-text, human-readable version (bytes, key count, schema, watch state, endpoint protocol)
    • summary_json - the compact recap with a warning count

    Installation

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

    Restart ComfyUI, or search "MKRShift Nodes" in ComfyUI Manager. No pip dependencies - it's file stats and JSON counting, nothing exotic.

    Common issues

    The biggest misreading is treating watch_exists: false as an error. It's a report, not a failure - if your host creates the folder on first write, a false is expected until then. The actual red flags are a payload byte count far larger than you expected (you're about to POST something heavy; the endpoint plan's timeout is your only guard), or a missing schema when you know you built a plan. And the honest limitation: this node looks at the payload, it doesn't validate it against anything. For a full diff of two versions - say, what the host sent versus what you think you sent - the same debug module has MKRJSONDiff, which walks two JSON trees and lists every added, removed, and changed path. Stats tells you the payload is sane; Diff tells you exactly what changed.

    CategoryMKRShift Nodes/Addons/Network

    Inputs (3)

    NameTypeDefaultDescription
    payload_jsonSTRING{}
    watch_pathoptSTRING
    endpoint_plan_jsonoptSTRING{}

    Outputs (3)

    NameTypeDescription
    stats_jsonSTRING
    stats_linesSTRING
    summary_jsonSTRING