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

[Bug]: Large extra networks UI causes hundreds of megabytes of network transfer

Open space-nuko opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

With #8742 the issue of startup speed being tanked by building the extra networks UI is solved, however it still has to be sent over the network. Having several thousand LoRA files, I intercepted the data transferred and it was over 148MB minified (15MB compressed), nearly all of which was concentrated in the two extra networks pages

That amounts to 15 seconds it takes for the backend to GZip all that data and 25 seconds until First Contentful Paint, quite punishing if you need to reload the webui for anything

So there has to be a relatively sane way to keep all that data on the backend and inject it into the page only when it's necessary, especially since I don't even use the extra networks UI

And no I don't think this is a problem with my LoRA collecting habits, if there's potential performance improvements to be had by figuring out how not to transfer all that data at once then everyone who uses webui can benefit, also this is causing outright crashes like #8418 so it's a rather critical issue

Steps to reproduce the problem

  1. Load a lot of extra networks (hypernetworks, embeddings, LoRAs)
  2. Load/refresh the webui and time how long it takes

What should have happened?

Reloading the page shouldn't take 40 seconds

Commit where the problem happens

a9fed7c3

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome

Command Line Arguments

--opt-sdp-attention --disable-nan-check --listen --enable-insecure-extension-access --gradio-inpaint-tool color-sketch --allow-code --no-half-vae --lora-dir G:/model/lora

List of extensions

additional_networks

Console logs

N/A

Additional information

No response

space-nuko avatar Mar 21 '23 08:03 space-nuko

How's this? https://github.com/missionfloyd/stable-diffusion-webui/commit/1d096ed1456c9b9b662477839853621848705e68

Or this? https://github.com/missionfloyd/stable-diffusion-webui/commit/b802e0707d1c758a37cadf1a158988a326348bd8 Sets background-image with javascript instead.

missionfloyd avatar Mar 21 '23 22:03 missionfloyd

Curious if/how this is affected by 9ed04e759d8b4a84db1f0e37abee59178fe1f586 as mentioned in https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8742#issuecomment-1483749304.

evanjs avatar Mar 25 '23 15:03 evanjs

@evanjs https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8742#issuecomment-1483859798

space-nuko avatar Mar 25 '23 16:03 space-nuko