stable-diffusion
stable-diffusion copied to clipboard
Error running scripts/inptaint.py (no streamlit)
Hi, I'm trying to inpaint without streamlit using the scripts/inpaint.py but i get this error
Traceback (most recent call last):
File "scripts/inpaint.py", line 83, in <module>
c = model.cond_stage_model.encode(batch["masked_image"])
File "/home/ariel/repos/stable_inpaint/ldm/modules/encoders/modules.py", line 162, in encode
return self(text)
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ariel/repos/stable_inpaint/ldm/modules/encoders/modules.py", line 154, in forward
return_overflowing_tokens=False, padding="max_length", return_tensors="pt")
File "/opt/conda/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2452, in __call__
"text input must of type `str` (single example), `List[str]` (batch or single pretokenized example) "
ValueError: text input must of type `str` (single example), `List[str]` (batch or single pretokenized example) or `List[List[str]]` (batch of pretokenized examples).
Looking at the scripts/inpaint_st.pt i see some differences (For instance the inpatinting.py have no prompt used). I think the line
c = model.cond_stage_model.encode(batch["masked_image"])
should be
c = model.get_first_stage_encoding(model.encode_first_stage(batch["masked_image"]))
but it gives other errors. Can you check if scripts/inpaint.pt works as should be?