From b95e10ac908014eaca580f8ca5a0cd77820b7eb9 Mon Sep 17 00:00:00 2001 From: Yao Chi Date: Tue, 16 Jul 2024 13:01:32 +0800 Subject: [PATCH] update limits of remove bg, and update the assert messages (#36) --- supernode.py | 2 +- utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/supernode.py b/supernode.py index 9a21e4db..0865875d 100644 --- a/supernode.py +++ b/supernode.py @@ -78,7 +78,7 @@ def remove_background(self, image): device = image.device _, w, h, _ = image.shape assert ( - w <= 1024 and h <= 1024 + w <= 1536 and h <= 1536 ), f"width and height must be less than 1024, but got {w} and {h}" payload = { diff --git a/utils.py b/utils.py index 9ccf3fda..0f04307d 100644 --- a/utils.py +++ b/utils.py @@ -115,7 +115,9 @@ def format_bytes(num_bytes: int) -> str: def validate_api_key(key: str): - assert isinstance(key, str), f"API_KEY must be a string, got {type(key)}" + assert isinstance( + key, str + ), f"API_KEY must be a string, got {type(key)}. Please refer to https://cloud.siliconflow.cn to get your API_KEY" assert key.startswith( "sk" ), f"invalid key, please refer to https://cloud.siliconflow.cn to get your API_KEY, got {key}"