Nodes/RyanOnTheInside/Flex Image Edge Detect βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Flex Image Edge Detect βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Canny edges with a reactive dial

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Image Edge Detect βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • images
  • opt_feature
  • IMAGE
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„low_threshold100β–Ί
β—„high_threshold200β–Ί

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.

CategoryRyanOnTheInside/FlexFeatures/Targets/Images

Inputs (8)

NameTypeDefaultDescription
strengthFLOAT1.000–1Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle.
feature_thresholdFLOAT0.000–1Minimum 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_paramCOMBOChoose which parameter to modulate: - low_threshold: Dynamically adjust edge sensitivity - high_threshold: Dynamically adjust edge strength - None: No parameter modulation
feature_modeCOMBOrelativeHow to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum
imagesIMAGEInput image sequence to be processed (IMAGE type)
low_thresholdFLOAT1000–255Lower bound for the hysteresis thresholding (0 to 255)
high_thresholdFLOAT2000–255Upper bound for the hysteresis thresholding (0 to 255)
opt_featureoptFEATUREOptional 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)

NameTypeDescription
IMAGEIMAGEβ€”