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: 'image' in stable-diffusion/ldm/models/diffusion/ddpm.py" #6

Open
bartman081523 opened this issue Aug 5, 2022 · 0 comments

Comments

@bartman081523
Copy link

bartman081523 commented Aug 5, 2022

trying to run inpainting with the inpaint_big downloaded model. Changed the checkpoint and config path in inpainting-demo.
but this error appears:
(I think ddpm.py wants 512x512 RGBA image and streamlit gives 2x 512x512 RGB one image and one mask. But I have no clue.)

2022-08-05 11:42:22.357 Uncaught app exception
Traceback (most recent call last):
  File "/usr/local/envs/ldm/lib/python3.8/site-packages/streamlit/scriptrunner/script_runner.py", line 557, in _run_script
    exec(code, module.__dict__)
  File "/content/stable-diffusion/scripts/demo/inpainting.py", line 194, in <module>
    samples = sample(
  File "/content/stable-diffusion/scripts/demo/inpainting.py", line 38, in sample
    z, c, x, xrec, xc = self.get_input(batch, self.first_stage_key, bs=N, return_first_stage_outputs=True)
  File "/usr/local/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/content/stable-diffusion/ldm/models/diffusion/ddpm.py", line 718, in get_input
    x = super().get_input(batch, k)
  File "/content/stable-diffusion/ldm/models/diffusion/ddpm.py", line 383, in get_input
    x = batch[k]
KeyError: 'image'
###
(512, 512, 3)
(512, 512, 3)
###

this is the colab notebook:
https://colab.research.google.com/drive/1iglh0P7CxYtJEf4N5K68RhNr9CJMzYa_?usp=sharing

@bartman081523 bartman081523 changed the title KeyError: 'image' in /content/stable-diffusion/ldm/models/diffusion/ddpm.py" KeyError: 'image' in stable-diffusion/ldm/models/diffusion/ddpm.py" Aug 5, 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