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

[Bug]: Vae not loaded at startup if selected, it is loaded after first generation.

Open Dasor92 opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

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

What happened?

When you start the application the VAE selected is not loaded. it says: Couldn't find VAE named vae-ft-mse-840000-ema-pruned.safetensors; using None instead It is loaded after the first image generation.

Steps to reproduce the problem

  1. Open Webui
  2. Select a VAE
  3. Restart Webui
  4. Observe that the VAE is not loaded
  5. Try generating an image
  6. The VAE is now loaded

What should have happened?

VAE should load at startup

Commit where the problem happens

b08500c

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--no-half-vae

List of extensions

No

Console logs

Creating model from config: D:\Programmi\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Couldn't find VAE named vae-ft-mse-840000-ema-pruned.safetensors; using None instead
Applying scaled dot product cross attention optimization.

Additional information

No response

Dasor92 avatar May 14 '23 00:05 Dasor92

Me too

AcidChristLab avatar May 14 '23 14:05 AcidChristLab

Addendum: Loras too have the same problem, loaded after first generation.

Dasor92 avatar May 15 '23 09:05 Dasor92

Same here, it appeared after git pull

OedoSoldier avatar May 22 '23 19:05 OedoSoldier

Happens with both the .ckpt and .safetensors versions of the VAE.

ashleykleynhans avatar May 25 '23 17:05 ashleykleynhans

For me, VAE never seems to load. During startup, I get this error:

Couldn't find VAE named AnythingV5.vae.pt; using None instead

Tried multiple VAEs, .vae.pt or .safetensors, no difference. The only way I get a functionnal VAE is by selecting None, then selecting the VAE I want. I must do this everytime I restart.

Alyndiar avatar Jun 03 '23 06:06 Alyndiar

Same here.

chouti avatar Jun 03 '23 09:06 chouti

I removed/deleted dreambooth extension from extensions folder and did pip uninstall Pillow, gitpython, transformers, google-auth-oauthlib, fastapi. This fixed my VAE loading issue. I did these 2 steps together, so do not really know which of these fixed the issue.

Edit: reinstalled dreambooth again and the Missing VAE issue came back. For now, dirty solution is by selecting None and selecting VAE again in the UI.

Sniper199999 avatar Jun 03 '23 12:06 Sniper199999

This happens because VAE is attempted to load during modules.scripts.load_scripts() in initialize_rest in webui.py, (line 274)

but since modules.sd_vae.refresh_vae_list() hasn't run yet (line 284), vae_list is empty at this stage, leading to VAE not loading at startup but able to be loaded once the UI has come up.

Not sure why VAEs would be attempted to load during the script loading stage, but the simplest workaround is running modules.sd_vae.refresh_vae_list() before modules.scripts.load_scripts(). But I'm not sure if it will have any repercussions.

Another more tame workaround would be to modify the function resolve_vae in modules/sd_vae.py, so that it will first check whether vae_list is empty, then run refresh_vae_list() if true.

But more importantly... if this problem is caused by scripts/extensions outside of this repo, is it appropriate to apply the "fix" here?

nyqui avatar Jun 04 '23 05:06 nyqui

I have this too. My Version is up to date and I have neither Dreambooth or vraam-estminator installed. Couldn't find VAE named vae-ft-mse-840000-ema-pruned.ckpt; using None instead

OldManSimmer62 avatar Jun 04 '23 19:06 OldManSimmer62

Can confirm https://github.com/7eu7d7/DreamArtist-stable-diffusion is also causing the error (I installed it a long time ago and didn't delete it)

OedoSoldier avatar Jun 04 '23 20:06 OedoSoldier

me too

ParticleDog avatar Jun 05 '23 19:06 ParticleDog

Same here, without 2 extensions mentioned above. So how to fix this?

Losquit avatar Jun 27 '23 09:06 Losquit

Having this issue in the recent build as well. Default VAE was loading just fine and then it just suddenly stopped loading. Even after generating first image doesn't do anything. I have to manually load it myself.

RaXorX avatar Jul 20 '23 08:07 RaXorX