|
|
@@ -291,7 +291,6 @@ async def process_handle_detail(request: Request, params: HandlerDetail):
|
|
|
# 检查处理结果
|
|
|
success_handler = return_data_check_before_detail.get("data", {}).get("config_data", {}).get("success_handler", [])
|
|
|
failed_items = [item for item in success_handler if item.get('success') == False]
|
|
|
-
|
|
|
if failed_items:
|
|
|
await sendAsyncMessage(
|
|
|
msg="处理结束",
|
|
|
@@ -540,7 +539,6 @@ async def _process_cutout(run_main, config_data, goods_art_no_arrays, move_folde
|
|
|
)
|
|
|
return_data = run_main.check_before_cutout(config_data)
|
|
|
cutout_res = run_main.check_for_cutout_image_first_call_back(return_data)
|
|
|
-
|
|
|
if cutout_res:
|
|
|
# sys_path = format(os.getcwd()).replace("\\", "/")
|
|
|
handler_result_folder = f"{config_data['image_dir']}"
|
|
|
@@ -552,7 +550,7 @@ async def _process_cutout(run_main, config_data, goods_art_no_arrays, move_folde
|
|
|
"info": "处理成功",
|
|
|
})
|
|
|
|
|
|
- if len(have_handler_keys) == len(goods_art_no_arrays):
|
|
|
+ if len(have_handler_keys) == len(goods_art_no_arrays) or (len(have_handler_keys) == 0 and cutout_res):
|
|
|
handler_result_folder = handler_result_folder.replace("\\", "/")
|
|
|
success_items = [item for item in handler_result if item.get('success') == True]
|
|
|
cutout_folder = handler_result_folder+"/"+success_items[0].get("goods_art_no")+"/800x800" if len(success_items) > 0 else ""
|
|
|
@@ -570,7 +568,6 @@ async def _process_cutout(run_main, config_data, goods_art_no_arrays, move_folde
|
|
|
msg_type="segment_progress",
|
|
|
progress=progress
|
|
|
)
|
|
|
-
|
|
|
return handler_result_folder, handler_result
|
|
|
|
|
|
async def _process_scene_images(aigc_clazz, run_main, return_data_check_before_detail, product_scene_prompt):
|
|
|
@@ -851,8 +848,8 @@ async def _process_detail_pages(run_main, return_data_check_before_detail, onlin
|
|
|
)
|
|
|
print("<======>check_for_detail_first_res<======>",check_for_detail_first_res)
|
|
|
if isinstance(check_for_detail_first_res, partial):
|
|
|
- result = check_for_detail_first_res()
|
|
|
try:
|
|
|
+ result = check_for_detail_first_res()
|
|
|
config_data = result["config_data"]
|
|
|
except:
|
|
|
config_data = result
|