Add apikey_override to easy joycaption2API
This commit is contained in:
@@ -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
@@ -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,)
|
||||
|
||||
Reference in New Issue
Block a user