Advanced Node Usage
Advanced techniques for using custom nodes in ComfyStream
Congratulations on completing your first pipeline! Now, let’s explore a usage of some advanced nodes and features.
While executing a workflow many times per second presents unique challenges, it also opens up new opportunities. For instance, modulating parameters over time is more straightforward than in ComfyUI’s normal batch paradigm.
Reactive Controls
RealtimeNodes
RealtimeNodes were created specifically for ComfyStream and enable unique reactive behaviors. Used in combination with ComfyUI-Logic nodes and other nodes in the ecosystem, they enable sophisticated control flows.
These nodes are under active development, with new features being added often. Feedback is welcome!
Parameter Scheduling
Control any parameter of any ComfyUI node dynamically through scheduling:
Common use cases:
- Dynamic Controlnet parameter adjustment
- Automated LoRA effect cycling
- Cycling through prompts over time
- Triggering a certain prompt according to a condition
Example:
- Shape Resize Control - Demonstrates transitioning the shape of a mask in a composite workflowusing FloatControl. This simple example demonstrates a concept that can be extrapolated to more complex behaviors.
Motion Detection
MotionControl features are currently in experimental beta
ROI
- Define regions of interest in which motion detection is activeIntegerMotionController
- Trigger actions based on movement
Use cases:
- Motion-triggered mask intensity
- Dynamic parameter adjustment based on movement
Examples:
- Motion Detected Bluring - This example demonstrates using two regions of interest to trigger different behaviors.
- Motion Triggered Processing - This example demonstrates using motion detection in combination with a logic node to acheive an ‘on-off’ effect.
Tracking and Masking
Hand tracking features are currently in experimental beta
Example:
- Hand Tracking with Dynamic Masks - Demonstrates real-time hand tracking, as well as dynamic mask resizing based on the proximity of the hands to the mask.
Logic Control
-
LazyCondition
- Skip portions of a workflow conditionallyUse cases:
- Skip computationally expensive ControlNet processing when not needed
- Output different images based on motion detection results
- Switch between different processing paths based on input frame similarity
Example:
- Similarity Filter - This is a simple demonstration of a powerful technique, which allows for skipping a computationally expensive path in a workflow based on a condition.
Utility Nodes
FPSMonitor
- Performance overlay with image and mask outputQuickShapeMask
- Fast shape mask generationDTypeConverter
- Convert between mask data typesFastWebcamCapture
- Optimized webcam inputSimilarityFilter
- Skip processing of similar framesStateResetNode
- Resets the state of all nodes in the workflow when triggered
Audio reactivity features are coming soon!
Advanced Examples
Please refer to the ComfyUI_RealTimeNodes repository for more examples demonstrating each feature.