ComfyUI Warper Nodes
NODES: DWPose Scaler (Warper), Mouth Mask from Pose (Warper), Facial Part Mask from Pose (Warper), Smart Video Batcher (Warper), Get Batch By Index (Warper), Smart Overlapping Batcher (Warper), Flow Visualizer (Warper), Preprocess for Target (Warper), Crop and Restore (Warper), Aspect Ratio Resolution (Warper)
Nodes (17)
Turn 'some image' into a clean 720p-sized frame
Snap any image to 720p or 1080p
One dropdown to size any generation
Glue prompt fragments together without a mangled comma
Undo your padding without losing pixels
Stretch a skeleton's legs and neck without stretching the image
Face, mouth, and eye masks from DWPose landmarks
See the motion in your frames with RAFT
Pull one chunk out of your batched frames
Batch-generate from a folder of txt prompts
One prompt, precisely, from a folder
Lip-sync masks without a single manual paint
Fit any image to a fixed canvas without cropping it
Keep long videos temporally consistent with overlapping chunks
Split your frame stack so the last batch doesn't blow up
Fixed, incremental, or seeded-random access to your prompt files
Know which prompt file you're on, mid-batch
ComfyUI Warper Nodes
A collection of general-purpose nodes for ComfyUI.
Current Nodes
-
DWPose Scaler (Warper): Provides advanced scaling and adjustment options for DWPose keypoints. (Category:
Warper Tools)
-
Flow Visualizer (Warper): Calculates optical flow between image sequences using the RAFT model and provides visual representations (color-coded flow images) for both forward and backward flow. Ideal for understanding motion in your generations. (Category:
Warper Tools/Flow)- Model Requirement: This node requires a RAFT model checkpoint.
-
Smart Video Batcher (Warper): Splits image sequences into smaller batches with special padding for the final batch. (Category:
Warper Tools/Looping) -
Get Batch By Index (Warper): Selects a single image batch from a list of batches by its index. (Category:
Warper Tools/Looping) -
Smart Overlapping Batcher (Warper): Creates overlapping batches from an image sequence to help maintain temporal consistency. (Category:
Warper Tools/Looping) -
Mouth Mask from Pose (Warper): Generates a circular mask around the mouth area based on facial keypoints. (Category:
Warper Tools/DWMasking) -
Facial Part Mask from Pose (Warper): Creates masks for various facial parts (entire face, mouth, eyes) using different shapes (convex hull, ellipse, etc.) based on facial keypoints. (Category:
Warper Tools/DWMasking)
Prompt Loading Nodes (Category: Warper Tools/Prompts)
-
Load Prompts from Directory (Warper): Loads text prompts from
.txtfiles in a specified directory with options for batch processing.- Inputs:
directory_path: Path to directory containing.txtfilesskip_first_files: Number of files to skip from the beginning (useful with incremental integer nodes for sequential access)load_cap: Maximum number of prompts to load at once
- Outputs:
prompts: List of loaded prompt textstotal_loaded: Number of prompts successfully loadedfile_names: List of filenames that were loaded
- Use Case: Perfect for batch processing multiple prompts or iterating through a prompt library with an incremental counter node.
- Inputs:
-
Load Single Prompt by Index (Warper): Loads a single prompt from a directory by its index position.
- Inputs:
directory_path: Path to directory containing.txtfilesfile_index: Index of the file to load (0-based)
- Outputs:
prompt: The loaded prompt textfile_name: Name of the loaded filetotal_files: Total number of.txtfiles in the directoryis_valid: Boolean indicating if the load was successful
- Use Case: Ideal for workflows that need to process prompts one at a time with precise index control.
- Inputs:
-
Combine Prompts (Warper): Combines multiple prompts with customizable separators and formatting.
- Inputs:
prompt1-4: Up to 4 prompt inputs (all optional)separator: Text to insert between prompts (default: ", ")prefix: Text to add before the combined resultsuffix: Text to add after the combined result
- Outputs:
combined_prompt: The final combined prompt string
- Use Case: Useful for building complex prompts from multiple sources or adding consistent formatting.
- Inputs:
Text File Iterator Nodes (Category: Warper Tools/Text)
-
Text File Iterator (Warper): Loads text files from a directory with different iteration modes.
- Inputs:
directory_path: Path to directory containing.txtfilesindex: Index number (behavior depends on mode)mode: Iteration mode selectionfixed: Always loads the file at the specified indexincremental: Cycles through files sequentially, remembering position between runsrandomized: Randomly selects a file using the index as a seed for reproducible results
- Outputs:
text_content: The content of the loaded text file
- Use Case: Perfect for iterating through prompt files with different access patterns - fixed for specific prompts, incremental for sequential workflows, or randomized for variety.
- Inputs:
-
Text File Iterator with Info (Warper): Enhanced version that provides additional file information.
- Inputs: Same as Text File Iterator
- Outputs:
text_content: The content of the loaded text filefile_name: Name of the loaded filefile_index: Index of the loaded file in the directorytotal_files: Total number of.txtfiles in the directory
- Use Case: Ideal when you need to track which file is being used or display progress information.
Installation
-
Navigate to your ComfyUI
custom_nodesdirectory. -
Clone this repository:
git clone https://github.com/AIWarper/ComfyUI-WarperNodes -
Install RAFT Model (Required for Flow Visualizer Node):
- Download the RAFT model checkpoint:
Tartan-C-T-TSKH-spring540x960-M.pth- Download Link: Google Drive Folder (Look for the specified
.pthfile within this folder.)
- Download Link: Google Drive Folder (Look for the specified
- Create a
raftfolder inside your ComfyUImodelsdirectory if it doesn't already exist:ComfyUI/models/raft/ - Place the downloaded
Tartan-C-T-TSKH-spring540x960-M.pthfile into thisComfyUI/models/raft/directory.
- Download the RAFT model checkpoint:
-
Install any Python package dependencies (if listed in
requirements.txt):cd ComfyUI-WarperNodes pip install -r requirements.txt(If you use ComfyUI's portable version, you might need to use its embedded Python, e.g.,
path/to/ComfyUI/python_embeded/python.exe -m pip install -r requirements.txt. If arequirements.txtfile is not present, this step may not be needed.) -
Restart ComfyUI.
Usage Notes
- Ensure the RAFT model is correctly placed as described above for the Flow Visualizer (Warper) node to function.
- The nodes will appear under the "Warper Tools" category in the ComfyUI "Add Node" menu.
TODO:
- Add example images/gifs for other nodes.
- More detailed usage instructions for each node.