Comfy-Org / ComfyUI_frontend

Official front-end implementation of ComfyUI
https://www.comfy.org/
GNU General Public License v3.0
576 stars 100 forks source link

[Bug]: Link release search filter includes widget types #505

Closed christian-byrne closed 1 month ago

christian-byrne commented 2 months ago

Frontend Version

1.2.26

Expected Behavior

In the search popover after empty link release, it will only show nodes compatible with the released link.

Actual Behavior

The filter also includes nodes that have matching widget types.

Steps to Reproduce

  1. Add a node that has a primitive output type (STRING, INT, etc.). Since there are non in core you need custom node. For example you can use ImpactWildcardProcessor which outputs STRING
  2. Drag a link from the STRING output slot and release on canvas
  3. The results will show many nodes that have STRING widget inputs, instead of just STRING slot inputs. Choosing one can print warning or throw error depending on if there are any slots at all.

Debug Logs

.

Browser Logs

index.html:4 ComfyUI Front-end version: 1.2.26
api.ts:67 
litegraphTypes.ts:63 Could not find slot with type STRING on node Save Image. This should never happen
    connectTo @ litegraphTypes.ts:63
    (anonymous) @ NodeSearchBoxPopover.vue:88
    addNode @ NodeSearchBoxPopover.vue:87
    callWithErrorHandling @ runtime-core.esm-bundler.js:195
    callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:202
    emit @ runtime-core.esm-bundler.js:726
    createVNode.onOptionSelect._cache.<computed>._cache.<computed> @ NodeSearchBox.vue:136
    callWithErrorHandling @ runtime-core.esm-bundler.js:195
    callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:202
    emit @ runtime-core.esm-bundler.js:726
    onOptionSelect @ index.mjs:515
    onClick @ index.mjs:1281
    callWithErrorHandling @ runtime-core.esm-bundler.js:195
    callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:202
    invoker @ runtime-dom.esm-bundler.js:693

What browsers do you use to access the UI ?

Google Chrome

Other

I think it makes sense to keep the behavior but convert the widgets to input and then connect. Otherwise add a null check here:

https://github.com/Comfy-Org/ComfyUI_frontend/blob/d8887a434d4aff1bce938e1ed5a5f0c0068131a8/src/types/litegraphTypes.ts#L57

christian-byrne commented 2 months ago

644 fixed the error that occurred from this.

In terms of the behavior, I'm not sure whether it's a good idea to automatically convert the primitive widgets to inputs when adding nodes from link-release. If not, then this issue can be closed.