Hugging Face Introduces gr.Workflow to Turn AI Pipelines into Visual Graphs and REST APIs

Hugging Face has released gr.Workflow, a native extension to the Gradio framework designed to convert multi-stage artificial intelligence pipelines into interactive node graphs, visual user interfaces, and deployable REST APIs. Modern machine learning applications increasingly rely on compound pipelines that chain heterogeneous models: generating text via large language models, feeding prompts into diffusion systems, processing outputs through background removal or audio synthesis models, and a

2 min
Hugging Face Introduces gr.Workflow to Turn AI Pipelines into Visual Graphs and REST APIs

Hugging Face has released gr.Workflow, a native extension to the Gradio framework designed to convert multi-stage artificial intelligence pipelines into interactive node graphs, visual user interfaces, and deployable REST APIs.

Modern machine learning applications increasingly rely on compound pipelines that chain heterogeneous models: generating text via large language models, feeding prompts into diffusion systems, processing outputs through background removal or audio synthesis models, and applying downstream formatting. Traditionally, developers orchestrate these chains using sequential Python glue code, where inspecting intermediate outputs or exposing individual pipeline stages as separate endpoints requires dedicated routing and debugging scaffolding.

gr.Workflow formalizes these sequences as computational graphs composed of three primary node primitives: references, operators, and subjects.

Visual representation of node graph architecture and modular endpoints in Gradio Workflow

Core Architecture and Node Types

The workflow engine models data dependencies explicitly through typed connections:

  • References: Input nodes that capture incoming data, such as prompt strings, uploaded images, audio clips, or configuration parameters.
  • Operators: Execution units that process data. Operators can represent arbitrary Python functions, remote models hosted on Hugging Face Inference Providers, external Gradio Spaces, or queries against Hub datasets.
  • Subjects: Terminal and intermediate output artifacts displayed in the visual canvas and exposed via the network interface.

By structuring the application as a directed acyclic graph (DAG), Gradio renders an interactive canvas where each node can be run independently, intermediate artifacts remain visible for inspection, and errors can be isolated to specific pipeline stages without re-running preceding computations.

Automatic REST Routing and Client Access

A primary feature of gr.Workflow is the automatic generation of granular API endpoints. Every output subject defined in the graph generates a dedicated REST route named after its label.

For example, a multi-modal pipeline that generates an image, creates an audio voiceover, and summarizes metadata simultaneously exposes separate routes (such as /sticker, /voiceover, and /episode_title). Developers can query these sub-pipelines directly via standard HTTP requests or using the gradio_client Python package:

from gradio_client import Client, handle_file

client = Client("username/custom-ai-pipeline", token="hf_...")

result = client.predict(
    handle_file("input_sample.jpg"),
    "apply studio lighting and remove background",
    api_name="/processed_asset",
)

Direct HTTP clients can query identical endpoints via curl against the generated /gradio_api/call/<endpoint> path with JSON payloads.

Infrastructure Integration and ZeroGPU Execution

Workflows can execute entirely in memory on local hardware or leverage cloud-hosted inference. When defining Python function nodes, developers can bind compute-intensive operations to dynamic hardware allocators using Hugging Face ZeroGPU.

By applying the @spaces.GPU decorator to a function node, the runtime provisions an isolated GPU instance during execution and releases the hardware immediately upon completion. This enables the integration of local PyTorch and Diffusers models alongside hosted Inference Providers without managing dedicated GPU infrastructure.

Availability

gr.Workflow is available in current versions of Gradio and supports direct deployment to Hugging Face Spaces.

Sources

Written by

More to read

  • FlashAttention: Mathematical Foundations, IO-Aware Tiling, Online Softmax, and Recomputation Dynamics

    Standard self-attention in the Transformer architecture scales quadratically with sequence length in both time and memory complexity. While algorithmic research historically focused on reducing FLOP counts via sparse or low-rank approximations, Tri Dao et al. (2022) demonstrated that the practical wall-clock bottleneck in multi-head attention is not compute capability, but memory IO. FlashAttention reformulates exact scaled dot-product attention as an IO-aware algorithm. By leveraging the GPU m

    1 min
  • OpenAI Reinstates 5-Hour Codex and Work Limits for ChatGPT Plus Subscribers

    OpenAI has reinstated a rolling five-hour rate limit on Codex and ChatGPT Work for ChatGPT Plus subscribers. The change ends a temporary multi-week period during which the short-term window was suspended and users were constrained only by overall weekly quota ceilings. OpenAI engineering lead Thibault Sottiaux confirmed the reinstatement, stating that re-enforcing the five-hour window is necessary to smooth peak compute load across OpenAI's inference fleet as developer adoption of complex multi

    1 min
  • Samsung Evaluates Claude Code for Semiconductor Verification Amid Code Safety Concerns

    Samsung Electronics has integrated Anthropic's Claude Code into semiconductor verification and driver development within its System LSI division. While the deployment achieved major efficiency gains, engineering evaluations revealed critical out-of-scope behaviors that prevent autonomous code execution in hardware synthesis. Samsung's System LSI business unit, which designs Exynos application processors and custom mobile chipsets, operates with approximately 6,000 employees compared to roughly

    1 min