Refactor README for improved formatting and content
Updated README to fix formatting issues and enhance clarity.
This commit is contained in:
@@ -3,32 +3,11 @@
|
||||
# ComfyUI General API Node Pack
|
||||
*Created by FeiMao-326*
|
||||
|
||||
<<<<<<< HEAD
|
||||
[**English**](#english) | [**中文**](#chinese)
|
||||
=======
|
||||
[**English**](README.md) | [**中文说明**](README_CN.md)
|
||||
>>>>>>> e9ec5ee (feat: Release v1.0.6 with 6 new advanced text nodes and Nodes 2.0 (Vue UI) optimization)
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
<<<<<<< HEAD
|
||||
<a name="english"></a>
|
||||
|
||||
## 🇬🇧 English
|
||||
|
||||
A suite of powerful and versatile utility nodes for ComfyUI, designed to streamline complex workflows involving Large Language Models and text manipulation. This pack is created by FeiMao-326.
|
||||
|
||||
### ✨ Nodes Included
|
||||
|
||||
This pack contains the following nodes, all available under the **`FeiMao-326`** category:
|
||||
|
||||
1. **General API Node**: A robust Vision LLM API node.
|
||||
- Supports multi-image inputs.
|
||||
- Features automatic GPU cleanup for local Ollama.
|
||||
- **[NEW]** Native Google Gemini API support (Chat & Image Generation).
|
||||
- Includes advanced seed control (`fixed`, `increment`, `randomize`).
|
||||
=======
|
||||
|
||||
## 🇬🇧 English
|
||||
|
||||
@@ -44,7 +23,6 @@ This pack contains the following nodes available under the **`FeiMao-326`** cate
|
||||
- **Double VRAM Cleanup**: Specialized for local Ollama. When `cleanup_local_gpu` is enabled, the node triggers a REST API `keep_alive: 0` and a CLI fallback to physically purge model data from VRAM immediately after execution.
|
||||
- **Advanced Multimodal Vision**: Supports concurrent parsing and comparison of 2 or more images.
|
||||
- **Seed Logic**: Includes industrial-grade seed control (`fixed`, `increment`, `randomize`).
|
||||
>>>>>>> e9ec5ee (feat: Release v1.0.6 with 6 new advanced text nodes and Nodes 2.0 (Vue UI) optimization)
|
||||
2. **Text Batch Replace**: A powerful text utility for performing up to 8 find-and-replace operations in a single node.
|
||||
3. **JSON Parser**: Deconstructs complex, nested JSON payloads into multiple separate text outputs with a built-in labeled preview. It deeply searches for user-defined keys, perfect for handling structured prompts.
|
||||
4. **Show Text**: Displays input text directly on the node UI.
|
||||
@@ -52,15 +30,12 @@ This pack contains the following nodes available under the **`FeiMao-326`** cate
|
||||
6. **Text Split By Delimiter**: Splits a text string into a list based on a delimiter.
|
||||
7. **Get List Element**: Retrieves a specific element from a list by index.
|
||||
8. **Text Iterator**: Splits text by delimiter and outputs it as a batch, triggering batch execution for downstream nodes.
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
9. **Markdown Extractor**: Intelligent regex-based extraction of ` ```json ` or code blocks from LLM responses.
|
||||
10. **Text Template (Dynamic)**: **[Recommended]** Dynamic slot template. `{var}` automatically generates input ports. Supports all languages.
|
||||
11. **Prompt Cleaner**: Normalizes prompts by removing duplicates, extra commas, and empty brackets.
|
||||
12. **Text Logic Switch**: Flow control (If-Else) based on content matching (Contains, Regex, Exact, etc.).
|
||||
13. **Regex Extractor Pro**: Advanced pattern capture with capture group support.
|
||||
14. **Dictionary Translator**: Bulk mapping/replacement via JSON or Key=Value dictionaries.
|
||||
>>>>>>> e9ec5ee (feat: Release v1.0.6 with 6 new advanced text nodes and Nodes 2.0 (Vue UI) optimization)
|
||||
|
||||
### 🔧 Installation
|
||||
|
||||
@@ -102,182 +77,6 @@ This pack contains the following nodes available under the **`FeiMao-326`** cate
|
||||
- **🖼️ Single Image Description**: Connect an image to `image_1`.
|
||||
- **🎬 Dual Image for Video Transitions**: Connect a start frame to `image_1` and an end frame to `image_2`.
|
||||
- **📸 Multi-Image Analysis**: You can connect multiple images (`image_1`, `image_2`, `image_3...etc`) for complex analysis tasks.
|
||||
<<<<<<< HEAD
|
||||
4. **API Connection Examples**:
|
||||
- **Local Ollama**:
|
||||
- `api_baseurl`: `http://127.0.0.1:11434/v1`
|
||||
- `api_key`: `ollama`
|
||||
- `model`: `gemma3:4b` (or another vision-capable model)
|
||||
- `cleanup_local_gpu`: Keep it checked (True).
|
||||
- **External API (e.g., OpenAI)**:
|
||||
- `api_key`: Your OpenAI API key (`sk-xxxxxxxx`)
|
||||
- `model`: `gpt-4o`
|
||||
- **Google Gemini (Native)**:
|
||||
- `api_baseurl`: `https://generativelanguage.googleapis.com/v1beta/`
|
||||
- `api_key`: Your Google AI Studio Key
|
||||
- `model`: `gemini-1.5-pro` (Chat) or `imagen-3.0-generate-001` (Image)
|
||||
Below is a complete example workflow for the dual image transition task:
|
||||
|
||||

|
||||
|
||||
#### Text Batch Replace
|
||||
- Input any text into the `text` field.
|
||||
- Fill in the `find_x` and `replace_x` fields to perform sequential replacements.
|
||||

|
||||
|
||||
#### JSON Parser
|
||||
- Paste your complex JSON into the `json_payload` field.
|
||||
- In the `keys_to_extract` field, enter the keys you want to extract, separated by commas (e.g., `shot, subject, audio`).
|
||||
- The node will find these keys anywhere in the JSON, output their combined values to the corresponding `output_x` ports, and show a preview inside the node.
|
||||

|
||||
|
||||
#### Show Text
|
||||
- Connect any string output to the `text` input.
|
||||
- The text will be displayed on the node itself.
|
||||
|
||||
#### Simple Text
|
||||
- Enter your text in the text box.
|
||||
- Connect the `text` output to any node requiring string input.
|
||||
|
||||
#### Text Split By Delimiter
|
||||
- Input text and a delimiter (default is comma).
|
||||
- Outputs a `LIST` type that can be used with `Get List Element`.
|
||||

|
||||
|
||||
#### Get List Element
|
||||
- Connect a `LIST` input.
|
||||
- Specify the index (0-based) to retrieve a specific string.
|
||||
|
||||
#### Text Iterator
|
||||
- Input text and a delimiter.
|
||||
- Outputs each split item as a separate batch item.
|
||||
- Useful for iterating over a list of prompts or parameters.
|
||||

|
||||
|
||||
### 📜 License
|
||||
|
||||
This project is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) and [NOTICE](NOTICE) files for details.
|
||||
|
||||
---
|
||||
<a name="chinese"></a>
|
||||
|
||||
## 🇨🇳 中文
|
||||
|
||||
一套为 ComfyUI 设计的、功能强大且用途广泛的实用节点包,旨在简化涉及大语言模型和文本处理的复杂工作流。本节点包由 FeiMao-326 创作。
|
||||
|
||||
### ✨ 包含的节点
|
||||
|
||||
本节点包包含以下节点,您都可以在 **`FeiMao-326`** 分类下找到它们:
|
||||
|
||||
1. **General API Node**: 一个强大的视觉LLM API节点。
|
||||
- 支持多图像输入。
|
||||
- 为本地 Ollama 提供自动 GPU 清理功能。
|
||||
- **[新增]** 原生 Google Gemini API 支持 (对话 & 绘图)。
|
||||
- 包含高级种子控制(`固定`, `递增`, `随机` 等)。
|
||||
2. **Text Batch Replace**: 一个强大的文本工具,可在单个节点中执行多达8次的查找与替换操作。
|
||||
3. **JSON Parser**: 可将复杂的、深度嵌套的JSON结构,解析为多个独立的文本输出,并自带带标签的预览功能。它会深度搜索用户定义的关键字,非常适合处理结构化提示词。
|
||||
4. **Show Text**: 直接在节点界面上显示输入的文本。
|
||||
5. **Simple Text**: 一个简单的文本输入节点,用于将字符串传递给其他节点。
|
||||
6. **Text Split By Delimiter**: 根据分隔符将文本字符串分割为列表。
|
||||
7. **Get List Element**: 通过索引从列表中检索特定元素。
|
||||
8. **Text Iterator**: 根据分隔符分割文本并作为批次输出,触发下游节点的批次执行。
|
||||
|
||||
### 🔧 安装方法
|
||||
|
||||
1. **克隆仓库**
|
||||
- 打开您的终端。
|
||||
- 导航到您的 ComfyUI `custom_nodes` 文件夹:
|
||||
```bash
|
||||
cd path/to/your/ComfyUI/custom_nodes/
|
||||
```
|
||||
- 克隆此仓库:
|
||||
```bash
|
||||
git clone https://github.com/FeiMao-326/Comfyui-General-API-Node.git
|
||||
```
|
||||
|
||||
2. **安装依赖**
|
||||
- 导航到刚刚克隆下来的节点文件夹:
|
||||
```bash
|
||||
cd Comfyui-General-API-Node
|
||||
```
|
||||
- 安装所需的依赖项:
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
3. **重启 ComfyUI**
|
||||
- 完成以上步骤后,请完全重启 ComfyUI。
|
||||
|
||||
### 💡 如何使用
|
||||
|
||||
#### General API Node
|
||||
1. **找到节点**: 在 ComfyUI 中,您可以通过右键菜单 -> `Add Node` -> `FeiMao-326` -> `FeiMao-326 General API Node` 找到它。
|
||||
|
||||

|
||||
|
||||
2. **设置种子控制**: 若要启用自动种子变更(例如 `randomize`),请将节点的 `seed` **输出**端口连接回它自身的 `seed` **输入**端口。这个“循环”连接会在每次运行后自动更新种子值。
|
||||
|
||||
3. **使用场景**:
|
||||
- **📝 纯文本生成**: 将 `image_1` 和 `image_2` 保持断开。
|
||||
- **🖼️ 单图描述**: 连接一张图片到 `image_1` 接口。
|
||||
- **🎬 双图视频转场**: 连接**起始帧**到 `image_1`,连接**结束帧**到 `image_2`。
|
||||
- **📸 多图分析**: 您最多可以连接多张图片 (`image_1`, `image_2`, `image_3...等`) 进行复杂的分析任务。
|
||||
4. **API 连接示例**:
|
||||
- **本地 Ollama**:
|
||||
- `api_baseurl`: `http://127.0.0.1:11434/v1`
|
||||
- `api_key`: `ollama`
|
||||
- `model`: `gemma3:4b` (或其他支持视觉的模型)
|
||||
- `cleanup_local_gpu`: 保持勾选 (True)。
|
||||
- **外部 API (以 OpenAI 为例)**:
|
||||
- `api_baseurl`: `https://api.openai.com/v1`
|
||||
- `api_key`: 填入您的 OpenAI 密钥 (`sk-xxxxxxxx`)
|
||||
- `model`: `gpt-4o`
|
||||
- **Google Gemini (原生)**:
|
||||
- `api_baseurl`: `https://generativelanguage.googleapis.com/v1beta/`
|
||||
- `api_key`: 填入您的 Google AI Studio 密钥
|
||||
- `model`: `gemini-1.5-pro` (对话) 或 `imagen-3.0-generate-001` (绘图)
|
||||
下面是一个完整的双图转场任务的示例工作流:
|
||||
|
||||

|
||||
|
||||
#### Text Batch Replace
|
||||
- 在 `text` 字段中输入任意文本。
|
||||
- 填写 `find_x` 和 `replace_x` 字段以执行顺序替换。
|
||||

|
||||
|
||||
#### JSON Parser
|
||||
- 将您的复杂JSON粘贴到 `json_payload` 字段中。
|
||||
- 在 `keys_to_extract` 字段中,输入您想提取的关键字,用逗号分隔(例如 `shot, subject, audio`)。
|
||||
- 节点会在JSON的任何位置找到这些关键字,将其合并后的值输出到对应的 `output_x` 端口,并在节点内显示预览。
|
||||

|
||||
|
||||
#### Show Text
|
||||
- 将任何字符串输出连接到 `text` 输入。
|
||||
- 文本将直接显示在节点上。
|
||||
|
||||
#### Simple Text
|
||||
- 在文本框中输入您的文本。
|
||||
- 将 `text` 输出连接到任何需要字符串输入的节点。
|
||||
|
||||
#### Text Split By Delimiter
|
||||
- 输入文本和分隔符(默认为逗号)。
|
||||
- 输出一个 `LIST` 类型,可与 `Get List Element` 配合使用。
|
||||

|
||||
|
||||
#### Get List Element
|
||||
- 连接 `LIST` 输入。
|
||||
- 指定索引(从0开始)以检索特定字符串。
|
||||
|
||||
#### Text Iterator
|
||||
- 输入文本和分隔符。
|
||||
- 将每个分割项作为单独的批次项输出。
|
||||
- 用于迭代提示词列表或参数列表。
|
||||

|
||||
|
||||
### 📜 许可证
|
||||
|
||||
本项目采用 Apache 2.0 许可证。详情请参阅 [LICENSE](LICENSE) 和 [NOTICE](NOTICE) 文件。
|
||||
=======
|
||||
|
||||
4. **API Connection Examples**:
|
||||
- **NVIDIA NIM (Official/Local)**:
|
||||
@@ -350,4 +149,3 @@ This project is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE
|
||||
|
||||
### 📜 License
|
||||
This project is licensed under the Apache 2.0 License.
|
||||
>>>>>>> e9ec5ee (feat: Release v1.0.6 with 6 new advanced text nodes and Nodes 2.0 (Vue UI) optimization)
|
||||
|
||||
Reference in New Issue
Block a user