fix: 适配 ubuntu 路径并增强换发色/训练流程稳定性

将配置与训练脚本从 /home/xsl 切到本机 /home/ubuntu;换发色在 webui 增强失败或缺色板时降级返回,训练结束后自动重启 hair 服务再回调。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
xsl
2026-07-19 00:49:16 +08:00
co-authored by Cursor
parent fc66534a74
commit 0926c61bd0
7 changed files with 44 additions and 28 deletions
+4
View File
@@ -158,6 +158,10 @@ def step3_wait_and_callback(hair_id, template_img):
else:
print(" ✗ 训练超时"); return False
time.sleep(5) # 等训练进程写完
# 训练时停掉了 hair 服务,回调前需要重启
print(" 重启 change_hair-hair 服务...")
os.system("sudo systemctl restart change_hair-hair")
time.sleep(20)
# 触发回调生成ref材质
print(" 触发回调生成ref材质...")
r = req.post(HAIR_CALLBACK, json={"task_id":f"train_{hair_id}","hair_id":hair_id,