|
| 1 | +# Network Volumes & Model Paths |
| 2 | + |
| 3 | +This document explains how to use RunPod **Network Volumes** with `worker-comfyui`, how model paths are resolved inside the container, and how to debug cases where models are not detected. |
| 4 | + |
| 5 | +> **Scope** |
| 6 | +> |
| 7 | +> These instructions apply to **serverless endpoints** using this worker. Pods mount network volumes at `/workspace` by default, while serverless workers see them at `/runpod-volume`. |
| 8 | +
|
| 9 | +## Directory Mapping |
| 10 | + |
| 11 | +For **serverless endpoints**: |
| 12 | + |
| 13 | +- Network volume root is mounted at: `/runpod-volume` |
| 14 | +- ComfyUI models are expected under: `/runpod-volume/models/...` |
| 15 | + |
| 16 | +For **Pods**: |
| 17 | + |
| 18 | +- Network volume root is mounted at: `/workspace` |
| 19 | +- Equivalent ComfyUI model path: `/workspace/models/...` |
| 20 | + |
| 21 | +If you use the S3-compatible API, the same paths map as: |
| 22 | + |
| 23 | +- Serverless: `/runpod-volume/my-folder/file.txt` |
| 24 | +- Pod: `/workspace/my-folder/file.txt` |
| 25 | +- S3 API: `s3://<NETWORK_VOLUME_ID>/my-folder/file.txt` |
| 26 | + |
| 27 | +## Expected Directory Structure |
| 28 | + |
| 29 | +Models must be placed in the following structure on your network volume: |
| 30 | + |
| 31 | +```text |
| 32 | +/runpod-volume/ |
| 33 | +└── models/ |
| 34 | + ├── checkpoints/ # Stable Diffusion checkpoints (.safetensors, .ckpt) |
| 35 | + ├── loras/ # LoRA files (.safetensors, .pt) |
| 36 | + ├── vae/ # VAE models (.safetensors, .pt) |
| 37 | + ├── clip/ # CLIP models (.safetensors, .pt) |
| 38 | + ├── clip_vision/ # CLIP Vision models |
| 39 | + ├── controlnet/ # ControlNet models (.safetensors, .pt) |
| 40 | + ├── embeddings/ # Textual inversion embeddings (.safetensors, .pt) |
| 41 | + ├── upscale_models/ # Upscaling models (.safetensors, .pt) |
| 42 | + ├── unet/ # UNet models |
| 43 | + └── configs/ # Model configs (.yaml, .json) |
| 44 | +``` |
| 45 | + |
| 46 | +> **Note** |
| 47 | +> |
| 48 | +> Only create the subdirectories you actually need; empty or missing folders are fine. |
| 49 | +
|
| 50 | +## Supported File Extensions |
| 51 | + |
| 52 | +ComfyUI only recognizes files with specific extensions when scanning model directories. |
| 53 | + |
| 54 | +| Model Type | Supported Extensions | |
| 55 | +| -------------- | ------------------------------------------- | |
| 56 | +| Checkpoints | `.safetensors`, `.ckpt`, `.pt`, `.pth`, `.bin` | |
| 57 | +| LoRAs | `.safetensors`, `.pt` | |
| 58 | +| VAE | `.safetensors`, `.pt`, `.bin` | |
| 59 | +| CLIP | `.safetensors`, `.pt`, `.bin` | |
| 60 | +| ControlNet | `.safetensors`, `.pt`, `.pth`, `.bin` | |
| 61 | +| Embeddings | `.safetensors`, `.pt`, `.bin` | |
| 62 | +| Upscale Models | `.safetensors`, `.pt`, `.pth` | |
| 63 | + |
| 64 | +Files with other extensions (for example `.txt`, `.zip`) are **ignored** by ComfyUI’s model discovery. |
| 65 | + |
| 66 | +## Common Issues |
| 67 | + |
| 68 | +- **Wrong root directory** |
| 69 | + - Models placed directly under `/runpod-volume/checkpoints/...` instead of `/runpod-volume/models/checkpoints/...`. |
| 70 | +- **Incorrect extensions** |
| 71 | + - Files named without one of the supported extensions are skipped. |
| 72 | +- **Empty directories** |
| 73 | + - No actual model files present in `models/checkpoints` (or other folders). |
| 74 | +- **Volume not attached** |
| 75 | + - Endpoint created without selecting a network volume under **Advanced → Select Network Volume**. |
| 76 | + |
| 77 | +If any of the above is true, ComfyUI will silently fail to discover models from the network volume. |
| 78 | + |
| 79 | +## Debugging with `NETWORK_VOLUME_DEBUG` |
| 80 | + |
| 81 | +The worker exposes an opt‑in debug mode controlled via the `NETWORK_VOLUME_DEBUG` environment variable. |
| 82 | + |
| 83 | +### When to Use |
| 84 | + |
| 85 | +Enable this when: |
| 86 | + |
| 87 | +- Models on your network volume are not appearing in ComfyUI |
| 88 | +- You suspect the directory structure or file extensions are wrong |
| 89 | +- You want to quickly verify what the worker can actually see on `/runpod-volume` |
| 90 | + |
| 91 | +### How to Enable |
| 92 | + |
| 93 | +1. Go to your serverless **Endpoint → Manage → Edit**. |
| 94 | +2. Under **Environment Variables**, add: |
| 95 | + |
| 96 | + - `NETWORK_VOLUME_DEBUG=true` |
| 97 | + |
| 98 | +3. Save and wait for workers to restart (or scale to zero and back up). |
| 99 | +4. Send any request to your endpoint (even a minimal one) to trigger the diagnostics. |
| 100 | + |
| 101 | +### Reading the Diagnostics |
| 102 | + |
| 103 | +When enabled, each request prints a detailed report to the worker logs, for example: |
| 104 | + |
| 105 | +```text |
| 106 | +====================================================================== |
| 107 | +NETWORK VOLUME DIAGNOSTICS (NETWORK_VOLUME_DEBUG=true) |
| 108 | +====================================================================== |
| 109 | +
|
| 110 | +[1] Checking extra_model_paths.yaml configuration... |
| 111 | + ✓ FOUND: /comfyui/extra_model_paths.yaml |
| 112 | +
|
| 113 | +[2] Checking network volume mount at /runpod-volume... |
| 114 | + ✓ MOUNTED: /runpod-volume |
| 115 | +
|
| 116 | +[3] Checking directory structure... |
| 117 | + ✓ FOUND: /runpod-volume/models |
| 118 | +
|
| 119 | +[4] Scanning model directories... |
| 120 | +
|
| 121 | + checkpoints/: |
| 122 | + - my-model.safetensors (6.5 GB) |
| 123 | +
|
| 124 | + loras/: |
| 125 | + - style-lora.safetensors (144.2 MB) |
| 126 | +
|
| 127 | +[5] Summary |
| 128 | + ✓ Models found on network volume! |
| 129 | +====================================================================== |
| 130 | +``` |
| 131 | + |
| 132 | +If there is a problem, the diagnostics will instead highlight it, for example: |
| 133 | + |
| 134 | +- Missing `models/` directory |
| 135 | +- No valid model files in any subdirectory |
| 136 | +- Files present but ignored due to wrong extensions |
| 137 | + |
| 138 | +### Disabling Debug Mode |
| 139 | + |
| 140 | +Once you have resolved your issue, disable diagnostics to keep logs clean: |
| 141 | + |
| 142 | +- Remove the `NETWORK_VOLUME_DEBUG` environment variable, **or** |
| 143 | +- Set `NETWORK_VOLUME_DEBUG=false` |
| 144 | + |
| 145 | +This returns the worker to normal behavior without extra log noise. |
| 146 | + |
| 147 | + |
0 commit comments