Proximity Feature Node β‘π ‘π π £π
Turn distance between two points into a reactive signal
- anchor_locations
- query_locations
- proximity_feature
Most of this pack's Feature sources react to audio or motion; this one reacts to distance. Give it two tracked points - an anchor and a query - and it outputs a FEATURE that tracks how close or far apart they are, frame by frame. A hand approaching a face, an object entering a target zone, two dancers moving apart and back together - anything where "how close is X to Y" is the thing you want driving an effect.
How it works
anchor_locations and query_locations both take a LOCATION - this pack's own coordinate type, produced by nodes like LocationFromMask (reads a position off a mask's centroid or boundary) or LocationFromPoint (manually-typed coordinates) elsewhere in the same package. Neither input takes a raw coordinate pair directly; you need an actual LOCATION-producing node upstream first.
normalization_method decides how the raw distance gets scaled into a usable FEATURE value: frame normalizes each frame independently, while minmax normalizes across the whole sequence's observed distance range. Practically, minmax gives you consistent scaling across an entire clip (the closest approach in the whole video reads as the feature's minimum, the farthest as its maximum), while frame judges each frame on its own - pick whichever fits how you want the "closeness" scale to behave over your specific sequence. There's also an extraction_method field on this node for how the raw per-frame distance gets folded into the final feature value; the schema's own tooltip only says "method used to extract features," so treat it as one more thing to try both settings on rather than something with a documented right answer.
The inputs and outputs that matter
anchor_locations/query_locations(required,LOCATION) - fromLocationFromMask,LocationFromPoint, or another source in the pack.normalization_method-frame(per-frame scaling) orminmax(whole-sequence scaling).extraction_method- how raw distance becomes the final feature value.frame_rate,width/height- standard feature-tensor sizing.
Output is a single proximity_feature (FEATURE) - wire it into any Flex target, FeatureToMask, or ProximityVisualizer to check it visually before trusting it.
How to install it
ComfyUI Manager: search "RyanOnTheInside", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt
then restart. No model download - this is coordinate math on data another node in the pack already produced.
Common issues & troubleshooting
Node errors immediately, or won't run. anchor_locations and query_locations are both required and both strictly LOCATION type - they don't accept a generic coordinate, an image, or a mask directly. Trace back to confirm a real LocationFromMask/LocationFromPoint node is actually feeding both inputs.
Feature curve looks wrong or inverted. Try switching normalization_method between frame and minmax - with only a whole-sequence view versus a per-frame view to choose from, one of the two usually matches your intuition for "closer means higher value" better than the other, depending on how much the distance range varies across your clip.
Distance readings jump around erratically. If either LOCATION source is derived from a mask (LocationFromMask), a noisy or flickering mask upstream - common with auto-generated segmentation on video - produces a noisy location, which shows up here as an erratic proximity reading. Clean up the mask upstream before troubleshooting this node.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| extraction_method | COMBO | Method used to extract features | |
| frame_rate | FLOAT | 30.01β120 | Frame rate of the video (1.0 to 120.0 fps) |
| frame_count | INT | 301β999999 | Total number of frames (minimum: 1) |
| width | INT | 51264β4096 | Width of the output feature (64 to 4096) |
| height | INT | 51264β4096 | Height of the output feature (64 to 4096) |
| anchor_locations | LOCATION | Reference locations for proximity calculation | |
| query_locations | LOCATION | Locations to calculate proximity from anchors | |
| normalization_method | COMBO | Method to normalize proximity values ('frame' or 'minmax') |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| proximity_feature | FEATURE | β |