Open Aamir3d opened 1 year ago
me too, cant find case, the error that only occurred after today's upgrade will now be found in any image
I have looked at the error message and tried to solve it. The reason seems to be due to compatibility issues with gradio version. My guess is that our version is too high. Of course, this is just my assumption.
A temporary solution is to find the file gradio\components.py in venv\Lib\site-packages\gradio\components.py, around line 355. There are two functions, pil_to_temp_file and img_array_to_temp_file. I changed the code of these two functions as follows:
def pil_to_temp_file(self, img: _Image.Image, dir: str) -> str: bytes_data = processing_utils.encode_pil_to_bytes(img, "png") temp_dir = Path(dir) / self.hash_bytes(bytes_data) temp_dir.mkdir(exist_ok=True, parents=True) filename = str(temp_dir / f"image.png") img.save(filename, pnginfo=processing_utils.get_pil_metadata(img)) return filename
def img_array_to_temp_file(self, arr: np.ndarray, dir: str) -> str: pil_image = _Image.fromarray( processing_utils._convert(arr, np.uint8, force_copy=False) ) return self.pil_to_temp_file(pil_image, dir)
I deleted the variable format in these two functions and finally solved the problem. I hope the author will consider this compatibility issue.
I also have the same error, i hope they can fix it
https://github.com/opparco/stable-diffusion-webui-two-shot/issues/54 I believe this link is referring to a similar error. I hope it gets resolved soon.
我也是,不过把stabel diffusion更新到最新的2023.06.27版本后,这个问题就消失了。
Modify file modules\ui_tempdir.py line 34 add param: format="png"
def save_pil_to_file(self, pil_image, dir=None, format="png"):
Running on Automatic1111
This error appears when an image is uploaded or dragged (it doesn't matter if the image is JPG or PNG).