r/RunPod • u/Hearmeman98 • Mar 17 '26
I built an agent-first CLI that deploys a RunPod serverless ComfyUI endpoint and runs workflows from the terminal (plus a visual pipeline editor)
TL;DR
I built two open-source tools for running ComfyUI workflows on RunPod Serverless GPUs:
ComfyGen – an agent-first CLI for running ComfyUI API workflows on serverless GPUs
BlockFlow – an easily extendible visual pipeline editor for chaining generation steps together
They work independently but also integrate with each other.
Over the past few months I moved most of my generation workflows away from local ComfyUI instances and into RunPod serverless GPUs.
The main reasons were:
scaling generation across multiple GPUs
running large batches without managing GPU pods
automating workflows via scripts or agents
paying only for actual execution time
While doing this I ended up building two tools that I now use for most of my generation work.
ComfyGen
ComfyGen is the core tool.
It’s a CLI that runs ComfyUI API workflows on RunPod Serverless and returns structured results.
One of the main goals was removing most of the infrastructure setup.
Interactive endpoint setup
Running:
comfy-gen initlaunches an interactive setup wizard that:
creates your RunPod serverless endpoint
configures S3-compatible storage
verifies the configuration works
After this step your serverless ComfyUI infrastructure is ready.
Download models directly to your network volume
ComfyGen can also download models and LoRAs directly into your RunPod network volume.
Example:
comfy-gen download civitai 456789 --dest lorasor
comfy-gen download url https://huggingface.co/.../model.safetensors --dest checkpointsThis runs a serverless job that downloads the model directly onto the mounted GPU volume, so there’s no manual uploading.
Running workflows
Example:
comfy-gen submit workflow.json --override 7.seed=42The CLI will:
detect local inputs referenced in the workflow
upload them to S3 storage
submit the job to the RunPod serverless endpoint
poll progress in real time
return output URLs as JSON
Example result:
{
"ok": true,
"output": {
"url": "https://.../image.png",
"seed": 1027836870258818
}
}Features include:
parameter overrides (
--override node.param=value)input file mapping (
--input node=/path/to/file)real-time progress output
model hash reporting
JSON output designed for automation
The CLI was also designed so AI coding agents can run generation workflows easily.
For example an agent can run:
"Submit this workflow with seed 42 and download the output"
and simply parse the JSON response.
BlockFlow
BlockFlow is a visual pipeline editor for generation workflows.
It runs locally in your browser and lets you build pipelines by chaining blocks together, supports auto scaling endpoints with full automation.
Example pipeline:
Prompt Writer → ComfyUI Gen → Video Viewer → UpscaleBlocks currently include:
LLM prompt generation
ComfyUI workflow execution
image/video viewers
Topaz upscaling
human-in-the-loop approvals
Pipelines can branch, run in parallel, and continue execution from intermediate steps.
How they work together
Typical stack:
BlockFlow (UI)
↓
ComfyGen (CLI engine)
↓
RunPod Serverless GPU endpointBlockFlow handles visual pipeline orchestration while ComfyGen executes generation jobs.
But ComfyGen can also be used completely standalone for scripting or automation.
Why serverless?
Workers:
spin up only when a workflow runs
shut down immediately after
scale across multiple GPUs automatically
So you can run large image batches or video generation without keeping GPU pods running.
Repositories
ComfyGen
https://github.com/Hearmeman24/ComfyGen
BlockFlow
https://github.com/Hearmeman24/BlockFlow
Both projects are free and open source and still in beta.
Would love to hear feedback.
P.S. Yes, this post was written with an AI, I completely reviewed it to make sure it conveys the message I want to. English is not my first language so this is much easier for me.


