From ec51e9c76433b9e9498ade1dbe5de2268ad84218 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 11 Mar 2024 02:41:59 +0100 Subject: Fix HuggingChat and PerplexityLabs and add HuggingFace provider Add more models and image generation in You provider Use You as second default image provider --- g4f/image.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'g4f/image.py') 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, -- cgit v1.2.3