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-04-02 16:21:08 +08:00
2025-04-02 16:21:08 +08:00
2025-03-20 19:06:29 +08:00
2025-03-27 16:52:56 +08:00
2025-04-02 16:31:41 +08:00
2025-04-02 16:30:10 +08:00
2025-04-02 16:21:08 +08:00
2025-04-02 16:21:08 +08:00
2025-03-20 19:03:31 +08:00
2025-04-02 16:21:08 +08:00
2025-04-02 16:21:08 +08:00
2025-04-02 16:21:08 +08:00

ComfyUI_TENSOR_ART

Read this in other languages: English, 中文

This project implements a set of custom nodes for ComfyUI, integrating some of the API interfaces provided by TAMS.

Supported Features

  • Usage of AITools on the TensorArt website.
  • Automatic recognition of parameters required by AITools.
  • Nodes automatically render required parameters, with special rendering for images and combo types for ease of use.

Usage Steps

  1. Download the Project Locally

    • Clone the repository to the ./custom_nodes folder of your local ComfyUI installation:
      git clone git@github.com:Tensor-Art/ComfyUI_TENSOR_ART.git
      
    • The directory structure should look like this:
      ./ComfyUI/custom_nodes/ComfyUI_TENSOR_ART
      
    • Restart ComfyUI to load the custom nodes.
  2. Register an Application and Obtain an API Key

  3. Get the Current BaseUrl and API Key

    • image
  4. Create a Settings Node Go to the settings page, find TensorArt.Settings, and enter the BaseUrl and ApiKey obtained in Step 3. image

  5. Create an AITools Node

    • Create a TA AITools node. image
  6. Get the AIToolsID from TensorArt

    • image
  7. Enter the AIToolsID into the Node

    • The node will automatically fetch the AITools content and render it. image
  8. Create an ExecuteNode to Link Nodes image

  9. Execute and Wait for Results image

S
Description
No description provided
Readme
78 KiB
Languages
Python 50.9%
JavaScript 46%
CSS 3.1%