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]: sd-civitai-browser-plus continually increases Ram uses when updating Lora's tags/info #116

Open
3 of 6 tasks
metapea opened this issue Aug 9, 2024 · 2 comments
Open
3 of 6 tasks

Comments

@metapea
Copy link

metapea commented Aug 9, 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?

Main details Here.
When using updating Loras tags/preview images, ram uses keeps going until physical memory is being used at 99% percent and the webui tab goes at 10GB in ram uses when there's a lot of lora info to update.
Also note this happen in OG forge as well when downloading with the extension.

Steps to reproduce the problem

  1. Have a large amount of loras
  2. Click on loras for update
  3. Click on the update button for info and tags

What should have happened?

Update tags/info/preview images without high ram uses.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

N/A

Console logs

N/A, No error log

Additional information

The issue is caused by an extension, but I believe it is caused by a bug in the webui

There was a workaround on reForge's older commits (on the main branch), where if you use ARG like --ui-debug-mode before starting your checkpoint, updating lora used around 0.5GB of RAM, until i updated to the latest commit where the webui tab keep increasing the ram regardless of if i started the checkpoint.

@metapea metapea changed the title [Bug]: sd-civitai-browser-plus continually increase Ram uses when updating tags [Bug]: sd-civitai-browser-plus continually increases Ram uses when updating Lora's tags/info Aug 9, 2024
@ExissNA
Copy link

ExissNA commented Aug 23, 2024

Yeah, it's painful, isn't it? I have to move 3/4 of my resources to a folder that didn't have a link to the webui just to get Forge to be able to load. Now I'm trying to move to reForge and it's not working so well either.

@metapea
Copy link
Author

metapea commented Nov 19, 2024

I found the cause, and it's --ui-debug-mode .
At first when the Webui tab starts, reforge spams for a while:

Stable diffusion model failed to load
loading stable diffusion model: FileNotFoundError
Traceback (most recent call last):
  File "threading.py", line 973, in _bootstrap
  File "threading.py", line 1016, in _bootstrap_inner
  File "X:\Reforge\system\python\lib\site-packa
ges\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "X:\Reforge\system\python\lib\site-packa
ges\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "X:\Reforge\webui\modules\ui_extra_netwo
rks.py", line 785, in pages_html
    create_html()
  File "X:\Reforge\webui\modules\ui_extra_netwo
rks.py", line 781, in create_html
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pa
ges]
  File "X:\Reforge\webui\modules\ui_extra_netwo
rks.py", line 781, in <listcomp>
    ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pa
ges]
  File "X:\Reforge\webui\modules\ui_extra_netwo
rks.py", line 589, in create_html
    self.items = {x["name"]: x for x in items_list}
  File "X:\Reforge\webui\modules\ui_extra_netwo
rks.py", line 589, in <dictcomp>
    self.items = {x["name"]: x for x in items_list}
  File "X:\Reforge\webui\extensions-builtin\Lor
a\ui_extra_networks_lora.py", line 82, in list_items
    item = self.create_item(name, index)
  File "X:\Reforge\webui\extensions-builtin\Lor
a\ui_extra_networks_lora.py", line 63, in create_item
    if shared.opts.lora_show_all or not enable_filter or not shared.sd_model:
  File "X:\Reforge\webui\modules\shared_items.p
y", line 178, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "X:\Reforge\webui\modules\sd_models.py",
 line 569, in get_sd_model
    load_model()
  File "X:\Reforge\webui\modules\sd_models.py",
 line 657, in load_model
    checkpoint_info = checkpoint_info or select_checkpoint()
  File "X:\Reforge\webui\modules\sd_models.py",
 line 238, in select_checkpoint
    raise FileNotFoundError(error_message)
FileNotFoundError: No checkpoints found. When searching for checkpoints, looked
at:
 - file X:\Reforge\webui\model.ckpt
 - directory X:\Reforge\webui\models\Stable-dif
fusionCan't run without a checkpoint. Find and place a .ckpt or .safetensors fil
e into any of those locations.  

Until it stops, and when using CivitAI Browser+ (without checkpoint on autostart), it lags with clicks on other loras (#358), white screen cutoffs that sometimes even freezes (#358), downloads being laggy with high ram use, One-Time Hash Generation/updating tags/downloading preview images on the extension's Update Models tab uses high amounts of ram until the OS exit/stops the webui tab on the browser (#116, #318), and can keep/gets stuck loading when click on the next page/model/model's version (#344).
When the checkpoint model is loaded, the lora tab, can load the same checkpoint model another time while the main checkpoint is still active (now using more ram with python) and pnginfo also keeps using high amounts of ram with the browser's webui tab (#135)
I only found this out since i notice that the webui and CivitAI Browser+ was faster while/before the error was spammed.
I been using --ui-debug-mode since --skip-load-model-at-start hasn't been working.
With --skip-load-model-at-start it still loads autoload the checkpoint models, but i get none of bugs/issues so far.
You can tell you're in debug mode as well.
Debug:
Screenshot7
Without Debug:
Screenshot8

Edit: After generating without debug mode, another issue (#157) seems to be from --ui-debug-mode as well

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