ONNX selector
Pick a YOLO model from a dropdown
- ui_widget
- detector
- model_path
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 intomodels/onnxyet, it reads-- no models found --, which is your cue to go export or download a YOLO ONNX file.enable_history(defaulttrue) - 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'smodelstree, 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.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| detector | COMBO | -- no models found -- | ONNX model discovered in ComfyUI/models/onnx (e.g. yolo/your_model.onnx). |
| enable_history | BOOLEAN | true | Track selections in the history widget. |
| ui_widgetopt | LF_HISTORY | [object Object] | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| detector | ONNX_DETECTOR | Selected ONNX detector model label. |
| model_path | ONNX_PATH | File path of the selected ONNX detector model. |