diff --git a/image_from_text.py b/image_from_text.py index 9008253..75b6b71 100644 --- a/image_from_text.py +++ b/image_from_text.py @@ -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 diff --git a/replicate/predict.py b/replicate/predict.py index f14d853..fbf7c98 100644 --- a/replicate/predict.py +++ b/replicate/predict.py @@ -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 \ No newline at end of file