Source: https://docs.sogni.ai/run-a-worker/fast-worker/running-on-vast-ai/

# Run a Sogni Comfy Worker on Vast.ai

On Vast.ai, rent one GPU and run the Sogni container as a regular instance. Keep your [Sogni worker key, Fast Worker NFT token ID, and hardware requirements](https://docs.sogni.ai/run-a-worker/fast-worker/running-sogni-fast-worker-remotely/#before-you-rent-a-gpu) handy.

## [#](https://docs.sogni.ai/run-a-worker/fast-worker/running-on-vast-ai/#create-a-private-instance-template)Create a private instance template

1.  Open [Vast.ai Templates](https://cloud.vast.ai/templates/) and create a private template, or edit a template and save a private copy.
2.  In **Image Path:Tag**, enter `sogni/comfy-worker-cu13:latest` or the [recommended versioned image](https://api.sogni.ai/v1/worker-images/comfy?cuda=13).
3.  Set **Launch Mode** to **docker ENTRYPOINT** and leave entrypoint arguments blank. SSH and Jupyter launch modes replace the image’s normal startup command. Clear inherited port mappings and leave other launch options at their defaults.
4.  Set `API_KEY` and `NFT_TOKEN_ID` in **Environment Variables**. Vast.ai allows people with the URL to use a private template, so keep both the URL and any generated launch command private. Choose disk space for Docker and model files as described below.
5.  Click **Create & Use** and filter offers to **one GPU** on a **verified x86-64 host**. Check the driver is **R580 or newer**, the allocated system RAM and disk meet your workload’s needs, and the offer’s bandwidth and transfer charges work for the expected model downloads. [Vast.ai guide to comparing offers](https://docs.vast.ai/guides/instances/choosing/find-and-rent)
6.  Rent the instance, open its logs, and [verify that the NFT is online in Sogni](https://docs.sogni.ai/run-a-worker/fast-worker/running-sogni-fast-worker-remotely/#verify-the-deployment). If the container fails to start on an otherwise suitable offer, check the instance status and the host’s startup error before trying a different verified host.

For field names and launch modes, see [Vast.ai Template Settings](https://docs.vast.ai/guides/templates/template-settings).

## [#](https://docs.sogni.ai/run-a-worker/fast-worker/running-on-vast-ai/#keep-the-model-cache-between-instances)Keep the model cache between instances

The instance disk survives a stop and is deleted when you destroy the instance. To reuse downloaded models after replacing an instance on the **same machine**, enable **Add recommended volume settings** in the template editor and set the installation path to `/data-models`. Give that volume enough space for the model cache, and still allocate instance disk space for the image, logs, and worker state. A volume mounted at Vast.ai’s default `/data` path preserves worker state. The model cache uses a separate path.

Use the **Storage** page to reattach a local volume on the same host. Before destroying an instance, back up any data you want to keep. Stopped instances and retained volumes can still incur storage charges. See [Vast.ai storage types](https://docs.vast.ai/guides/instances/storage/types) and [Volumes](https://docs.vast.ai/guides/instances/storage/volumes).
