Questions About Running ComfyUI Serverless on RunPod

I set up my ComfyUI project, ComfyUI Manager, custom nodes, and models on RunPod inside the /workspace directory of my network volume. When I temporarily deploy the volume and run python main.py --listen, I can access my ComfyUI workflow through the web on RunPod and generate images without any issues. However, after spending a few days trying to figure it out, I still can’t get it working with the serverless API. I've gone through a bunch of docs and videos, but to be honest, I'm just more confused now. The workflow runs perfectly through the web but I could never get it to run through serverless. Since everything is working fine on the web version, I feel like I'm really close to getting it working through the serverless API too. I'd really appreciate any help with this. I can also send over my files via DM if needed. Some questions I have: - How can I use serverless API considering my workflow runs well on ComfyUI on RunPod (port 8188) when deployed to a pod? Do I need to generate a Docker image for this, or would it be enough if I used an existing Docker image and installed my models and custom nodes into relevant folders in /workspace? Because that’s how I ran it on port 8188 on ComfyUI. For your info, when trying to run it on serverless API, I exported API version of my ComfyUI workflow, used it on “workflow” part of my input but couldn’t make it work. This would also be a great video on RunPod’s YouTube channel imo. - On https://github.com/runpod-workers/worker-comfyui, under Quickstart, are the Docker images like runpod/worker-comfyui:3.6.0-base supposed to work? It only seems to work for me if they start with timpietruskyblibla/runpod-worker-comfy instead of runpod/worker-comfyui. - If the workflow already runs well on a deployed pod, why isn't there a simpler way to make it work with the serverless API? I get that "simple" is subjective but it feels like the process could be a lot smoother. - Even though I install the requirements.txt files inside workspace/ComfyUI/custom_nodes, every time I terminate and deploy a new pod, the packages I installed are gone. I thought anything installed under /workspace in the network volume would persist? Thank you so much for your time!
15 Replies
riverfog7
riverfog72d ago
last one is expected maybe instead of going straight to serverless try to get it working with python in the command line
Barış
BarışOP2d ago
I guess so because from what I've seen, I think I need to build a Docker image or get a snapshot to be used in a Dockerfile to fix that. Wish it could be done in just /workspace directly without having to deal with that Yes, it works well when I do it with Python in the CLI. After running python main.py --listen, I can access my ComfyUI workflow through the web on RunPod (on port 8188) and generate images without any issue
riverfog7
riverfog72d ago
what's your comfyUI port when you access the comfyUI webUI? and is your requirement generating images programmatically via serverless or accessing the comfyUI webUI via serverless
Barış
BarışOP2d ago
8188 Yes, this is my use case exactly I love RunPod and its capabilities, and I also love the repo https://github.com/runpod-workers/worker-comfyui. I just need to get my ComfyUI workflow to run via serverless APIs
riverfog7
riverfog72d ago
then shouldn't your main.py make a request to comfyUI to generate the images and return them to serverless?
Barış
BarışOP2d ago
It should. I must be doing something stupid here because many people got it working, and some have the same issues I've faced
riverfog7
riverfog72d ago
can i come back about after a while
Barış
BarışOP2d ago
Of course, please take your time, thank you for your help!
riverfog7
riverfog72d ago
Overview | RunPod Documentation
Use Serverless to scale your machine learning workloads, with flexible GPU computing for AI inference, training, and general compute, pay-per-second pricing, and fast deployment options for custom endpoints.
Barış
BarışOP2d ago
I’ll do it from scratch with the docs again and share the results here
riverfog7
riverfog72d ago
im back
Barış
BarışOP2d ago
When I just deploy what's said in the docs (without ComfyUI stuff), it works. I made a minor suggestion on https://discord.com/channels/912829806415085598/948767517332107274/1366399707596853259. I'll try to update this based on my ComfyUI workflow, hope it goes well
Dj
Dj2d ago
It looks like we didn't publish the runpod image, I'll fix that today hopefully.
riverfog7
riverfog72d ago
does your workflow contan non-default models? can you give us your workflow
NERDDISCO
NERDDISCO12h ago
i'm looking into this and try to see what is broken with the workflow, been talking with @Barış via dms @Dj i published the latest image also on dockerhub now: https://hub.docker.com/r/runpod/worker-comfyui / runpod/worker-comfyui:4.0.0-base

Did you find this page helpful?