# Wan video on remote RTX A5000 16GB via Tailscale — optimization notes

Use this when driving a remote ComfyUI host with an NVIDIA RTX A5000 Laptop GPU (16GB VRAM) from Hermes/AutoShortsBot over Tailscale.

## Proven baseline

Host endpoint used successfully:

```text
http://<tailscale-ip>:8188
```

Health endpoints:

```bash
curl "http://$(tailscale ip -4 | head -n1):8188/system_stats"
curl "http://$(tailscale ip -4 | head -n1):8188/object_info"
```

Observed working stack:

- ComfyUI 0.22.0
- PyTorch 2.12.0+cu126
- NVIDIA RTX A5000 Laptop GPU, 16GB VRAM
- ComfyUI-WanVideoWrapper nodes available
- Wan2.1 T2V 1.3B FP8 model recognized and executable

## Start command: production baseline

Do **not** use `--lowvram` as the normal mode on 16GB A5000. It can force/offload text encoding and make T5 dominate runtime while `nvidia-smi` looks underused.

Preferred launch:

```bash
cd ~/ai/ComfyUI
source .venv/bin/activate

TS_IP="$(tailscale ip -4 2>/dev/null | head -n1 || true)"
[ -z "$TS_IP" ] && TS_IP="127.0.0.1"

python main.py \
  --listen "$TS_IP" \
  --port 8188 \
  --reserve-vram 1.0
```

If OOM/crashes, try `--reserve-vram 2.0` or `3.0` before falling back to `--lowvram`.

Optional later speed test for repeated same-model runs:

```bash
python main.py --listen "$TS_IP" --port 8188 --highvram --reserve-vram 1.0
```

## Workflow settings that fixed under-utilization

For WanVideoWrapper on Wan2.1 1.3B FP8:

- `LoadWanVideoT5TextEncoder.load_device = main_device`
- `WanVideoTextEncode.device = gpu`
- `WanVideoTextEncode.force_offload = false`
- `WanVideoModelLoader.load_device = main_device`
- `WanVideoSampler.force_offload = false`
- `WanVideoDecode.enable_vae_tiling = false` unless decode OOMs

Emergency/stability mode only:

- `--lowvram`
- text encode on CPU
- model/text encoder on `offload_device`
- VAE tiling on

## Diagnostic pattern

If logs show T5/TextEncoder taking ~45–65s while sampling takes ~1s for tiny tests, the bottleneck is text encoding/offload, not diffusion sampling. Move T5/text encoding to GPU and remove `--lowvram`.

Monitor while running:

```bash
watch -n 1 nvidia-smi
```

Expected after optimization: VRAM use around 8–10.5GB for 416x736/480x832 preview runs.

## Tested profiles

### Smoke only — not visually meaningful

```text
128x224, 9 frames, 2 steps, 8 fps
240x416, 17 frames, 4 steps, 8 fps
```

These prove the API path, but output may be abstract blinking color and should not be judged as model quality.

### Fast preview / prompt iteration

```text
416x736
25 frames
12 fps
8 steps
scheduler: unipc
cfg: ~3.5
```

Observed: ~45–60s, used ~8–10.5GB VRAM, produced recognizable car/garage motif.

### Better preview / candidate

```text
480x832
33 frames
12 fps
10 steps
scheduler: unipc
cfg: ~3.5
```

Observed: ~160s, used ~8.2–10.3GB VRAM, produced usable auto/garage B-roll foundation.

## Wan2.2 TI2V 5B test path

Worth testing for quality, but do not jump directly to 720p/24fps. Use FP8 scaled first.

Recommended model files:

```bash
hf download Kijai/WanVideo_comfy_fp8_scaled \
  TI2V/Wan2_2-TI2V-5B_fp8_e4m3fn_scaled_KJ.safetensors \
  --local-dir ~/ai/ComfyUI/models/diffusion_models

hf download Kijai/WanVideo_comfy \
  Wan2_2_VAE_bf16.safetensors \
  --local-dir ~/ai/ComfyUI/models/vae

hf download Comfy-Org/Wan_2.2_ComfyUI_Repackaged \
  split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors \
  --local-dir /tmp/wan22_text_encoder

cp /tmp/wan22_text_encoder/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors \
  ~/ai/ComfyUI/models/text_encoders/
```

A/B ladder:

1. `416x736`, 25 frames, 12fps, 8 steps
2. `480x832`, 33 frames, 12fps, 10–12 steps
3. `576x1024`, 49 frames, 12fps, 12–16 steps if stable

Keep Wan2.1 1.3B FP8 as the fast iteration model. Use Wan2.2 TI2V 5B FP8 scaled as the quality candidate model.

## Pitfalls

- Do not judge quality from 2–4 step smoke tests; they only prove execution.
- If `nvidia-smi` shows ~1GB while jobs run, check `--lowvram`, CPU text encoding, and offload settings before assuming the GPU is unavailable.
- 720p/24fps is a later final-shot target, not the first local A5000 test profile.
- If ComfyUI accepts `/prompt` with `node_errors: {}` but then disappears, inspect RAM pressure (`free -h`, `ps aux --sort=-%mem | head -20`) as well as VRAM.
