|
3 | 3 | #SBATCH --job-name=comfyUI |
4 | 4 | #SBATCH --ntasks=1 |
5 | 5 | #SBATCH --nodes=1 |
6 | | -#SBATCH --gres=gpu:1 |
| 6 | +#SBATCH --gres=gpu:h100pcie:1 |
7 | 7 | #SBATCH --cpus-per-task=8 |
8 | 8 | #SBATCH --mem=128G |
9 | | -#SBATCH --account=cai_ivs |
10 | | -#SBATCH --partition=gpu_top |
11 | | - |
12 | | -#SBATCH --output=/cluster/home/denp/logs/%x.id%j.%N.sbatch.out |
13 | | -#SBATCH --error=/cluster/home/denp/logs/%x.id%j.%N.sbatch.err |
| 9 | +#SBATCH --account=cai_teaching |
| 10 | +#SBATCH --nodelist=sanjose |
| 11 | +#SBATCH --partition=teaching |
| 12 | +#SBATCH --output=/cluster/projects/2025_image_tools/logs/%x.id%j.%N.sbatch.out |
| 13 | +#SBATCH --error=/cluster/projects/2025_image_tools/logs/%x.id%j.%N.sbatch.err |
14 | 14 | # #SBATCH --signal=B:SIGUSR1@900 |
15 | 15 |
|
| 16 | +usage() { |
| 17 | + cat <<EOF |
| 18 | +Usage: $0 [-p|--port <in>] [-h|--help] |
| 19 | +
|
| 20 | + This is a SLURM batch script for deploying comfyUI. |
| 21 | +
|
| 22 | + Options: |
| 23 | + -p, --port Port for the server. |
| 24 | + -h, --help Print this message. |
| 25 | +EOF |
| 26 | +} |
| 27 | + |
| 28 | + |
16 | 29 | # Defaults |
17 | 30 | CU_MODULE=cuda/12.8.0 |
18 | 31 | PY_MODULE=python/3.13.2 |
19 | 32 | UV_MODULE=uv/0.6.12 |
20 | 33 | ENV_NAME="comfy-ui" # define python virtualenv name |
21 | | -PKG_DIR="/cluster/home/denp/comfyUI" |
22 | | -PORT=8623 |
| 34 | +PKG_DIR="/cluster/projects/2025_image_tools/comfyUI" |
| 35 | +PORT="${PORT:-9102}" |
| 36 | + |
| 37 | +# Parse args |
| 38 | +OPTS=$(getopt -o p:h --long help,port: -- "$@") |
| 39 | +if [ $? != 0 ] ; then |
| 40 | + echo "[`date '+%Y-%m-%d %T.%3N'`][SLURM] - Failed to parse arguments." >&2 |
| 41 | + exit 1 |
| 42 | +fi |
| 43 | +eval set -- "$OPTS" |
| 44 | + |
| 45 | +while true; do |
| 46 | + case "$1" in |
| 47 | + -p|--port) |
| 48 | + PORT="$2" |
| 49 | + shift 2 |
| 50 | + ;; |
| 51 | + -h|--help) |
| 52 | + usage |
| 53 | + exit 0 |
| 54 | + ;; |
| 55 | + --) |
| 56 | + shift |
| 57 | + break |
| 58 | + ;; |
| 59 | + *) |
| 60 | + shift |
| 61 | + ;; |
| 62 | + esac |
| 63 | +done |
| 64 | +# Required arguments |
| 65 | +if [[ $PORT -ge 8500 && $PORT -le 9100 ]]; then |
| 66 | + echo "Port $PORT is within the allowed range." |
| 67 | +else |
| 68 | + echo "Port $PORT is outside the allowed range." |
| 69 | +fi |
23 | 70 |
|
24 | 71 | # load modules |
25 | 72 | module load "$CU_MODULE" |
|
0 commit comments