diff --git a/py/libs/api/bizyair.py b/py/libs/api/bizyair.py index 925acc6..320ae4b 100644 --- a/py/libs/api/bizyair.py +++ b/py/libs/api/bizyair.py @@ -57,8 +57,11 @@ class BizyAIRAPI: ) # joycaptionTwo - def joyCaption2(self, payload, image): - api_key = self.getAPIKey() + def joyCaption2(self, payload, image, apikey_override=None): + if apikey_override is not None: + api_key = apikey_override + else: + api_key = self.getAPIKey() url = f"{self.base_url}/supernode/joycaption2" auth = f"Bearer {api_key}" headers = { diff --git a/py/nodes/api.py b/py/nodes/api.py index 578a51a..2e8702b 100644 --- a/py/nodes/api.py +++ b/py/nodes/api.py @@ -101,6 +101,9 @@ class joyCaption2API: "multiline": True, }, ), + }, + "optional":{ + "apikey_override": ("STRING", {"default": "", "forceInput": True, "tooltip":"Override the API key in the local config"}), } } @@ -123,6 +126,7 @@ class joyCaption2API: extra_options, name_input, custom_prompt, + apikey_override=None ): pbar = comfy.utils.ProgressBar(100) pbar.update_absolute(10) @@ -145,7 +149,7 @@ class joyCaption2API: } pbar.update_absolute(30) - caption = bizyairAPI.joyCaption2(payload, image) + caption = bizyairAPI.joyCaption2(payload, image, apikey_override) pbar.update_absolute(100) return (caption,)