Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Lora search is not working #16389

Closed
3 of 6 tasks
SeregaJA opened this issue Aug 15, 2024 · 7 comments
Closed
3 of 6 tasks

[Bug]: Lora search is not working #16389

SeregaJA opened this issue Aug 15, 2024 · 7 comments

Comments

@SeregaJA
Copy link

SeregaJA commented Aug 15, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

Lora search is not working. Lora is only shown in the "ALL" tab. If I try to search for Lora by name or subfolders, nothing is shown. This problem only occurs with Lora. Searching for checkpoint or Textual Inversion works correctly.

image
All tab. Lora is there.

image
Subfolder search tab. They are no longer there, although all lora from the picture above are inside that subfolder

image
Word search. For example, I'm trying to type in "Smoo", because there is definitely Lora that has those letters in its name. But it still comes up empty.

image
I do the same thing for checkpoints. And it works.

Steps to reproduce the problem

  1. Run WebUI
  2. Go to the Lora tab
  3. Try to use lora search

What should have happened?

WebUI should have sorted the lora into subfolders and shown them. It should also be able to find lora by name.

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

Windows 10,
Python: 3.10.6,
Version: v1.10.1,
Commit: 82a973c,
Commandline args --no-half-vae --opt-sub-quad-attention --xformers

Console logs

venv "F:\folder\SDP\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --no-half-vae --opt-sub-quad-attention --xformers
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
Loading weights [821aa5537f] from F:\folder\SDP\models\Stable-diffusion\PonyXL\autismmixSDXL_autismmixPony.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: F:\folder\SDP\repositories\generative-models\configs\inference\sd_xl_base.yaml
F:\folder\SDP\venv\lib\site-packages\huggingface_hub\file_download.py:1150: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Startup time: 28.2s (prepare environment: 15.5s, import torch: 3.9s, import gradio: 1.0s, setup paths: 1.1s, initialize shared: 0.3s, other imports: 0.7s, load scripts: 3.8s, create ui: 0.8s, gradio launch: 1.1s).
Loading VAE weights specified in settings: F:\folder\SDP\models\VAE\sdxl_vae.safetensors
Applying attention optimization: xformers... done.
Textual inversion embeddings loaded(2): zPDXL2, zPDXL2-neg
Model loaded in 10.3s (load weights from disk: 1.1s, create model: 0.7s, apply weights to model: 6.8s, load VAE: 0.3s, move model to device: 0.1s, calculate empty prompt: 1.0s).

Additional information

No response

@SeregaJA SeregaJA added the bug-report Report of a bug, yet to be confirmed label Aug 15, 2024
@w-e-w
Copy link
Collaborator

w-e-w commented Aug 15, 2024

try these these

since it's still working on my system it's most likely something on your system has changed causing the issue
try the following stuff and post screenshots or results

  • use a different web browser to see if the issue persist across different browsers
  • see if theres any obvious errors by using the debug consol
    press F12 to open the debug consol and search something in the search bar, see if there any errors when you search for terms
    image
  • try pressing ctrl shift C you and click and select a card
    you should see something like this
    image
    input search terms into the search bar you should be able to see some cars class will be changed formcard and card hidden

@SeregaJA
Copy link
Author

SeregaJA commented Aug 16, 2024

try these these

since it's still working on my system it's most likely something on your system has changed causing the issue try the following stuff and post screenshots or results

  • use a different web browser to see if the issue persist across different browsers
  • see if theres any obvious errors by using the debug consol
    press F12 to open the debug consol and search something in the search bar, see if there any errors when you search for terms
    image
  • try pressing ctrl shift C you and click and select a card
    you should see something like this
    image
    input search terms into the search bar you should be able to see some cars class will be changed formcard and card hidden

The problem persists in all my browsers. (cent, google, brave, edge, etc). In cent there is one unique problem - the extra networks controls are a bit broken (no such problem in edge.) But it doesn't make any difference.

image
Here's a screenshot from cent

image
Here's a screenshot from edge

image
image
Here's an example: Smooth Style lora

Yes, I'm having cards class change. Whenever I use the lora search string, all cards change their class to hidden, even if they shouldn't. The same thing happens in other browsers.

image

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 16, 2024

that's very odd it's like it's working but it's not

not sure if it's related but the the strange icon thing is a bit familiar, there was a bug report on this a couple of days ago but it suddenly fixed itself after upgrading Chrome


also please upload the Sysinfo like we requested in the issue template
it gives us detail information about your webui install, including your settings among other potentially useful information for debug

id: sysinfo
attributes:
label: Sysinfo
description: System info file, generated by WebUI. You can generate it in settings, on the Sysinfo page. Drag the file into the field to upload it. If you submit your report without including the sysinfo file, the report will be closed. If needed, review the report to make sure it includes no personal information you don't want to share. If you can't start WebUI, you can use --dump-sysinfo commandline argument to generate the file.
placeholder: |
1. Go to WebUI Settings -> Sysinfo -> Download system info.
If WebUI fails to launch, use --dump-sysinfo commandline argument to generate the file
2. Upload the Sysinfo as a attached file, Do NOT paste it in as plain text.


new debug plan

  1. in Chrome press F12 open debug consol
  2. under Sources > Page > find the file 127.0.0.1:xxxx > file=javascript > extraNetworks.js and open it
  3. at around line number 67 add the below code and then press ctrl + s to save it
console.log(`${searchTerm}\n${text}\n${visible}`);

image
5. then goto Consol tab
6. now on lora tab start searching for something and see the output

the line of code we just added basically makes it prints out what it's doing during the filter process
when you start searching you will see it's prints out lots of stuff and each group
is

line 1: search term (the text you just input into the lora search box)
line 2: the text being searched (like the lora name and path)
line 3: true / false if a match is found

image

tips:

  • if you're overwhelmed with text all the consol outputs, you can click the clear console button found near the top right of the console
  • you can press ctrl + f, search for text in the console this will help you locate a certain item

see if you can find an example that you think it should match but it didn't

basically you can search for say PonyXL in lora search and then search consol output for PonyXL see if there's any strange results
and maybe post a screenshot

note if the text is too long the text would wrap around as if it's a new line, so you might see more than 3 lines in a block
note: the modification we did to that file is temporary, once you refresh the page with like with F5 it's gone

@SeregaJA
Copy link
Author

image
image

When I paste this code I only get a search for checkpoints. Lora just didn't show up in the search. That is, the search gives "true" for models that are in a similarly named folder (in the models directory only), and the search gives "false" for models that are not relevant to the written.

(p.s. I'll try changing the name of the model subfolder so it doesn't match the name of the lora subfolder.)
After renaming the subfolder for models from PonyXL to XL (so that the lora subfolder named PonyXL has unique name). The search still only shows checkpoints and not lora. And this time it turns out to be "false" (obviously)

image

But the question still remains. Why the lora search does not search among lora, but among checkpoints

sysinfo.json

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 16, 2024

When I paste this code I only get a search for checkpoints. Lora just didn't show up in the search

based on what's written inside sysinfo I have reason to believe that you webui instance is somehow modified

HEAD detached from 68f336bd
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   extensions-builtin/LDSR/sd_hijack_ddpm_v1.py
	modified:   extensions-builtin/Lora/extra_networks_lora.py
	modified:   extensions-builtin/Lora/lyco_helpers.py
	modified:   extensions-builtin/Lora/network.py
	modified:   extensions-builtin/Lora/network_full.py
	modified:   extensions-builtin/Lora/network_hada.py
	modified:   extensions-builtin/Lora/network_ia3.py
	modified:   extensions-builtin/Lora/network_lokr.py
	modified:   extensions-builtin/Lora/network_lora.py
	modified:   extensions-builtin/Lora/networks.py
	modified:   extensions-builtin/Lora/preload.py
	modified:   extensions-builtin/Lora/scripts/lora_script.py
	modified:   extensions-builtin/Lora/ui_edit_user_metadata.py
	modified:   extensions-builtin/Lora/ui_extra_networks_lora.py
	modified:   extensions-builtin/ScuNET/scripts/scunet_model.py
	modified:   extensions-builtin/SwinIR/scripts/swinir_model.py
	modified:   extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js
	modified:   extensions-builtin/canvas-zoom-and-pan/scripts/hotkey_config.py
	modified:   extensions-builtin/canvas-zoom-and-pan/style.css
	modified:   extensions-builtin/extra-options-section/scripts/extra_options_section.py
	modified:   extensions-builtin/mobile/javascript/mobile.js
	deleted:    javascript/edit-order.js
	deleted:    javascript/generationParams.js
	deleted:    javascript/hires_fix.js
	deleted:    javascript/imageMaskFix.js
	deleted:    javascript/imageviewerGamepad.js
	deleted:    javascript/textualInversion.js
	deleted:    javascript/ui_settings_hints.js
	modified:   webui-user.bat
Untracked files:
  (use "git add <file>..." to include in what will be committed)

and this is highly likely the cause of this entire issue

there's two ways you can possibly resolve this

  • first method which requires less technical knowledge "do a complete fresh install webui"
    you have done this before when you first installed it so you know how to do it

you can keep the old one as a backup until you make sure the new one is working

  • second method, try to restore the current installation using git

backup webui-user.bat to a difrent place then run this git command in the root directory of your webui

git checkout -f master

this shoud reset everything normal
you can run this command to confirm if this is the case

git status

the output shoud be like this

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

after this you can restore webui-user.bat form the backup


suspect you end up in this situation because you possibly tried running some git commands yourself in the past and possibly messed up


But the question still remains. Why the lora search does not search among lora, but among checkpoints

this doesn't matter, it's just how it is implemented, the search is applied across the entire web page including the hidden tabs, it doesn't change the functionality

@SeregaJA
Copy link
Author

Thank you so much. That really helped! Now the lora search is working as it should.

P.S:
I recently did a clean install, but due to some problem I didn't have WebUI installed. On the command line then there was a python module compatibility error or something like that. Some items didn't match the module versions for some reason, causing everything to crash. I had to use GPT to edit some files. And only after that I started to get the WebUI to load. And it worked fine until I decided to sort lora for convenience. And now we are here.

@w-e-w
Copy link
Collaborator

w-e-w commented Aug 16, 2024

I think it might be a good idea to enforce that Sysinfo needs to be provided unless there's adequate reason totherwise the issue could be closed

if Sysinfo was provided properly as we have specified in the template
the issue could have been identified from the beginning
and I wouldn't have to waste hours trying to provide possible debug solutions

@w-e-w w-e-w removed the bug-report Report of a bug, yet to be confirmed label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants