AUTOMATIC1111 / stable-diffusion-webui-rembg

Removes backgrounds from pictures. Extension for webui.
MIT License
1.17k stars 173 forks source link

TypeError: a bytes-like object is required, not 'str' #25

Closed Json-exe closed 4 months ago

Json-exe commented 1 year ago

When trying to do anything with this extension I get the error TypeError: a bytes-like object is required, not 'str'. Does anyone have a solution for this problem? Or maybe someone has the same problem?

mdkberry commented 1 year ago

Yes but I only get that error message when I try to Send it img2img, or inpaint, or extras.

It still works to remove backgrounds before and after the error message, but it wont send anywwhere. so I have to open the image in a browser tab and save it manually and then reload it elsewhere.

I am using it installed from the Extensions tab inside SD which is running in Conda environment on Windows 10.

version: stable-diffusion-webui-rembg | https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg.git | master | 3d9eedbb | Sun Jun 4 13:35:24 2023

here is my error:

Traceback (most recent call last): File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict output = await app.get_blocks().process_api( File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data prediction_value = block.postprocess(prediction_value) File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1864, in postprocess return processing_utils.encode_pil_to_base64(y) File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 85, in encode_pil_to_base64 bytes_data = encode_pil_to_bytes(pil_image) File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 80, in encode_pil_to_bytes pil_image.save(output_bytes, format, pnginfo=get_pil_metadata(pil_image)) File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 2432, in save save_handler(self, fp, filename) File "C:\Users\admin\Documents\Python\stablediffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1318, in _save data = name + b"\0\0" + zlib.compress(icc) TypeError: a bytes-like object is required, not 'str'