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

KeyError: 'state_dict' from discord-stable-diffusion\src\stablediffusion\ldm\generate.py #15

Closed
YamakoVR opened this issue Nov 30, 2022 · 1 comment

Comments

@YamakoVR
Copy link

I have been following the following steps, using Windows 11 :

  • Installed CUBA Toolkit
  • Cloned the repository through Github Desktop
  • Ran setup.bat and completed the venv installation
  • Modified the run.bat file to fill the model.ckpt location and the Discord bot token
  • Tested /dream command with the following query : "a girl drinking soda"

Seeing the same error KeyError: 'state_dict' after multiple queries attempts, I uninstalled and redone all the above steps. But it's no use: there is still that same error.

Here's what happens from the cmd, and the displayed error on Discord :

Request -- YamakoKiasote#2844 -- Prompt: a girl drinking soda
[2022-11-30 15:20:59] INFO: Global seed set to 1105693868
[2022-11-30 15:20:59] INFO: Global seed set to 1070861717

Loading model from C:\Users\yamak\stable-diffusion\models\Stable-diffusion\model.ckpt
Traceback (most recent call last):
File "C:\Users\yamak\discord-stable-diffusion\src\bot\stablecog.py", line 161, in dream
samples, seed = self.text2image_model.dream(queue_object.prompt, queue_object.steps, False, False, 0.0,
File "C:\Users\yamak\discord-stable-diffusion\src\stablediffusion\text2image_compvis.py", line 64, in dream
results = self.generator.txt2img(prompt=prompt, iterations = 1, steps=ddim_steps, seed=seed, cfg_scale=cfg_scale, ddim_eta=ddim_eta, width=width, height=height, sampler_name=sampler_name, outdir='storage/outputs')
File "C:\Users\yamak\discord-stable-diffusion\src\stablediffusion\ldm\generate.py", line 175, in txt2img
return self.prompt2png(prompt, outdir, **kwargs)
File "C:\Users\yamak\discord-stable-diffusion\src\stablediffusion\ldm\generate.py", line 162, in prompt2png
results = self.prompt2image(prompt, **kwargs)
File "C:\Users\yamak\discord-stable-diffusion\src\stablediffusion\ldm\generate.py", line 263, in prompt2image
self.load_model()
File "C:\Users\yamak\discord-stable-diffusion\src\stablediffusion\ldm\generate.py", line 426, in load_model
model = self._load_model_from_config(config, self.weights)
File "C:\Users\yamak\discord-stable-diffusion\src\stablediffusion\ldm\generate.py", line 538, in _load_model_from_config
sd = pl_sd['state_dict']
KeyError: 'state_dict'

image

@YamakoVR
Copy link
Author

One solution found

You can update to the latest version of WD model

@YamakoVR YamakoVR closed this as completed Dec 7, 2022
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

1 participant