summaryrefslogtreecommitdiffstats
path: root/g4f/image.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-11 02:41:59 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-11 02:41:59 +0100
commitec51e9c76433b9e9498ade1dbe5de2268ad84218 (patch)
tree2876e373144f025949477601e89b8d478a49fafc /g4f/image.py
parentAdd word count from iG8R (diff)
downloadgpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.tar
gpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.tar.gz
gpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.tar.bz2
gpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.tar.lz
gpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.tar.xz
gpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.tar.zst
gpt4free-ec51e9c76433b9e9498ade1dbe5de2268ad84218.zip
Diffstat (limited to '')
-rw-r--r--g4f/image.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/g4f/image.py b/g4f/image.py
index d77654a6..5402f9c8 100644
--- a/g4f/image.py
+++ b/g4f/image.py
@@ -172,6 +172,7 @@ def process_image(image: Image, new_width: int, new_height: int) -> Image:
white = new_image('RGB', image.size, (255, 255, 255))
white.paste(image, mask=image.split()[-1])
return white
+ # Convert to RGB for jpg format
elif image.mode != "RGB":
image = image.convert("RGB")
return image
@@ -255,6 +256,9 @@ class ImageResponse:
def get(self, key: str):
return self.options.get(key)
+ def get_list(self) -> list[str]:
+ return [self.images] if isinstance(self.images, str) else self.images
+
class ImageRequest:
def __init__(
self,