pesser / stable-diffusion

MIT License
1.03k stars 401 forks source link

KeyError: 'image' in stable-diffusion/ldm/models/diffusion/ddpm.py" #6

Open bartman081523 opened 2 years ago

bartman081523 commented 2 years ago

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