stable-diffusion-webui-forge icon indicating copy to clipboard operation
stable-diffusion-webui-forge copied to clipboard

[Bug]: Forge Hardcodes ExtraNetworks Count

Open Haoming02 opened this issue 1 year ago • 0 comments

Checklist

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

What happened?

In Forge, the number of ExtraNetworks tabs is hardcoded at this line: https://github.com/lllyasviel/stable-diffusion-webui-forge/blob/main/javascript/extraNetworks.js#L628 (TI + HyN + CkPt + LoRA) * (txt + img) = 8

As a result, if an Extension registers a new tab, the length will become more than 8, causing the subsequent logics to never be executed, and thus breaking the whole ExtraNetworks functionalities.

This does not happen on the original Automatic1111 Webui.

Steps to reproduce the problem

  1. Write an Extension that registers a new ExtraNetwork tab
    • Such as: https://github.com/Haoming02/sd-webui-easy-tag-insert/tree/forge
      • Specifically the forge branch
  2. Launch the Webui
  3. See no filters and breaking functionalities
    • Such as not being able to add TI
    • Open the browser console to see the errors
  4. Change the 8 mentioned above to 10
  5. Reload UI
  6. See everything working correctly again

What should have happened?

IDK, not hardcode the number perhaps. The original Webui didn't do this afterall.

What browsers do you use to access the UI ?

Microsoft Edge

Sysinfo

Irrelevant

Console logs

extraNetworks.js?1708056612.0225787:171  Uncaught TypeError: extraNetworksApplyFilter[tabname_full] is not a function
    at doFilter (extraNetworks.js?1708056612.0225787:171:47)

Additional information

N/A

Haoming02 avatar Feb 16 '24 04:02 Haoming02