Hugging Face unveils gr.Workflow to turn AI pipelines into interfaces and APIs
Gradio's new gr.Workflow turns AI pipelines into visual canvases and REST APIs, with one-command deployment to Hugging Face Spaces.
The blog post demonstrated several live workflows, each available as a duplicateable Hugging Face Space. One example lets users upload an image and type an edit such as "turn it into a snowy winter scene" or "add sunglasses," with the entire app built as a single node calling the Qwen-Image-Edit model through Hugging Face Inference Providers. Another example combines three pipelines in one graph: a prompt generates an image with FLUX, which is then passed to a background-removal Gradio Space to make a sticker; the same prompt is turned into a voiceover via a text-to-speech Space, and into an episode title via an LLM call.
In those multi-output workflows, each result gets its own REST endpoint, such as /sticker, /voiceover, or /episode_title, so individual steps can be called directly from code without opening the UI. The blog included a live no-token example using the Gradio client, and noted that endpoints calling a model or a Space require a Hugging Face token. Plain HTTP access over curl is also supported.
The fan-out pattern is demonstrated by an idea-to-artwork workflow that generates a base FLUX image, two AI re-imaginings (a soft watercolor version and a neon cyberpunk take), and a gallery title written by an LLM, all in parallel. Similarly, entering a Hugging Face dataset ID like stanfordnlp/imdb fans out to four operator nodes that simultaneously analyze the dataset using the Datasets Server API, producing an overview card, a row preview, per-column statistics, and a distribution chart.
While many nodes call external Hugging Face services, an fn node in gr.Workflow is plain Python and can run a model locally in the Space on a GPU. By decorating a bound function with @spaces.GPU, ZeroGPU allocates a GPU for that call, runs the model, and releases it. The post showed a demo that animates a still image with Lightricks/LTX-Video loaded through Diffusers, entirely within one node.
Every workflow is built from three node types: references (inputs), operators (steps), and subjects (outputs). Operators can be custom Python functions, models on Inference Providers, other Gradio Spaces, or rows from a Hub dataset. Developers can start by duplicating any live demo or by writing a few lines of Python with gr.Workflow(bind=[your_function]). The blog post also said the tool is capable of building interfaces as involved as AUTOMATIC1111, with a step-by-step guide promised in a follow-up post.