#!/usr/bin/env bash
# 全链路：① turbo4+二采（含一采落盘） ② 20步无LoRA直出 ③ 各自后处理 + A/B
set -uo pipefail
ROOT="/home/zyw/Downloads/dl-hub/10-视频生成流水线/20261012_H3餐厅戏_星罗妮妮子方法"
cd "$ROOT"
ALL="$ROOT/全链路_status.txt"; : > "$ALL"
log(){ echo "$(date '+%F %T') $*" | tee -a "$ALL"; }

log "===== PHASE 1  turbo4 + 二采（一采同时落盘）====="
if bash run_restaurant_seg_turbo4.sh; then
  bash run_restaurant_post.sh && log "PHASE1 OK（跑批+后处理）" || log "PHASE1 后处理失败"
else
  log "PHASE1 跑批失败，中止全链路"; exit 1
fi

log "===== PHASE 2  20 步 无 LoRA 无二采 直出 ====="
if bash run_restaurant_20step.sh; then
  bash run_restaurant_post20.sh && log "PHASE2 OK（跑批+后处理+A/B）" || log "PHASE2 后处理失败"
else
  log "PHASE2 跑批失败"; exit 1
fi

log "ALL DONE 两版全部完成"
