Nodes/lf-nodes/ONNX selector
ComfyUI Node

ONNX selector

Pick a YOLO model from a dropdown

By lucafoscili·Created 2 years ago·Updated 6 days ago· 35
ONNX selector
  • ui_widget
  • detector
  • model_path
detector-- no models found --
enable_historytrue

The selector nodes are LF's signature - dropdowns that turn "type the right filename into a path box" into "pick it from a list." LF_ONNXSelector is the one for object-detection models: it scans your ONNX folder, hands you a dropdown of what's there, and spits out the path for the node that actually runs the detection.

The scan target is ComfyUI/models/onnx. Drop a YOLO export (.onnx) into that folder, even in subdirectories, and it shows up in the detector combo the next time the graph refreshes. That's the whole job: it's a picker, not a detector.

Inputs and outputs

  • detector - the dropdown of discovered models. If you haven't dropped anything into models/onnx yet, it reads -- no models found --, which is your cue to go export or download a YOLO ONNX file.
  • enable_history (default true) - tracks your selections in the history widget, so you can see what you've been switching between.

Two outputs, and they're the two things the downstream node needs: detector (the model label) and model_path (the resolved file path). Wire both into LF_DetectRegions, which is where the actual detection happens.

Installing it

One pack install covers it:

cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/lf-nodes

then restart ComfyUI, or install "LF Nodes" from ComfyUI Manager. This node itself pulls no heavy dependency beyond what the suite already has - the detection stack (onnxruntime) is what matters for the other end of the pipeline.

Practical notes

  • The dropdown looks empty - the model file isn't in ComfyUI/models/onnx. It has to be inside the ComfyUI install's models tree, not somewhere you pointed at from memory.
  • "-- no models found --" even after adding a file - refresh the graph (reload nodes or restart ComfyUI) so the enum re-scans the folder.
  • Which YOLO to use is on you - this picks any ONNX detector you give it, and the classic choice for region work is a YOLOv8-family export. It doesn't ship models itself, so budget a download for your detector of choice.
Category✨ LF Nodes/Selectors

Inputs (3)

NameTypeDefaultDescription
detectorCOMBO-- no models found --ONNX model discovered in ComfyUI/models/onnx (e.g. yolo/your_model.onnx).
enable_historyBOOLEANtrueTrack selections in the history widget.
ui_widgetoptLF_HISTORY[object Object]

Outputs (2)

NameTypeDescription
detectorONNX_DETECTORSelected ONNX detector model label.
model_pathONNX_PATHFile path of the selected ONNX detector model.