Flex Image Edge Detect β‘π ‘π π £π
Canny edges with a reactive dial
- images
- opt_feature
- IMAGE
This is Canny edge detection - the same algorithm behind a lot of ControlNet preprocessing - wrapped as a Flex node so its sensitivity can be driven by a reactive Feature rather than staying fixed. Use it as a stylistic effect (turning footage into a moving line-art/wireframe look) rather than for ControlNet conditioning; there are dedicated preprocessor nodes for that job elsewhere in the ecosystem, and this one's home is FlexFeatures/Targets/Images, squarely in the effects family.
How it works
Canny edge detection works with two thresholds rather than one: low_threshold and high_threshold (both 0β255, defaults 100/200) define hysteresis bounds. A pixel gradient above high_threshold is a definite edge; below low_threshold it's definitely not; anything in between only counts as an edge if it connects to a pixel that's already above the high threshold. That's why the two numbers exist instead of one simple sensitivity slider - it's how Canny avoids both missing faint-but-real edges and drowning the image in noise from every minor gradient.
feature_param lets a connected feature modulate either low_threshold or high_threshold (or None to disable modulation). feature_mode picks relative (nudges the base threshold up/down) or absolute (sets it directly from the feature), feature_threshold gates when that modulation activates, and strength scales how far it's allowed to swing the threshold.
Inputs and outputs that matter
images- required.low_threshold/high_threshold- the whole effect lives here. Raise both together for a cleaner, sparser edge map; lower both for a noisier, denser one. The gap between them matters too - a wide gap picks up more of the "maybe" edges that connect to strong ones.opt_feature(optional) - for animating sensitivity over time, e.g. edges getting denser as audio intensity rises.
Output is a single IMAGE - the edge map, typically black background with white/bright edge lines.
How to install it
Via ComfyUI Manager, search "RyanOnTheInside." Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
then restart. Edge detection runs through OpenCV, which is part of the pack's shared requirements - no separate download needed if the install completed cleanly.
Common issues & troubleshooting
Output is nearly all noise, or nearly blank. This is almost always the threshold pair, not the image. Too-low thresholds pick up every minor gradient as an edge (noisy, chaotic output); too-high thresholds miss everything but the strongest contrast lines (a nearly empty frame). Start near the defaults (100/200) and adjust in both directions to see where your source image's real structure lives.
Result looks different frame to frame even on a static-looking clip. Canny is sensitive to per-frame noise (compression artifacts, grain, slight exposure shifts), so a visually "static" video can still produce flickering edge maps. If you need temporal stability, consider pre-smoothing the source or blending consecutive edge-detected frames downstream - this node itself has no temporal smoothing of its own.
Feature modulation on thresholds produces a broken-looking edge map at extremes. Remember high_threshold needs to stay meaningfully above low_threshold for Canny's hysteresis logic to behave sensibly - if a feature pushes one threshold past the other, you can get inverted or degenerate-looking results. Keep an eye on the effective range your feature modulation covers, not just its nominal min/max.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| strength | FLOAT | 1.000β1 | Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle. |
| feature_threshold | FLOAT | 0.000β1 | Minimum feature value to trigger the effect (0.0 to 1.0) Only applies the effect when the feature value exceeds this threshold. Lower values make the effect more sensitive, higher values make it more selective. |
| feature_param | COMBO | Choose which parameter to modulate: - low_threshold: Dynamically adjust edge sensitivity - high_threshold: Dynamically adjust edge strength - None: No parameter modulation | |
| feature_mode | COMBO | relative | How to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum |
| images | IMAGE | Input image sequence to be processed (IMAGE type) | |
| low_threshold | FLOAT | 1000β255 | Lower bound for the hysteresis thresholding (0 to 255) |
| high_threshold | FLOAT | 2000β255 | Upper bound for the hysteresis thresholding (0 to 255) |
| opt_featureopt | FEATURE | Optional feature input for modulation Connect any feature node here to control the effect. Features can come from audio, motion, color, or other sources. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |