Agents

Hugging Face launches gr.Workflow for visual AI pipelines

Hugging Face has integrated gr.Workflow into Gradio, allowing developers to build, run, and deploy complex AI pipelines as interactive, drag-and-drop visual node graphs.

Hugging Face Blog12 hrs agoAgents
Image: Hugging Face Blog

Hugging Face has introduced gr.Workflow, a new feature built directly into the Gradio library that transforms multi-step AI pipelines into interactive visual interfaces. Instead of writing complex Python scripts and relying on print-debugging to trace errors, developers can now define their pipelines as graphs of typed nodes. Gradio automatically generates a drag-and-drop canvas where users can run individual nodes, inspect intermediate results, and connect different components by dragging connections between ports.

The system utilizes three primary node types: references for inputs, operators for processing steps, and subjects for outputs. Operators can execute custom Python functions, query models via Hugging Face Inference Providers, connect to existing Gradio Spaces, or pull data from Hugging Face Hub datasets. For local execution, developers can decorate Python functions with @spaces.GPU to leverage ZeroGPU resources. The workflow engine supports parallel processing, enabling fan-out patterns where a single input simultaneously triggers multiple downstream operations.

Several live demonstrations showcase the versatility of the new tool. One application uses Qwen-Image-Edit to modify uploaded images based on text prompts. Another pipeline combines the FLUX image generation model with a background-removal tool to create stickers, while simultaneously generating voiceovers and episode titles. Developers can also build video generation workflows, such as animating still images using the Lightricks/LTX-Video model loaded through Diffusers. For data analysis, workflows can ingest datasets like stanfordnlp/imdb or mteb/tweet_sentiment_extraction to compute statistics and charts in parallel.

Every visual workflow automatically functions as a REST API with distinct endpoints for each output, such as /sticker or /voiceover. These endpoints can be queried programmatically using curl or the Gradio Python client. For instance, developers can call the ysharma/gr-workflow-multi-endpoint-API Space to run basic functions or access the ysharma/gr-workflow-image-editor Space with a Hugging Face token. Deploying a completed workflow to Hugging Face Spaces requires only a single command, initiated in Python with gr.Workflow(bind=[your_function]).launch().

This is our own summary of reporting by Hugging Face Blog

More in Agents