ComfyUI Extension: ComfyUI-Flow-Assistor
Essential utility nodes for ComfyUI including prompt queue, batch processing, camera angle control, and resolution selector. (Description by CC)
Custom Nodes (0)
README
Get Started
Install
- Install the great ComfyUI.
- Clone this repo into
custom_nodes:cd ComfyUI/custom_nodes git clone https://github.com/Merserk/ComfyUI-Flow-Assistor.git - Start up ComfyUI.
๐ ๏ธ The Nodes
1. ๐ Prompt Queue
Iterate through prompt lines one by one.
Instead of randomizing a list, this node strictly follows the order of your text. It is perfect for testing specific prompt variations or storytelling sequences.
<details> <summary><b>๐ป Click for Parameters & Features</b></summary>How it works:
Paste a multi-line list of prompts. Every time you queue a generation, the node outputs the next line in the list.
| Parameter | Description |
| :--- | :--- |
| Prompts | The multi-line text input. |
| On End | Behavior when the list finishes: empty (stop outputting), repeat_last (keep sending the last line), or loop (start over). |
| Reset Trigger | Change this integer value to force the queue back to line 1. |
| Strip / Skip | Automatically cleans up whitespace and ignores empty lines. |
2. ๐ Prompt Queue (From Folder)
Batch processing made simple.
Stop copying and pasting. Point this node to a folder on your computer, and it will read text files (.txt, .json, etc.) one by one.
<details> <summary><b>๐ป Click for Parameters & Features</b></summary>Use Case:
Great for processing wildcards, long metadata files, or batch-generating images based on a library of text descriptions stored locally.
| Parameter | Description |
| :--- | :--- |
| Folder Path | The absolute path to your directory (e.g., C:/Prompts). |
| Extensions | Comma-separated list of file types to read (default: txt, json). |
| On End | empty (returns empty string), loop (starts at first file), hold_last (repeats last file). |
| Outputs | Returns both the content of the file and the filename. |
3. ๐ฅ Camera Angle Control
Professional camera descriptions without the hassle.
Generating specific camera angles in Stable Diffusion can be hit-or-miss. This node constructs precise camera prompts based on rotation, height, depth, and focal length.
Three Output Modes:
- Natural: "camera rotated slightly to the right, camera raised high angle..."
- Technical: "rotation 45.0ยฐ, vertical up 30.0..."
- Keywords: "right side view, high angle, close-up..."
- Rotation: Pan the camera around the subject (Front โ Side โ Rear).
- Vertical: Move the camera up or down (Bird's Eye โ Eye Level โ Worm's Eye).
- Depth: Push in or pull out (Macro โ Close-up โ Wide Shot).
- Focal Length: Simulate lens compression (24mm Wide Angle to 600mm Super Telephoto).
- Prefix/Suffix: Add extra framing text easily.
4. ๐ Resolution Selector (Groups)
Standardized resolutions with aspect ratios.
Stop guessing pixel dimensions. This node groups resolutions by Megapixel count (0.25MP to 4MP) and provides standard aspect ratios (1:1, 16:9, 4:3, 21:9, etc.).
<details> <summary><b>๐ป Click for Available Resolutions</b></summary>Logic:
Select a resolution from the dropdown, then Enable the switch for that group. The node prioritizes the highest enabled quality group (e.g., if both 1MP and 4MP are enabled, it uses 4MP).
- 0.25MP: SD 1.5 style small generations.
- 0.6MP: Intermediate sizes.
- 1MP (Default): Standard SDXL / SD 1.5 Hi-Res.
- 2MP - 4MP: High-resolution upscaling targets.
- Aspect Ratios: Covers 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, 9:21.
5. ๐ผ๏ธ Image Resolution Fit
Resize images while keeping aspect ratio.
Allows you to resize an input image to a specific Megapixel target (e.g., 1MP, 2MP) without distorting it. The node automatically calculates the correct width and height to preserve the original shape and rounds dimensions to multiples of 8.
<details> <summary><b>๐ป Click for Parameters & Features</b></summary>Use Case:
Perfect for Image-to-Image workflows where you want to upscale or downscale a source image to a standard generation size (like 1024x1024 total pixels) but don't want to crop or stretch it.
| Parameter | Description |
| :--- | :--- |
| Resolution Select | Choose the target Megapixel count (0.25MP to 4MP). |
| Logic | Calculates sqrt(target_pixels / current_pixels) to scale both dimensions equally. |
| Outputs | Returns the resized Image, a matching empty Latent, and the new Width/Height. |
6. โ๏ธ Multiplication (Dual & Latent)
Mathematical scaling for custom upscaling.
Takes two integer inputs (like Width and Height) and an optional Latent, and multiplies them by a float factor.
<details> <summary><b>๐ป Click for Parameters & Features</b></summary>Use Case:
Use this for "1.5x Upscales" or "2x Hires Fix". Connect your base width/height, set the multiplier to1.5, and feed the output into your latent upscaler or resize node.
| Parameter | Description |
| :--- | :--- |
| Multiplier | The scaling factor (e.g., 1.5 or 2.0). |
| Inputs | Accepts two Integers (value_1, value_2) and a Latent. |
| Outputs | Returns the multiplied integers and the bilinearly interpolated latent. |
7. ๐งน VRAM/RAM Cleaner
Manage your resources mid-workflow.
A "Pass-through" node that can connect to any input (Model, VAE, Image, etc.). It passes the data through unchanged but triggers a garbage collection and VRAM flush event when executed.
<br>Modes:
- Current: Unloads the specific model passing through the node.
- Others: Unloads everything else, keeping only the passing model in VRAM.
- All: Unloads everything to system RAM (clean slate).
๐ Workflow Examples
The "Storyteller" Batch
- Create a text file with 10 different scenes describing a story.
- Use Prompt Queue to paste them in.
- Connect output to your CLIP Text Encode.
- Set "Batch Count" in ComfyUI to 10.
- Hit Queue. You get 10 images, one for each scene, in order.
The "Cinematographer"
- Connect Camera Angle Control to a text concatenator or CLIP Encode.
- Set Output Format to
Natural. - Set Focal Length to
85mm(Portrait) and Depth toClose-up. - Resulting Prompt: "85.0mm portrait lens with compression, camera very close, close-up" appended to your main prompt.
The "Smart Upscaler"
- Connect your base
WidthandHeightto Multiplication (Dual). - Set Multiplier to
1.5. - Connect the output
Result 1andResult 2to a "Latent Upscale" node. - This dynamically calculates a 1.5x resolution regardless of your starting aspect ratio.
๐ค Contributing
If you have ideas for new flow-assisting nodes or improvements to existing ones, feel free to open an issue or submit a pull request!
๐ License
AGPL-3.0 License. Feel free to use this in any project, personal or commercial.