Network Volumes for Custom Models with ComfyUI Serverless"
Hey everyone, I'm trying to understand network volumes with RunPod serverless. If I create a ComfyUI serverless endpoint with the default worker image and attach a network volume, can I then launch a regular ComfyUI pod using that same volume to add my custom models and workflows? And will those custom models then be accessible when my serverless endpoint runs? Basically trying to extend the default image without modifying it.
5 Replies
Yes, you can use the same network volume for your pods or serverless endpoints.
One thing to note is that on your pod the network volume will be mounted on the /workspace directory, while on your serverless endpoint it will be mounted on the /runpod-volume directory
So for using your network volume in your serverless endpoint with ComfyUI you'll likely need to create a symlink between the network volume and your serverless instance. Here's a discussion about this: https://www.answeroverflow.com/m/1249796140283727872
And an example: https://github.com/ashleykleynhans/runpod-worker-comfyui/blob/main/start.sh#L5-L7
@neural-soupe ah ok thanks. So for the symlink i would have to create own image of the worker, is there way without maybe creating own worker
Yeah, you'd need to write your own handler function and build a Docker image for it. What image/container are you currently deploying as serverless?
@neural-soupe I just deployed the "timpietruskyblibla/runpod-worker-comfy:3.4.0-flux1-dev" image for quickstart
i would like to just using that image in best case and just add my custom stuff i need like models and loras
but when i open the storage with a template there is nothing like no file but the endpoint is working
I think you'll have to build your own version of the https://github.com/runpod-workers/worker-comfyui worker, where you either download your models in the Dockerfile (https://github.com/runpod-workers/worker-comfyui/blob/main/Dockerfile) or create the symlink for your network volume in the start.sh (https://github.com/runpod-workers/worker-comfyui/blob/main/src/start.sh) script, like the example I shared previously.
So you'll need to download the code for the https://github.com/runpod-workers/worker-comfyui, make the changes you need (either in the Dockerfile or start.sh), re-build and push the image to your own Docker repository, and then use that image for your serverless endpoint
GitHub
GitHub - runpod-workers/worker-comfyui: ComfyUI as a serverless API...
ComfyUI as a serverless API on RunPod. Contribute to runpod-workers/worker-comfyui development by creating an account on GitHub.
GitHub
worker-comfyui/Dockerfile at main · runpod-workers/worker-comfyui
ComfyUI as a serverless API on RunPod. Contribute to runpod-workers/worker-comfyui development by creating an account on GitHub.
GitHub
worker-comfyui/src/start.sh at main · runpod-workers/worker-comfyui
ComfyUI as a serverless API on RunPod. Contribute to runpod-workers/worker-comfyui development by creating an account on GitHub.