png -> jpg

This commit is contained in:
Brett Kuprel 2022-07-04 07:38:16 -04:00
parent a21ea6ea14
commit a79d30f718
2 changed files with 4 additions and 4 deletions

View File

@ -27,9 +27,9 @@ def ascii_from_image(image: Image.Image, size: int) -> str:
def save_image(image: Image.Image, path: str):
if os.path.isdir(path):
path = os.path.join(path, 'generated.png')
elif not path.endswith('.png'):
path += '.png'
path = os.path.join(path, 'generated.jpg')
elif not path.endswith('.jpg'):
path += '.jpg'
print("saving image to", path)
image.save(path)
return image

View File

@ -25,7 +25,7 @@ class Predictor(BasePredictor):
)
) -> Path:
image = self.model.generate_image(text, seed, grid_size=grid_size)
out_path = Path(tempfile.mkdtemp()) / 'output.png'
out_path = Path(tempfile.mkdtemp()) / 'output.jpg'
image.save(str(out_path))
return out_path