simplet2i: changed image file handling to work as stated in the [docs](https://pillow.readthedocs.io/en/stable/reference/open_files.html)

This commit is contained in:
yun saki 2022-08-26 14:13:16 +02:00
parent 89805a5239
commit 5129f256a3

View File

@ -545,7 +545,9 @@ class T2I:
return model
def _load_img(self, path):
image = Image.open(path).convert('RGB')
with Image.open(path) as img:
image = img.convert("RGB")
w, h = image.size
print(f'loaded input image of size ({w}, {h}) from {path}')
w, h = map(