Files
Tensor-Art-ComfyUI_TENSOR_ART/js
wangzhuoran 7b99ea976c refactor: simplify TA_AIToolsNode by dynamically generating field widgets
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
2026-03-25 16:42:41 +08:00
..
2025-03-20 19:03:31 +08:00
2025-03-24 17:12:26 +08:00
2025-03-24 17:12:26 +08:00
2025-03-20 19:03:31 +08:00
2025-03-24 17:12:26 +08:00