Comfy-Org / ComfyUI_frontend

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

Search function sometimes doesn't work as intended to be for some nodes #174

Closed kayselmecnun closed 1 month ago

kayselmecnun commented 3 months ago

I'm facing this problem every time I use the "SDXL Empty Latent Size Picker" node.

Typing "latent s" brings the node, while typing any other letter returns no results such as "latent sdxl", "empty latent", "sdxl latent"

chrome_zdjvsCYAJx chrome_WLRXyufouW

kayselmecnun commented 3 months ago

Update: With the latest v1.1.9, the search function works a bit differently. It doesn't act like the previous version and shows results. But the search function still doesn't act normally. See the examples below; The Goal is accessing the "SDXL Empty Latent Size Picker" node, when I type "SDXL Empty" it brings the correct node on top, but when I type "SDXL Laten", it brings unrelated results with my keywords on the top, and the node I'm looking is placed 8 scrolling below. chrome_y1NKNZ3KOL chrome_3ksoEPT0bQ

huchenlei commented 3 months ago

The search impl comes from https://www.fusejs.io/. As far as I know it just performs string distance based fuzzy search, i.e. how many operations is required to convert one string to another. So SDXL Latent gets you Empty"SD3Latent"Image is expected.

I am not sure if we need to use a more powerful search provider if later we expand the search range to all sorts of things.

huchenlei commented 3 months ago

BTW, the theme of search box seem to be wrong. Can you share your browser console log, and screenshot? The searchbox theme should follow your ComfyUI theme.

christian-byrne commented 3 months ago

The field length norm might be too high. After using it a while, it does seem to give a lot lower weight to longer names

huchenlei commented 3 months ago

You can tune the fuse search params to try get better experience. It does offer option to weight down or disable field norm / location.

    this.nodeFuseSearch = new FuseSearch(data, {
      keys: ["display_name"],
      includeScore: true,
      threshold: 0.6,
      shouldSort: true,
      ignoreFieldNorm: true,
      ignoreLocation: true,
    });
kayselmecnun commented 3 months ago

BTW, the theme of search box seem to be wrong. Can you share your browser console log, and screenshot? The searchbox theme should follow your ComfyUI theme.

chrome_HaWi7jXdOx 127.0.0.1-1721639801108.log

SirVeggie commented 1 month ago

The current search functionality should fix this issue, so this can probably be closed.