YuE 2 on Vast.ai (Part 4): Headless ComfyUI-YuE2 Workflow & Automated Teardown

1. Visual Generation with ComfyUI-YuE2

While CLI execution is ideal for automated scripting, many producers prefer the visual node-graph interface of ComfyUI.

With ComfyUI-YuE2, you can visually chain lyrics, genre tags, seed randomization, and automated stem mastering into a single workflow.


2. Installing ComfyUI on your Vast.ai Pod

Navigate to your workspace and clone ComfyUI:

cd /workspace
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
pip install -r requirements.txt

Clone the YuE 2 custom node pack into custom_nodes:

cd custom_nodes
git clone https://github.com/ScryptHunter/ComfyUI-YuE2.git
cd ComfyUI-YuE2
pip install -r requirements.txt

Symlink your existing checkpoints so you do not download them twice:

mkdir -p /workspace/ComfyUI/models/yue2
ln -s /workspace/YuE/checkpoints/* /workspace/ComfyUI/models/yue2/

3. Starting ComfyUI & Tunneling Locally

Launch ComfyUI listening on localhost:

cd /workspace/ComfyUI
python3 main.py --listen 127.0.0.1 --port 8188 --highvram

From your local machine, open your browser and navigate to:
:backhand_index_pointing_right: http://127.0.0.1:8188

Your local browser now connects seamlessly to your cloud GPU on Vast.ai with zero latency, full drag-and-drop workflow capability, and responsive waveform previews.


4. Automated Backup & Safe Teardown (Stop Paying When Done)

The golden rule of cloud GPU rental is simple: never leave an idle instance running overnight.

Create a quick backup and sync script on Vast.ai:

cat << 'EOF' > /workspace/sync_and_exit.sh
#!/bin/bash
echo "=== Archiving session outputs ==="
tar -czf /workspace/session_$(date +%Y%m%d_%H%M%S).tar.gz /workspace/YuE/sessions/

echo "=== Sync complete! You can now pull the archive and stop the pod ==="
ls -lh /workspace/*.tar.gz
EOF
chmod +x /workspace/sync_and_exit.sh

Finishing Your Session:

  1. Run ./workspace/sync_and_exit.sh.
  2. Download your session tarball to your local studio via scp.
  3. Go to the Vast.ai Web Console $\rightarrow$ Click “Stop” (to pause compute billing while keeping storage), or “Destroy” (to permanently delete the instance and stop all storage fees).

By following this workflow, an entire 10-track LP concept can be written, rendered, and stem-separated for under $5 in cloud compute.