FIX 网络请求加上鉴权
This commit is contained in:
parent
bf68de4ac2
commit
5bfeb88724
|
|
@ -329,11 +329,13 @@ class ModalClothesMask:
|
||||||
job_id = job_resp["taskId"]
|
job_id = job_resp["taskId"]
|
||||||
|
|
||||||
wait_time = 240
|
wait_time = 240
|
||||||
interval = 3
|
interval = 2
|
||||||
logger.info("开始轮询任务状态")
|
logger.info("开始轮询任务状态")
|
||||||
|
sleep(1)
|
||||||
for _ in range(0, wait_time, interval):
|
for _ in range(0, wait_time, interval):
|
||||||
logger.info("查询任务状态")
|
logger.info("查询任务状态")
|
||||||
result = send_request("get", f"https://{endpoint}/google/{job_id}", timeout=timeout)
|
result = send_request("get", f"https://{endpoint}/google/{job_id}",
|
||||||
|
headers={'Authorization': 'Bearer bowong7777'}, timeout=timeout)
|
||||||
if result.status_code == 200:
|
if result.status_code == 200:
|
||||||
result = result.json()
|
result = result.json()
|
||||||
if result["status"] == "success":
|
if result["status"] == "success":
|
||||||
|
|
@ -355,7 +357,7 @@ class ModalEditCustom:
|
||||||
return {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"image": ("IMAGE",),
|
"image": ("IMAGE",),
|
||||||
"prompt": ("STRING", {"default": "将背景去除,输出原尺寸图片","multiline": True}),
|
"prompt": ("STRING", {"default": "将背景去除,输出原尺寸图片", "multiline": True}),
|
||||||
"endpoint": ("STRING", {"default": "bowongai-dev--bowong-ai-video-gemini-fastapi-webapp.modal.run"}),
|
"endpoint": ("STRING", {"default": "bowongai-dev--bowong-ai-video-gemini-fastapi-webapp.modal.run"}),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -391,11 +393,13 @@ class ModalEditCustom:
|
||||||
job_id = job_resp["taskId"]
|
job_id = job_resp["taskId"]
|
||||||
|
|
||||||
wait_time = 240
|
wait_time = 240
|
||||||
interval = 3
|
interval = 2
|
||||||
logger.info("开始轮询任务状态")
|
logger.info("开始轮询任务状态")
|
||||||
|
sleep(1)
|
||||||
for _ in range(0, wait_time, interval):
|
for _ in range(0, wait_time, interval):
|
||||||
logger.info("查询任务状态")
|
logger.info("查询任务状态")
|
||||||
result = send_request("get", f"https://{endpoint}/google/{job_id}", timeout=timeout)
|
result = send_request("get", f"https://{endpoint}/google/{job_id}",
|
||||||
|
headers={'Authorization': 'Bearer bowong7777'}, timeout=timeout)
|
||||||
if result.status_code == 200:
|
if result.status_code == 200:
|
||||||
result = result.json()
|
result = result.json()
|
||||||
if result["status"] == "success":
|
if result["status"] == "success":
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue