接線、執行、部署:Gradio 中的 AI 工作流程
Back to Articles Build Anything with gr.Workflow Published August 25, 2026 Update on GitHub Upvote - yuvraj sharma ysharma Follow Abubakar Abid abidlabs Follow Most interesting AI apps are pipelines.You generate an image, then cut out its background if you want to, or edit it into something new.
You write a script, then generate a voice for it, or swap the voice while keeping the script the same.We usually wire these steps together in Python, and the moment something looks off we go back to print-debugging to find which step produced the odd value.gr.
Workflow, built right into Gradio, makes the pipeline the interface.You describe your steps as a graph of typed nodes, and Gradio serves a drag-and-drop canvas where every node is runnable and every intermediate result is visible.
The same graph is also a REST API and a one-command deploy to Hugging Face Spaces.The best way to get the idea is to see a few workflows in action.Every app below is a live Huggingface Space you can open, run, and duplicate.
Edit an Image Upload an image, type an edit ("turn it into a snowy winter scene", "add sunglasses", "make the car red"), and get the edited photo back.The whole app is a single node calling Qwen-Image-Edit on Hugging Face Inference Providers.
👉 Try the Image Editor Pipeline Chain real models into a media studio One graph, three pipelines.Start with a prompt and generate an image with FLUX, then pass it to a background-removal Gradio Space to turn it into a sticker.
A topic becomes a voiceover through a text-to-speech Gradio Space, while the same topic becomes a catchy episode title through an LLM call.That’s one canvas, two model calls through Hugging Face Inference Providers, and two calls to Gradio Spaces.
Since this is a workflow, each of the three outputs also gets its own REST endpoint: /sticker, /voiceover, and /episodetitle.You can call any of them directly from code without opening the UI.See Call it from code below for a runnable example.
👉 Try the AI Media Studio Fan-out image generation in parallel Type in one idea, and it turns into a set of generated artwork all at once: a base image from FLUX, two AI re-imaginings of that image (a soft watercolor version and a neon cyberpunk take), and a gallery title written by an LLM.
Each image is generated directly from the prompt by a model node using Inference Providers, while the title comes from an fn node that calls an LLM.This is the fan-out pattern in action: one idea can feed multiple operators simultaneously, all generating in parallel.
👉 Try the Generative Art Lab Profile a Hugging Face dataset Type in a Hugging Face dataset ID, such as stanfordnlp/imdb or mteb/tweetsentimentextraction, and a single input fans out to four operator nodes that analyze the dataset live using the Datasets Server API.
You get an overview card, a preview of the first few rows, per-column statistics, and a distribution chart, all computed independently and in parallel.That’s the power of workflows!👉 Try Data Detective Run your own GPU model Every node so far reaches out to Hugging Face.
But an fn node is just Python, which means it can also run a model inside the Space on a GPU.Decorate the bound function with @spaces.GPU and, when the node runs, ZeroGPU grabs a GPU for that call, runs the model, and releases it.
We don't always need to rely on Inference Providers or existing Gradio Spaces.Check out this demo that animates a still image using Lightricks/LTX-Video loaded through Diffusers, running entirely through one node.gr.Workflow doesn't need to know anything about your GPU setup.
It simply calls the bound function.👉 Try the ZeroGPU Animator How it works, in a nutshell Every workflow is a graph with three kinds of nodes: references (your inputs), operators (the steps that do work), and subjects (your outputs).
An operator can be your own Python function, a model on Hugging Face Inference Providers, another Gradio Space, or a row from a Hub dataset.You connect them by dragging between typed ports, hit Run, and watch each result appear in place.
Call it from code Every workflow you build is also an API, with no extra work.Each output becomes a REST endpoint named after its label, and you can call it from Python with the Gradio client.
Here is a live, no-token example against the multi-endpoint demo Space, exactly as-is: from gradioclient import Client client = Client("ysharma/gr-workflow-multi-endpoint-API") print(client.predict("hello there friend", apiname="/wordcount")) # -> 3 print(client.
predict(20, apiname="/fahrenheit")) # -> 68.0 Endpoints that call a model or a Space run under a Hugging Face token, so pass one when you create the client: from gradioclient import Client, handlefile client = Client("ysharma/gr-workflow-image-editor", token="hf...") edited = client.
predict( handlefile("dog.jpg"), "turn it into a snowy winter scene", apiname="/editedimage", ) Prefer plain HTTP?Every endpoint is reachable over curl too: curl -s https://ysharma-gr-workflow-multi-endpoint-API.hf.
space/gradioapi/call/wordcount \ -H "Content-Type: application/json" -d '{"data": ["hello there friend"]}' Build your own The fastest way in is to open any demo above, click Duplicate, and start rewiring.From Python, it is as short as: import gradio as gr def yourfunction(text: str) -> str: pass gr.
Workflow(bind=[your_function]).launch() For the full walkthrough, the operator kinds, the JSON schema, and reusable patterns, see the official gr.Workflow guide in the Gradio docs.You can even build something as involved as AUTOMATIC1111 with gr.Workflow.
Keep an eye out for our next post, where we walk through building it step by step.
Here is a sneak peek 😉👇 Models mentioned in this article 4 Spaces mentioned in this article 6 More Articles from our Blog gradioserveropen-source Any Custom Frontend with Gradio's Backend 38 April 1, 2026 gradioclaudehtml One-Shot Any Web App with Gradio's gr.
HTML 36 February 18, 2026 Community EditPreview Upload images, audio, and videos by dragging in the text input, pasting, or clicking here.Tap or paste here to upload images Comment · Sign up or log in to comment Upvote - Models mentioned in this article 4 Spaces mentioned in this article 6
Related
相關文章

微軟 AI 智能體系統 Aion 曝光:以 Copilot 為核心、重塑桌面體驗
作者:故淵 責編:故淵 評論: 8 月 25 日消息,科技媒體 Windows Latest 昨日(8 月 24 日)發佈博文,從 BetaWiki Discord 頻道挖掘出更多線索,指出微軟 Project Aion 主要面向企業用戶,定位為沒有開始菜單的 AI 系統。
Meoo打通AI做App全鏈路,“一句話”就能做出安卓與iOS應用
近日,阿里AI應用搭建產品Meoo(秒悟)打通了自然語言做App的全鏈路。不懂編程的普通用戶只需用自然語言描述想法,Meoo即可自動生成頁面與功能,支持真機測試、持續修改與一鍵打包,最終產出可直接安裝使用的原生應用,覆蓋安卓與iOS雙端。“一個想法”到“一款應用”之間的門檻被大幅拉低。 過去,想法要變成真正可以安裝的App,中間隔著產品設計、界面開發、數據處理、真機測試和打包發佈等多道環節。即使外包給開發者或藉助低代碼工具,也普遍面臨成本高、週期長、專業邏輯欠缺等問題。
Grok Build迎來最強外掛!集成Browser-Use插件,AI正式接管你的瀏覽器
集成Browser-Use插件,AI正式接管你的瀏覽器發布於AI新閒資訊時間 :Aug 25, 2026閱讀 :1分鐘近日,SpaceX AI宣佈為其Grok Build平臺新增了一款功能強大的Browser-Use插件。這一功能的上線,使得Grok能夠直接調用真實瀏覽器,從而打通了AI與複雜網頁交互的物理壁壘。
英偉達加碼AI應用投資,Perplexity估值一年上漲超50%
Perplexity年化收入已從2.5億美元增長至超過7.5億美元,增長兩倍以上,其中部分增長來自AI代理“Perplexity Computer”的推出。該代理能夠自動執行多步驟任務,而智能體應用更高的Token消耗也可能進一步推高收入。
hermes-agent熱度高
NousResearch 的個人代理項目 hermes-agent 今日新增 896 顆星,顯示出相當高的熱度。該項目主打能隨用戶成長的長期代理功能,目前累計星數已達 23 萬 5791 顆。

AI Agent的下一站:一文讀懂Graph Engineering
近年來,AI Agent(智慧體)無疑是人工智慧領域最火熱的關鍵字之一。從單純的對話機器人,到能自主規劃任務、呼叫工具、執行複雜操作的數位助理,AI Agent 的能力邊界正快速擴張。然而,隨著任務複雜度提升,一個全新的技術挑戰浮上檯面:如何讓這些由大型語言模型驅動的代理,在面對錯綜複雜的真實世界問題時,能保持邏輯清晰、路徑明確且結果可靠?答案,或許就藏在「Graph Engineering(圖工程)」這個新興概念中。