summaryrefslogtreecommitdiffstats
path: root/g4f/image.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-03-11 07:47:35 +0100
committerGitHub <noreply@github.com>2024-03-11 07:47:35 +0100
commit0b850ac9fcabc52fecdeea8d56e620e44b35d180 (patch)
treef92578686f34476be49422889d4587d8f3cf2fa6 /g4f/image.py
parentMerge pull request #1670 from xtekky/xtekky-patch-1 (diff)
parentFix HuggingChat and PerplexityLabs and add HuggingFace provider (diff)
downloadgpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.tar
gpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.tar.gz
gpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.tar.bz2
gpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.tar.lz
gpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.tar.xz
gpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.tar.zst
gpt4free-0b850ac9fcabc52fecdeea8d56e620e44b35d180.zip
Diffstat (limited to 'g4f/image.py')
-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,