7b99ea976c54eb343e98e313aff548b3b51b32d7
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
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
-
Download the Project Locally
- Clone the repository to the
./custom_nodesfolder 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.
- Clone the repository to the
-
Register an Application and Obtain an API Key
- Go to the application page to create an application and generate a key.
- Go to the application page to create an application and generate a key.
-
Get the Current BaseUrl and API Key
-
Create a Settings Node Go to the settings page, find TensorArt.Settings, and enter the BaseUrl and ApiKey obtained in Step 3.
-
Create an AITools Node
-
Get the AIToolsID from TensorArt
-
Enter the AIToolsID into the Node
Languages
Python
50.9%
JavaScript
46%
CSS
3.1%