opensi·si

node graphs! three tools everyone lumps together because they all look like boxes with wires between them. but they can do completely different jobs.

gradio workflows vs n8n vs comfyui

node graphs! three tools everyone lumps together because they all look like boxes with wires between them. but they can do completely different jobs.

quick version if you're skimming:

comfyui → you want control over how the image gets made

n8n → you want it running on its own at 4am

gr.Workflow → you want the thing you built to be an app with a url and an api

what gr.Workflow actually is

it's a gradio app that reads a graph out of a json file and gives you a canvas. the whole thing is this:

import gradio as gr

def reverse(text: str) -> str:
    return (text or "")[::-1]

demo = gr.Workflow(graph="workflow.json", bind={"reverse": reverse})
demo.launch()

bind is you handing the canvas a list of your own python functions and going "you can call these."

no graph yet? pass your functions in a list, tell it what connects to what, and gradio writes the json file the first time you hit save.

nodes come in three flavours. stuff going in, stuff coming out, and the interesting bit in the middle. that middle bit can be a hugging face space, a model running through hf inference, a dataset, or one of your own functions.

the hub is the node library

here's the bit that actually changes how you work.

the sidebar ships with a curated set of spaces and models so it isn't an empty search box on day one, and searching it searches that set. everything else on the hub you reach by pasting: drop owner/repo or a url into the sidebar's space box, or into the picker on a node, and it resolves the repo and adds it. spaces, models, datasets.

you don't install anything. you don't write a wrapper. drag a space on and gradio fetches its /info, reads the endpoints, and draws the ports for you. if it has more than one endpoint you pick which one you want from the node itself. models work slightly differently — they're typed off the pipeline tag, so a text-to-image model gets a prompt in and an image out, no api call needed to work that out.

so you type "background removal" in, drag the first thing that looks good, wire it to your image input. thirty seconds.

one gotcha: adding a space needs the space to actually answer. if it's asleep or it isn't a gradio app with an api, you get an error at drag time, not at run time.

models let you pin an inference provider too (together, replicate, whoever) or leave it on auto and let hf route it.

the workflow is an api

the execution logic that runs when you click through the canvas also exists in python, so your graph runs fine with nobody watching it.

which means the thing you dragged together is also an api.

build a graph where a text box feeds a local function, a model, and a space, all landing on outputs. gradio knows they're connected and gives you one endpoint that takes your text and returns all three results together. call it with gradio_client, or call it over http. it shows up in the view api panel like any other gradio app, documented, typed, ready to drop into someone else's code.

so you never have to choose between the canvas and the app. the graph is the app. wire up boxes for two minutes, and what you've actually built is a hugging face space with a ui people can click and an endpoint you can use wherever you like.

vs n8n

n8n is automation. cron jobs. webhooks. it watches your inbox. it has a credentials store hooked into a few hundred services, it replays failed runs, it has fallback workflows for when something dies at 4am and you're asleep.

"when a stripe charge goes through, write a row to postgres and post in #sales" — n8n solved that years ago. gr.Workflow hasn't, because nothing here runs on a timer, fires on its own, or holds your third party logins for you.

what gr.Workflow gives you instead is a link. you deploy to a space, you send someone a url, they use it. or they call it from code. n8n can sort of get there with a webhook node but you're building toward it, whereas here it's the only mode there is.

the other difference is what's in the sidebar. n8n's integration list is huge and hand-built, one node per service, maintained by people. gradio's is the hugging face hub, which is a lot more stuff and a lot less curation.

use n8n if it needs to run on a schedule. use gr.Workflow if a person needs to click it.

vs comfyui

comfy lives a floor below this.

its nodes are the guts of image generation, samplers and schedulers and loras and all of it. you want to change how one step of a twenty step generation behaves? comfy. and that custom node ecosystem is genuinely wild, people have built insane things in there.

but getting a new node into comfy means installing it, and getting a new model means downloading weights. in gradio you paste a repo id. the tradeoff is obvious: comfy's node runs on your gpu and you own every knob on it, gradio's node is someone else's space and you get whatever they exposed.

a gr.Workflow node can't reach inside flux. it calls the space, sends a prompt, gets an image.

for "caption this photo, turn the caption into a marketing prompt, generate from it" that's the right level. you don't want to be picking samplers for that. for dialling in one specific look across forty generations? nah. open comfy.

before you start

everything flows one way. no cycles, no while loops, no loop-until-it's-good-enough.

in the canvas, independent branches run at the same time. called as an api, the python executor walks the graph one node at a time — same results, no parallelism.

saving is gated. locally you need the write-access link gradio prints at launch; on a space you need to be signed in as the owner. share-link visitors get read-only.

and when a remote space blows up three hops downstream, you might have to duplicate it and fix it yourself, or change to another space.

Note! It's in beta. gr.Workflow is still in beta, may have bugs, and its API and UX may change in future releases.

quick answers to stuff people ask

can i use any hugging face model? yes, any model you can run through hf inference. it's in the sidebar if it's curated, otherwise paste the repo id into a node's picker. ports come from the model's pipeline tag.

does every gradio space work as a node? most do. it needs to be awake and it needs an api endpoint with types the canvas can read. if it's asleep or has no api, adding it fails.

is this a comfyui replacement? only if you treat the model as a black box. if you care how the image gets made, go to comfy.

can it replace n8n? no. nothing runs on a schedule, and that's n8n's job.

do i really get an api? yeah. every output node becomes a normal gradio endpoint. connected ones come back together in one response.

can i run my own python in it? yep, that's what bind is for. pass your functions, they show up as nodes.

where does it actually run? your app's python process does the calling: it hits the space over the gradio client, or hf inference for models, and runs your bound functions in-process. the browser drives the graph and renders it, and streams text generation directly for the token-by-token effect. it all goes against an hf token, so locally that's your quota, and if you deploy with oauth it's each visitor's own.