#!/usr/bin/env bash export MASTER_ADDR=localhost export MASTER_PORT=6010 export CUDA_VISIBLE_DEVICES="${CUDA_VISIBLE_DEVICES:-1}" set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" MAGI_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" cd "$MAGI_ROOT" source "${HOME}/miniforge3/etc/profile.d/conda.sh" 2>/dev/null || source "${HOME}/anaconda3/etc/profile.d/conda.sh" conda activate magi HISTORYCACHE_CONFIG="${HISTORYCACHE_CONFIG:-yaml_config/single_run/historycache_config.yaml}" RUN_ID="${RUN_ID:-$(date +%Y%m%d_%H%M%S)}" EXP_DIR="${RUN_DIR:-outputs/a_woman_dancing_historycache_$RUN_ID}" mkdir -p "$EXP_DIR" export PYTHONPATH="$MAGI_ROOT:$(dirname "$MAGI_ROOT")/FlowCache4MAGI-1-dev4-detail:$(dirname "$MAGI_ROOT")/FlowCache4MAGI-1-dev3-motion" python3 inference/pipeline/motioncache.py \ --config_file config/single_run/flowcache_t2v.json \ --mode t2v --prompt "${PROMPT:-a woman dancing.}" \ --output_path "$EXP_DIR/output_$RUN_ID.mp4" \ --additional_config "$HISTORYCACHE_CONFIG" \ --motioncache_metric_stats_path "$EXP_DIR/metrics_$RUN_ID.json" \ 2>&1 | tee "$EXP_DIR/infer_$RUN_ID.log"