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]: Vae not loaded at startup if selected, it is loaded after first generation. #10355

Open
1 task done
Dasor92 opened this issue May 14, 2023 · 14 comments
Open
1 task done
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@Dasor92
Copy link

Dasor92 commented May 14, 2023

Is there an existing issue for this?

  • 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 Dasor92 added the bug-report Report of a bug, yet to be confirmed label May 14, 2023
@AcidChristLab
Copy link

Me too

@Dasor92
Copy link
Author

Dasor92 commented May 15, 2023

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

@OedoSoldier
Copy link
Contributor

Same here, it appeared after git pull

@ashleykleynhans
Copy link

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

@Alyndiar
Copy link

Alyndiar commented Jun 3, 2023

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.

@chouti
Copy link

chouti commented Jun 3, 2023

Same here.

@Sniper199999
Copy link

Sniper199999 commented Jun 3, 2023

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.

@nyqui
Copy link
Contributor

nyqui commented Jun 4, 2023

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
Copy link
Contributor

nyqui commented Jun 4, 2023

Confirmed problems when space-nuko/a1111-stable-diffusion-webui-vram-estimator AND/OR d8ahazard/sd_dreambooth_extension installed.

@OldManSimmer62
Copy link

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

@OedoSoldier
Copy link
Contributor

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)

@ParticleDog
Copy link

me too

@Losquit
Copy link

Losquit commented Jun 27, 2023

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

@RaXorX
Copy link

RaXorX commented Jul 20, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests