| 1234567891011121314151617181920212223242526 |
- # from PIL import Image
- # from settings import recordDataPoint
- import time
- from service.online_request.module_online_data import OnlineDataRequest,AIGCDataRequest
- aigc = AIGCDataRequest("Bearer f99e72d818b504d23e0581ef1b1a2b4bb687c683")
- # status, result_image = aigc.searchProgress(1127984)
- # print(status,result_image)
- search_times = 60
- while search_times > 0:
- print(f"模特图查询第{search_times}次")
- # logger.info(f"模特图查询第{search_times}次")
- status, result_image = aigc.searchProgress(1127989)
- # status: -1=失败, 0=排队中, 1=进行中, 2=完成
- if status == 2: # 完成
- break
- if status == -1: # 失败
- break
- # status为0(排队中)或1(进行中)时继续查询
- time.sleep(1)
- search_times -= 1
- # 循环结束后检查最终状态
- if status == -1 or (status != 2 and search_times <= 0):
- print("模特图生成失败")
- exit()
- # save_image_path = download_image_with_pil(result_image, save_path)
- print("上脚图save_image_path",result_image)
|