Problem: The previous implementation defined 99 optional inputs in Python
and tried to hide/show them in frontend, which didn't work reliably on
ComfyUI Windows version - fields like fieldValue_99 remained visible.
Solution: Complete refactor to dynamically generate widgets:
Backend (TA_AITools.py):
- Remove INPUT_LIM and 99 pre-defined optional inputs
- Add single 'fieldData' STRING field to store serialized field values
- process() parses JSON from fieldData to build fieldInputs
Frontend (ta_aitools.js):
- Remove complex widget hiding logic
- When aiToolsId changes, fetch workflow fields from API
- Dynamically create widgets using node.addWidget()
- Serialize field values to fieldData on each change
- Clean up old widgets when switching workflows
Benefits:
- No more hidden widgets taking up space
- Works reliably on both native and Windows versions
- Cleaner code (304 lines removed, 192 added)
- Node size automatically adjusts to actual field count