#!/bin/bash # Overflow download for the weight files that don't fit under the /workspace # network-volume quota (~100GB on the current pod). Puts them on tmpfs # (/dev/shm, 176GB on the B200 pod) — EPHEMERAL: lost on pod restart, so this # is for benchmarking sessions. Re-run after any pod restart. # # tmux new -s downloads-shm -d 'bash /workspace/minimax-h3/download-weights-tmpfs.sh' # # ComfyUI sees this path via the minimax_shm section of extra_model_paths.yaml. set -uo pipefail REPO="Comfy-Org/MiniMax-H3" DEST="/dev/shm/minimax-h3-models" LOG="/workspace/minimax-h3/download.log" mkdir -p "$DEST/diffusion_models" export HF_HUB_ENABLE_HF_TRANSFER=1 log() { echo "[$(date -u +%FT%TZ)] $*" | tee -a "$LOG"; } dl() { local file="$1" if [ -f "$DEST/$file" ]; then log "SKIP $file (already present in shm)" return 0 fi log "START $file -> tmpfs" if hf download "$REPO" "$file" --local-dir "$DEST" >>"$LOG" 2>&1; then log "DONE $file ($(du -h "$DEST/$file" | cut -f1))" else log "FAILED $file" return 1 fi } log "=== tmpfs overflow download starting ===" dl diffusion_models/minimax_h3_fl2va_int8_convrot.safetensors dl diffusion_models/minimax_h3_ref2va_bf16.safetensors dl diffusion_models/minimax_h3_fl2va_bf16.safetensors rm -rf "$DEST/.cache" log "=== tmpfs overflow downloads complete ==="