The toggle_states widget was being removed from the widgets array to
hide it visually, which also prevented ComfyUI from reading its value
when building the prompt for execution. The backend always received
the default "{}" so all images were treated as ON.
Fix: Keep the widget in the array but make it invisible using
converted-widget type, zero-height computeSize, and no-op draw.
Also make the backend more defensive - handle toggle_states arriving
via kwargs, and gracefully handle JSON parse errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>