Files
IxMxAMAR-ComfyUI-Utility-Me…/workflows/53_workflow_state_machine.json
T
IxMxAMAR e8264f5abb templates: rebuild with corrected widget mapping
Investigation (Workflow trace of bundled ComfyUI frontend source) found three
real bugs in the previous regen:

1. widgets_values must be POSITIONAL — keep slots for widgets that have been
   converted to input sockets. In frontend >=1.16 widgets and sockets coexist
   (convertToInput is deprecated), so the widget object always stays in
   node.widgets and its slot in widgets_values is never removed. Skipping
   converted slots was the root cause of every shifted-value display
   (prompt text appearing in model field, NaN in numeric fields, etc).

2. ShowText was registered as 'ShowText' but pythongosssss's pack actually
   registers the class as 'ShowText|pysssss'. The bare name renders as a red
   missing-node box. Generator now emits the correct registered name.

3. Node height formula re-derived from the bundled litegraph computeSize():
   rows*20 + per-widget(20+4) + 8 trailing + 30 title + 6 footer, with
   multiline STRING widgets reserving ~100px each.

Bonus fix: validator now checks every COMBO widget value is in its choices
list (caught 100+ recipe-author typos), and the generator auto-substitutes
invalid values with the best match (case-insensitive, prefix, substring,
numeric coercion) instead of shipping invalid values.
2026-05-30 21:10:15 +05:30

568 lines
9.9 KiB
JSON

{
"last_node_id": 6,
"last_link_id": 4,
"nodes": [
{
"id": 1,
"type": "UtilMegaPack_Convenience",
"pos": [
60,
60
],
"size": [
320,
852
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "value",
"type": "*",
"link": null
},
{
"name": "value_0",
"type": "*",
"link": null
},
{
"name": "value_1",
"type": "*",
"link": null
},
{
"name": "value_2",
"type": "*",
"link": null
},
{
"name": "value_3",
"type": "*",
"link": null
},
{
"name": "value_4",
"type": "*",
"link": null
},
{
"name": "image_a",
"type": "IMAGE",
"link": null
},
{
"name": "image_b",
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "out_1",
"type": "*",
"links": [
1,
2
],
"slot_index": 0
},
{
"name": "out_2",
"type": "*",
"links": [],
"slot_index": 1
},
{
"name": "out_3",
"type": "*",
"links": [],
"slot_index": 2
},
{
"name": "out_4",
"type": "*",
"links": [],
"slot_index": 3
},
{
"name": "out_5",
"type": "*",
"links": [],
"slot_index": 4
}
],
"properties": {
"recipe_id": "counter",
"Node name for S&R": "UtilMegaPack_Convenience"
},
"widgets_values": [
"counter_inc",
"(use pack default)",
0,
true,
"global_run_count",
1,
false,
"DEBUG",
"[\"a\",\"b\",\"c\"]",
"default",
"{}",
"",
"",
"",
"",
"",
""
]
},
{
"id": 2,
"type": "UtilMegaPack_Convenience",
"pos": [
460,
60
],
"size": [
320,
852
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "value",
"type": "*",
"link": 1
},
{
"name": "value_0",
"type": "*",
"link": null
},
{
"name": "value_1",
"type": "*",
"link": null
},
{
"name": "value_2",
"type": "*",
"link": null
},
{
"name": "value_3",
"type": "*",
"link": null
},
{
"name": "value_4",
"type": "*",
"link": null
},
{
"name": "image_a",
"type": "IMAGE",
"link": null
},
{
"name": "image_b",
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "out_1",
"type": "*",
"links": [
3
],
"slot_index": 0
},
{
"name": "out_2",
"type": "*",
"links": [],
"slot_index": 1
},
{
"name": "out_3",
"type": "*",
"links": [],
"slot_index": 2
},
{
"name": "out_4",
"type": "*",
"links": [],
"slot_index": 3
},
{
"name": "out_5",
"type": "*",
"links": [],
"slot_index": 4
}
],
"properties": {
"recipe_id": "gate",
"Node name for S&R": "UtilMegaPack_Convenience"
},
"widgets_values": [
"gate_passthrough",
"(use pack default)",
0,
true,
"default",
1,
false,
"DEBUG",
"[\"a\",\"b\",\"c\"]",
"default",
"{}",
"",
"",
"",
"",
"",
""
]
},
{
"id": 3,
"type": "UtilMegaPack_Convenience",
"pos": [
860,
60
],
"size": [
320,
852
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "value",
"type": "*",
"link": null
},
{
"name": "value_0",
"type": "*",
"link": null
},
{
"name": "value_1",
"type": "*",
"link": null
},
{
"name": "value_2",
"type": "*",
"link": null
},
{
"name": "value_3",
"type": "*",
"link": null
},
{
"name": "value_4",
"type": "*",
"link": null
},
{
"name": "image_a",
"type": "IMAGE",
"link": null
},
{
"name": "image_b",
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "out_1",
"type": "*",
"links": [
4
],
"slot_index": 0
},
{
"name": "out_2",
"type": "*",
"links": [],
"slot_index": 1
},
{
"name": "out_3",
"type": "*",
"links": [],
"slot_index": 2
},
{
"name": "out_4",
"type": "*",
"links": [],
"slot_index": 3
},
{
"name": "out_5",
"type": "*",
"links": [],
"slot_index": 4
}
],
"properties": {
"recipe_id": "switch",
"Node name for S&R": "UtilMegaPack_Convenience"
},
"widgets_values": [
"switch_any",
"(use pack default)",
0,
true,
"default",
1,
false,
"DEBUG",
"[\"a\",\"b\",\"c\"]",
"default",
"{}",
"",
"Branch A output \u2014 counter was even",
"Branch B output \u2014 counter was odd",
"Branch C output \u2014 fallback",
"",
""
]
},
{
"id": 4,
"type": "ShowText|pysssss",
"pos": [
1260,
60
],
"size": [
320,
88
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "text",
"type": "STRING",
"link": 2,
"widget": {
"name": "text"
}
}
],
"outputs": [
{
"name": "text",
"type": "STRING",
"links": [],
"slot_index": 0
}
],
"properties": {
"recipe_id": "out_counter",
"Node name for S&R": "ShowText|pysssss"
},
"widgets_values": [
""
]
},
{
"id": 5,
"type": "ShowText|pysssss",
"pos": [
1260,
198
],
"size": [
320,
88
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "text",
"type": "STRING",
"link": 3,
"widget": {
"name": "text"
}
}
],
"outputs": [
{
"name": "text",
"type": "STRING",
"links": [],
"slot_index": 0
}
],
"properties": {
"recipe_id": "out_gate",
"Node name for S&R": "ShowText|pysssss"
},
"widgets_values": [
""
]
},
{
"id": 6,
"type": "ShowText|pysssss",
"pos": [
1260,
336
],
"size": [
320,
88
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "text",
"type": "STRING",
"link": 4,
"widget": {
"name": "text"
}
}
],
"outputs": [
{
"name": "text",
"type": "STRING",
"links": [],
"slot_index": 0
}
],
"properties": {
"recipe_id": "out_switch",
"Node name for S&R": "ShowText|pysssss"
},
"widgets_values": [
""
]
}
],
"links": [
[
1,
1,
0,
2,
0,
"*"
],
[
2,
1,
0,
4,
0,
"*"
],
[
3,
2,
0,
5,
0,
"*"
],
[
4,
3,
0,
6,
0,
"*"
]
],
"groups": [
{
"title": "Counter",
"bounding": [
35,
-1,
370,
938
],
"color": "#3F789E",
"font_size": 24,
"locked": false
},
{
"title": "Gate",
"bounding": [
435,
-1,
370,
938
],
"color": "#3F789E",
"font_size": 24,
"locked": false
},
{
"title": "Switch",
"bounding": [
835,
-1,
370,
938
],
"color": "#3F789E",
"font_size": 24,
"locked": false
},
{
"title": "Output",
"bounding": [
1235,
-1,
370,
450
],
"color": "#3F789E",
"font_size": 24,
"locked": false
}
],
"config": {},
"extra": {
"ds": {
"scale": 1.0,
"offset": [
0,
0
]
},
"description": "Demonstrate MegaPack's stateful primitives: counter_inc tracks run count, gate_passthrough conditionally forwards a value, and switch_any selects between branches.",
"title": "MegaPack \u2014 Workflow State Machine",
"tier": 2,
"pack": "ComfyUI-Utility-MegaPack"
},
"version": 0.4
}