Add apikey_override to easy joycaption2API

This commit is contained in:
yolain
2025-05-06 12:56:07 +08:00
parent a3f487c822
commit 0f5ad38384
2 changed files with 10 additions and 3 deletions
+5 -2
View File
@@ -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 = {
+5 -1
View File
@@ -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,)