save as png
This commit is contained in:
parent
71fb0c29bc
commit
1ab70c790b
|
@ -27,9 +27,9 @@ def ascii_from_image(image: Image.Image, size: int = 128) -> str:
|
||||||
|
|
||||||
def save_image(image: Image.Image, path: str):
|
def save_image(image: Image.Image, path: str):
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
path = os.path.join(path, 'generated.jpg')
|
path = os.path.join(path, 'generated.png')
|
||||||
elif not path.endswith('.jpg'):
|
elif not path.endswith('.png'):
|
||||||
path += '.jpg'
|
path += '.png'
|
||||||
print("saving image to", path)
|
print("saving image to", path)
|
||||||
image.save(path)
|
image.save(path)
|
||||||
return image
|
return image
|
||||||
|
@ -76,4 +76,4 @@ if __name__ == '__main__':
|
||||||
image_path=args.image_path,
|
image_path=args.image_path,
|
||||||
models_root=args.models_root,
|
models_root=args.models_root,
|
||||||
fp16=args.fp16,
|
fp16=args.fp16,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user