Feat: Update README with new sample workflows and node descriptions for enhanced clarity

This commit is contained in:
KATO Kanryu
2026-05-24 19:50:23 +09:00
parent 84fe3aaa15
commit 75b56615d0
+70 -90
View File
@@ -15,113 +15,93 @@ By decoupling the "Character Core" from the "Scene/Staging Direction", you can b
---
## Sample Workflows
Two structured sample projects are available in the `examples/` directory to demonstrate the practical capabilities and synergies of this extension:
1. **text_driven_prompting_sample.json (Layered Prompting Synergy)**
![Text-Driven Prompting Sample Workflow](examples/text_driven_prompting_sample.jpg)
* **Purpose:** Demonstrates the core pipeline workflow using the newly introduced dynamic nodes.
* **How it works:** A base prompt asset (e.g., character tokens with escaped brackets) is selected via the *Text Line Prompt* node. This base string seamlessly chains into the hidden `optional_text_in` slot of the *Multi Prompts* node, allowing you to stack, scale, or toggle aesthetic modifiers (attire, lighting, environment) on top of the base setup with simple clicks before sending the final compiled prompt to SDXL.
2. **text_driven_batch_processing.json (Automated Grid Generation)**
![Text-Driven Batch Processing Sample Workflow](examples/text_driven_batch_sample.jpg)
* **Purpose:** Demonstrates a batch processing architecture designed for sequential rendering grids.
* **How it works:** Uses the *Prompt Line* node to index and extract line-separated staging directions automatically across multiple prompt queues. Connected to downstream mathematical or switching elements, it allows you to safely automate generation variations across extensive asset libraries without UI clutter.
---
## Included Nodes
### 1. Single Prompt (Text-Driven)
Manages a single prompt fragment with precision multiplier weighting and master active status control.
* **Inputs:**
* `text` (String, Multiline): The primary prompt fragment.
* `optional_text_in` (String, Force Input, Optional): An upstream text fragment to merge.
* `multiplier` (Float, Default: `1.0`, Range: `0.0` - `10.0`): Weight adjustment factor.
* `active` (Boolean, Default: `True`): Master bypass switch. If `False`, outputs an empty string instantly.
* **Behavior:** Automatically combines `text` and `optional_text_in` with correct spacing. If the multiplier is not `1.0`, it cleanly wraps the final text into standard attention weight syntax: `(combined_text:multiplier)`. Built to handle unlinked optional pins flawlessly.
### 2. Join Strings (Text-Driven)
### 1. Join Strings (Text-Driven)
Concatenates multiple string inputs into a single text block using a custom defined delimiter.
* **Inputs:**
* `delimiter` (String, Default: `""`): The string used to separate the text fragments (e.g., `, ` or `\n`).
* `string_inputs` (Autogrow Input): Dynamically expanding input slots.
* `delimiter` (String, Default: `""`): The string used to separate the text fragments (e.g., `, ` or `\n`).
* `string_inputs` (Autogrow Input): Dynamically expanding input slots.
* **Behavior:** Fully compliant with ComfyUI V3's native 0-indexed Autogrow behavior (`string0`, `string1`, etc.). Connecting a line from another node to an input pin automatically generates and increments a new input pin. It extracts index markers via regular expressions, sorts them numerically to maintain strict structural ordering, and joins them into a unified prompt block.
### 2. Math (Int) (Text-Driven)
An advanced integer arithmetic core designed to calculate loops, steps, dimensions, and indexing logic safely.
* **Inputs:**
* `a` / `b` (Int, Range: -999,999,999 to 999,999,999): Supports massive integer ranges.
* `operation` (Combo Select): `add`, `subtract`, `multiply`, `divide`, `modulo`, `power`, `shift`.
* **Advanced Logic:**
* `divide` / `modulo`: Allows natural zero-division runtime exceptions to propagate upstream safely.
* `power`: Implements safety range-guards to prevent system-freezing overflow.
* `shift` (Smart Bit-Shift): Intelligently reads the sign of `b`. Performs a standard Left Shift (`a << b`) if `b >= 0`, and automatically switches to a Right Shift (`a >> abs(b)`) if `b < 0` (capped safely at 31 bits).
* **Behavior:** Fully compliant with ComfyUI V3's native 0-indexed Autogrow behavior (`string0`, `string1`, etc.). Connecting a line from another node to an input pin automatically generates and increments a new input pin. You can connect as many input pins as you need. It extracts the index markers via regular expressions, sorts them numerically to maintain strict structural ordering, and joins them into a unified prompt block.
### 3. Prompt Line (Text-Driven)
### 3. Multi Prompts (Text-Driven)
Allows simultaneous editing and management of multiple independent prompts within a single node.
* **Inputs:**
* `num_prompts` (Combo, Options: `1` - `10`, Default: `3`): The number of active visible slots.
* `optional_text_in` (String, Force Input, Optional): An upstream text fragment to merge.
* `text_1` to `text_10` (String, Multiline): Individual prompt fragment slots.
* `multiplier_1` to `multiplier_10` (Float, Default: `1.0`, Range: `0.0` - `10.0`): Weight factors for each slot.
* `active_1` to `active_10` (Boolean, Default: `True`): Toggles the output state of each slot.
* **Behavior:** The text input fields dynamically expand or shrink based on the specified number to keep your workspace clean. You can toggle individual weights and output active states for each slot. All active prompts are automatically joined into a single comma-separated string output. It automatically strips trailing zeros from floating numbers (e.g., `1.10` becomes `1.1`) to ensure clean prompt injection.
### 4. Prompt Line (Text-Driven)
Extracts specific lines from a multi-line text block to output as a structured string list, fully supporting batch image generation workflows.
* **Visual Identifiers:** Distinctive dark green design (`color: #225522`, `bgcolor: #33aa33`).
* **Inputs:**
* `prompt` (String, Multiline): The source asset block containing your lines/prompts.
* `start_index` (Int, Default: `0`): The line index to begin extraction.
* `max_rows` (Int, Default: `1000`): Maximum lines to extract.
* `remove_empty_lines` (Boolean, Default: `True`): Automatically cleans up whitespace and dead lines.
* `loops` (Boolean, Default: `False`): Wraparound toggle.
* **Behavior:** This node is specialized for batch image generation. By setting `max_rows` to 2 or more, it outputs multiple prompt lines simultaneously, allowing you to execute two or more prompts at the same time in a single batch generation run. The list output of this node can also be passed to downstream string manipulation nodes for further processing. If `loops` is `True`, it loops back to index `0` when the requested row count exceeds available lines.
### 4. Text Line Selector (Text-Driven)
A studio-grade scenario switch designed to store massive direction and staging plans externally.
* **Behavior:** Allows you to record dozens of rich staging configurations within the node or an external file and recall them instantly via a clean drop-down selector. You can input a label and the custom delimiter **`|-|`** (e.g., `Label|-|Prompt`) for each line of the multi-line text, which makes the options in the combo box much easier to read and select. It seamlessly pipes the chosen scenario prompt into downstream prompt-assembly nodes, completely removing the need to type out repetitive structures manually.
* `prompt` (String, Multiline): The source asset block containing your lines/prompts.
* `start_index` (Int, Default: `0`): The line index to begin extraction.
* `max_rows` (Int, Default: `1000`): Maximum lines to extract.
* `remove_empty_lines` (Boolean, Default: `True`): Automatically cleans up whitespace and dead lines.
* `loops` (Boolean, Default: `False`): Wraparound toggle.
* **Behavior:** Specialized for batch image generation. By setting `max_rows` to 2 or more, it outputs multiple prompt lines simultaneously, executing multiple prompts in a single batch generation run. The list output can be passed to downstream string manipulation nodes. If `loops` is `True`, it loops back to index 0 when the requested row count exceeds available lines.
### 5. Resolution Selector (Text-Driven)
A dedicated resolution management utility designed to store preset aspect ratios and target dimensions externally.
* **Behavior:** Allows you to register major resolution pairs and switch between them instantly via a clean drop-down menu. It outputs the width and height dimensions directly into downstream generator or latent nodes, eliminating manual typing and aspect ratio calculation mistakes.
* **Note:** By default, this node lists preset resolutions that are popular for SDXL. You can easily modify the configurations to delete unnecessary rows or add your own preferred landscape resolutions.
```text
┌──► width ──────► [ Empty Latent Image ]
├──► height ──────►
│
[ Resolution Selector ]│
├──► width ──────► [ CLIP Text Encode SDXL ]
│ (width / target_width)
└──► height ──────► (height / target_height)
```
### 6. Math (Int) (Text-Driven)
An advanced integer arithmetic core designed to calculate loops, steps, dimensions, and indexing logic safely.
* **Inputs:**
* `a` / `b` (Int, Range: `-999,999,999` to `999,999,999`): Supports massive negative and positive integer ranges.
* `operation` (Combo Select): `add`, `subtract`, `multiply`, `divide`, `modulo`, `power`, `shift`.
* `selected_resolution` (Combo Select): Dropdown list containing preset resolution dimensions.
* **Behavior:** Allows you to register major resolution pairs and switch between them instantly via a clean dropdown menu. It outputs the width and height dimensions directly into downstream generator or latent nodes, eliminating manual typing and aspect ratio calculation mistakes. Optimized out-of-the-box for popular SDXL aspect ratios.
### 6. Single Prompt (Text-Driven)
Manages a single prompt fragment with precision multiplier weighting and master active status control.
* **Inputs:**
* `text` (String, Multiline): The primary prompt fragment.
* `optional_text_in` (String, Force Input, Optional): An upstream text fragment to merge.
* `multiplier` (Float, Default: `1.0`, Range: `0.0` - `10.0`): Weight adjustment factor.
* `active` (Boolean, Default: `True`): Master bypass switch. If `False`, outputs an empty string instantly.
* **Behavior:** Automatically combines `text` and `optional_text_in` with correct spacing. If the multiplier is not `1.0`, it cleanly wraps the final text into standard attention weight syntax: `(combined_text:multiplier)`. Built to handle unlinked optional pins flawlessly.
* **Advanced Logic:**
* `divide` / `modulo`: Allows natural zero-division runtime exceptions to propagate upstream safely.
* `power`: Implements safety range-guards to prevent system-freezing overflow.
* `shift` (Smart Bit-Shift): Intelligently reads the sign of `b`. Performs a standard Left Shift (`a << b`) if `b >= 0`, and automatically switches to a Right Shift (`a >> abs(b)`) if `b < 0` (capped safely at 31 bits).
---
## System Architecture & Workflow Philosophy
The driving philosophy behind this suite is **Modular Prompt Assembly**. Instead of maintaining monolithic, cluttered text nodes for every single prompt variation, this suite allows you to build a clean matrix:
```text
[ Character Prompt Node ] ──┐
▼
[ Scene Direction Selector ] ──► [ Join Strings ] ──► [ KSampler ]
▲
[ Lighting/Style Node ] ────┘
```
By putting your complex environment and staging plans into the **Text Line Selector** or **Prompt Line**, you can pipeline up to dozens of unique cinematic directions, use the **Single Prompt** node to handle dynamic weights or on/off states, and merge them with a fixed character asset block. This results in incredibly organized, scalable, and automated generation grids.
---
## Examples
A ready-to-use sample project is available in the `examples` folder so you can test the core capabilities of this extension instantly. You can load this environment by simply dragging either the JSON file (`text_driven_batch_sample.json`) or the screenshot image below directly into your ComfyUI canvas.
![Text-Driven Workflows Sample Workflow](examples/text_driven_batch_sample.jpg)
### 7. Text Line Prompt (Text-Driven)
An innovative bi-directional editing node that allows intuitive control of extensive prompt assets or line-separated concepts within a single text area.
* **Inputs:**
* `text` (String, Multiline): The main multi-line prompt database text area.
* `selected_line` (Combo, Dynamically Managed): Populated dynamically to track and choose lines.
* `multiplier` (Float, Default: `1.0`, Range: `0.0` - `10.0`): Real-time weight scaler for the selected line.
* `active` (Boolean, Default: `True`): Toggles active status for the selected line.
* `optional_text_in` (String, Force Input, Optional): An upstream text fragment to prepend.
* **Behavior:** Selecting a line via the combobox lets you modify its multiplier or active state via UI controls, directly rewriting the target line's string layout in real-time. Deactivated lines are commented out with `//` on the fly and automatically skipped during backend execution to yield a clean string. It handles character LoRA escaped brackets `\( \)` properly while safely bypassing rows containing multiple unescaped brackets to prevent formatting damage. Trailing zeros are automatically dropped for clean syntax (e.g., `1.1`).
### 8. Text Line Selector (Text-Driven)
A studio-grade scenario switch designed to store massive direction and staging plans externally.
* **Inputs:**
* `text` (String, Multiline): Multi-line scenario database.
* `selected_line` (Combo Select): Recalls direction presets based on labels.
* **Behavior:** Allows you to record dozens of rich staging configurations within the node and recall them instantly via a clean drop-down selector. You can input a label and the custom delimiter `|-|` (e.g., `Label|-|Prompt`) for each line of the multi-line text, which makes the options in the combo box much easier to read and select. It seamlessly pipes the chosen scenario prompt into downstream prompt-assembly nodes.
### Workflow Breakdown & Key Mechanics
This sample project demonstrates a highly automated, multi-prompt batch generation pipeline utilizing the following core mechanics: