Skip to content

Commit 0b3adbc

Browse files
committed
remove sweetalert2; add ui logic;
1 parent 1344a2f commit 0b3adbc

File tree

8 files changed

+625
-359
lines changed

8 files changed

+625
-359
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,39 @@ When your workflow has multiple SaveImage nodes, easily distinguish different ou
8080
1. Download or clone this repository to the `custom_nodes` directory of ComfyUI
8181
2. Restart ComfyUI
8282

83+
### 🖥️ UI Features
84+
85+
This plugin adds convenient UI features to ComfyUI's interface:
86+
87+
#### 📝 Save Workflow as API
88+
89+
**How to use:**
90+
1. Right-click on the canvas (empty area)
91+
2. Select "🚀 Save Workflow as API"
92+
3. Enter a workflow name in the dialog
93+
4. Choose whether to overwrite if the file exists
94+
5. Click "Save"
95+
96+
The workflow will be saved to `user/default/api_workflows/` directory as a JSON file that can be used with the API.
97+
98+
#### 🏷️ Set Node Input Parameters
99+
100+
**How to use:**
101+
1. Select a single node in the workflow
102+
2. Right-click on the node
103+
3. Select "🚀 Set Node Input"
104+
4. Choose which field you want to parameterize from the list
105+
5. Enter a variable name for the parameter
106+
6. The node's title will be automatically updated with the parameter marker
107+
108+
**Example:**
109+
- Select a CLIPTextEncode node
110+
- Choose "text" field
111+
- Enter "prompt" as variable name
112+
- Node title will be updated to include `$prompt.text`
113+
114+
This feature makes it easy to mark nodes for parameter replacement without manually editing node titles.
115+
83116
### 🔌 API Parameters
84117

85118
```
@@ -151,7 +184,7 @@ curl -X POST "http://localhost:8188/oneapi/v1/execute" \
151184
### Supported forms for the workflow parameter
152185

153186
- 1. Pass workflow as a JSON object (original logic).
154-
- 2. Pass a local workflow filename (e.g. `1.json`), which will be loaded from `user/default/workflows/1.json`.
187+
- 2. Pass a local workflow filename (e.g. `1.json`), which will be loaded from `user/default/api_workflows/1.json`.
155188
- 3. Pass a workflow URL (e.g. `http://xxx/1.json`), which will be downloaded and parsed automatically.
156189

157190
How to distinguish:
@@ -165,7 +198,7 @@ How to distinguish:
165198
{"workflow": {"node1": {...}, ...}}
166199
167200
// 2. Pass local filename
168-
// 1.json corresponds to <ComfyUI root>/user/default/workflows/1.json
201+
// 1.json corresponds to <ComfyUI root>/user/default/api_workflows/1.json
169202
{"workflow": "1.json"}
170203
171204
// 3. Pass URL

README_CN.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,39 @@ curl -X POST "http://localhost:8188/oneapi/v1/execute" \
8080
1. 下载或克隆此仓库到ComfyUI的`custom_nodes`目录
8181
2. 重启ComfyUI
8282

83+
### 🖥️ 界面功能
84+
85+
此插件为 ComfyUI 界面添加了便捷的功能:
86+
87+
#### 📝 保存工作流为API
88+
89+
**使用方法:**
90+
1. 在画布空白处右键
91+
2. 选择"🚀 Save Workflow as API"
92+
3. 在对话框中输入工作流名称
93+
4. 选择是否覆盖已存在的文件
94+
5. 点击"保存"
95+
96+
工作流将保存到 `user/default/api_workflows/` 目录下,生成可用于API调用的JSON文件。
97+
98+
#### 🏷️ 设置节点输入参数
99+
100+
**使用方法:**
101+
1. 选择工作流中的单个节点
102+
2. 右键点击节点
103+
3. 选择"🚀 Set Node Input"
104+
4. 从列表中选择要参数化的字段
105+
5. 输入参数的变量名
106+
6. 节点标题将自动更新参数标记
107+
108+
**示例:**
109+
- 选择 CLIPTextEncode 节点
110+
- 选择"text"字段
111+
- 输入"prompt"作为变量名
112+
- 节点标题将更新为包含 `$prompt.text`
113+
114+
此功能让您无需手动编辑节点标题,即可轻松标记节点以进行参数替换。
115+
83116
### 🔌 API参数详解
84117

85118
```
@@ -151,7 +184,7 @@ curl -X POST "http://localhost:8188/oneapi/v1/execute" \
151184
### workflow 参数支持三种形式
152185

153186
- 1. 直接传递 workflow 的 JSON 对象(原有逻辑)。
154-
- 2. 传递本地 workflow 文件名(如 `1.json`),会自动从 `user/default/workflows/1.json` 读取。
187+
- 2. 传递本地 workflow 文件名(如 `1.json`),会自动从 `user/default/api_workflows/1.json` 读取。
155188
- 3. 传递 workflow 的 URL(如 `http://xxx/1.json`),会自动下载并解析。
156189

157190
区分方式:
@@ -165,7 +198,7 @@ curl -X POST "http://localhost:8188/oneapi/v1/execute" \
165198
{"workflow": {"node1": {...}, ...}}
166199
167200
// 2. 传本地文件名
168-
// 1.json 对应的是 <ComfyUI根目录>/user/default/workflows/1.json
201+
// 1.json 对应的是 <ComfyUI根目录>/user/default/api_workflows/1.json
169202
{"workflow": "1.json"}
170203
171204
// 3. 传 URL

0 commit comments

Comments
 (0)