Rebuilding AUTOMATIC1111 with Gradio Workflow

Hugging Face Blog Tools

Summary

This post showcases Workflow1111, a rebuild of AUTOMATIC1111's stable diffusion web UI using Gradio Workflow, which integrates multiple media pipelines and AI models into a single canvas.

No content available
Original Article
View Cached Full Text

Cached at: 09/10/26, 02:15 PM

Rebuilding AUTOMATIC1111 with Gradio Workflow

Source: https://huggingface.co/blog/gradio-workflow-1111 In ourlast post, we built five smallgr\.Workflowgraphs and hinted at what it would take to build something as complex as AUTOMATIC1111’sstable-diffusion-webui. In this post we walk you throughWorkflow1111, where we have rebuilt most of AUTOMATIC1111’s feature set as a single workflow canvas.

Workflow1111 is a graph ofeleven media pipelinesbuilt usingseventy-three nodes. It brings together SOTA models for text-to-image, hi-resolution fix, image-to-image, prompt-matrix grids, VLM interrogate, detection-to-inpaint masks, ControlNet-style annotators, background removal, PNG Info storing, and image-to-video.

You can run any of these pipelines by signing in with your Hugging Face account or providing an access token. Once you sign in, the model calls use your own quota.

👉Try Workflow1111, or duplicate the Space and start rewiring it for your own use case.

Let’s walk the canvas.

https://huggingface.co/blog/gradio-workflow-1111#whats-on-the-canvasWhat’s on the canvas

All the media pipelines are built from the same four operator kinds covered in our last post and theofficial guide. Each node on the canvas wraps one operator, and the operator’s inputs and outputs become the ports you connect edges to. As a quick reference on our four operator kinds:fnis a Python function,modelis a model called throughInferenceClient,spaceis another Gradio Space, anddatasetis a row from a Hub dataset.

Let’s go through the pipelines one by one.

https://huggingface.co/blog/gradio-workflow-1111#text-to-imageText-to-image

This is the core pipeline. It has the controls you’d expect from A1111’s txt2img tab: negative prompt, steps, CFG, seed, width and height, plus amodel\_idfield for choosing the checkpoint. The prompt goes through a prompt-builderfnnode first, which appends the selected style preset and cleans up the text, then into amodelnode that calls the checkpoint through Inference Providers. A post-processfnnode writes the generation parameters into the PNG’s metadata on the way out, which is what the PNG Info pipeline reads back later.

https://huggingface.co/blog/gradio-workflow-1111#hi-resolution-fixHi-resolution fix

In Automatic1111, hi-resolution fix first upscales the txt2img output and then runs a second denoising pass. Here it’s a two-node detour instead. The text-to-image result goes into aFLUX.1-Kontextmodelnode with a refine instruction (“enhance fine detail and micro-texture, keep the composition identical”) and comes back sharper and larger.

https://huggingface.co/blog/gradio-workflow-1111#image-to-imageImage-to-image

That same Kontext node doubles as the image-to-image tab. Upload an image, describe the change you want, and it returns the edited image.

https://huggingface.co/blog/gradio-workflow-1111#let-an-llm-write-the-promptLet an LLM write the prompt

Start with a rough prompt like “A lighthouse in a storm.” This pipeline sends it to aQwen3-4Bmodelnode, and a smallfnnode turns the reply into a clean list of tags, capped at forty: “stormy sea, wet rocks, dramatic composition, low angle shot, volumetric lighting, ominous tone.” You can connect any diffusion model node to this output to render the image.

There’s no custom node involved, unlike in ComfyUI. In a Gradio workflow the LLM and the diffusion model are both ordinarymodeloperators on the same canvas.

https://huggingface.co/blog/gradio-workflow-1111#read-an-image-back-into-a-promptRead an image back into a prompt

This is like AUTOMATIC1111’s Interrogate button, with a VLM doing the interrogating instead of CLIP.Qwen2.5-VLlooks at a night-market photo and writes a prompt that could have produced it. AViTclassifier node reads the same image and returns labels: restaurant 51.9%, tobacco shop 15.6%, toyshop 9.1%.

Both nodes use the same image input, sogr\.Workflowruns them in parallel and you get both answers in roughly the time it takes to run one.

https://huggingface.co/blog/gradio-workflow-1111#detection-to-inpaint-maskDetection to inpaint mask

AUTOMATIC1111 makes you paint an inpaint mask by hand. This pipeline generates one from a detector instead.DETRfinds six objects in a street photo (three people, a dog, a bicycle, and a car), and from there the workflow splits into two branches: one draws the detected boxes on the original image, the other turns them into a mask you can feed into an inpaint pipeline downstream.

The drawing and the mask creation both happen locally with Pillow and NumPy. Only the detection call leaves the machine.

https://huggingface.co/blog/gradio-workflow-1111#prompt-matrixPrompt matrix

This is like AUTOMATIC1111’s prompt matrix. A base prompt, “a lone oak tree,” gets combined with four suffixes (at sunrise, in a thunderstorm, under the Milky Way, in autumn fog) by afnnode, and each variant goes to its own text-to-image node. A final node stitches the four results into one contact sheet.

gr\.Workflowhas no loop operator, so the four text-to-image nodes sit side by side on the canvas. Since they’re at the same dependency depth they run in parallel, and all four images start generating at once.

https://huggingface.co/blog/gradio-workflow-1111#upscale-and-background-removalUpscale and background removal

This is like the Extras tab in Automatic1111. There are two upscaler nodes, and they take different routes. The first is a localLanczosresample in anfnnode, which needs no network call and finishes as fast as Pillow can resize. The second isAuraSR ×4, and it’s the firstspacenode on the canvas: it calls aSpaceon the Hub and treats the result like any other node output.

Background removal works the same way.BRIA RMBG-2.0is anotherspacenode, so the whole model lives in its own Space and this canvas just calls it in.

https://huggingface.co/blog/gradio-workflow-1111#annotatorsAnnotators

Canny, line art, sketch, luma-depth, and posterize are the preprocessors you’d normally get from the ControlNet extension in Automatic1111. Here, each one is afnnode written in plain NumPy, with no model behind it. On a pre-loaded example photo of a building facade, each annotator takes about half a second on CPU.

There are 36 operator nodes in the app, 32 arefnnodes, and 22 of those run entirely in-process without a network call. Roughly two-thirds of the canvas keeps working if you lose your connection. Since these are regular Python functions, you can also test them directly, with no canvas, server, or GPU involved.

https://huggingface.co/blog/gradio-workflow-1111#png-infoPNG Info

AUTOMATIC1111 stores generation details in the PNG’sparameterstext chunk, and the PNG Info tab reads them back. Workflow1111 does the same. The post-process node on the text-to-image pipeline writes the metadata, and this pipeline reads it back out, including the prompt, negative prompt, steps, CFG, seed, image size, and model.

https://huggingface.co/blog/gradio-workflow-1111#image-to-videoImage-to-video

The image node that PNG Info reads from also feeds aWan 2.2 I2V A14Bnode, which animates it; in the demo example a sleeping fox wakes up and starts moving. There’s no second upload box because one reference node can feed as many downstream pipelines as you need, so a single upload gets its metadata read and gets animated on the same canvas.

https://huggingface.co/blog/gradio-workflow-1111#running-models-on-your-own-gpuRunning models on your own GPU

So far every model call has gone to someone else’s hardware, through Inference Providers or a Space. That’s why you can build and run something like Workflow1111 without a GPU of your own.

Afnnode is just Python, though, so it can equally load a model locally and run it on your own GPU.FastVideo/fastvideo-fasth3-previewis agr\.Workflowapp that does exactly that. It runsFastH3, a four-step distillation ofMiniMax-H3, and generates video with a soundtrack on ZeroGPU.

The whole app comes down to one bound function:

@spaces.GPU(duration=get_duration, size=GPU_SIZE)
def _generate(prompt_embeds, text_token_tags, height, width, num_frames, seed):
    ...

gr.Workflow(bind={"generate": generate, "status": status}).launch()

ZeroGPUgives the function a GPU when it needs one, then releases it when the call is done.gr\.Workflowdoesn’t need to know about any of that. It just calls thefnnode.

This isn’t specific to Spaces either. Pointbind=to a function that loads a local checkpoint, run\.launch\(\)on your own machine, and the Workflow1111 canvas can drive your own GPU.

https://huggingface.co/blog/gradio-workflow-1111#every-output-is-an-apiEvery output is an API

Every output node on the canvas becomes a REST endpoint, with no routes written by hand. Workflow1111 exposes nine of them:/image,/edited\_image,/generated\_prompt,/recovered\_prompt,/detected\_objects,/x\_y\_grid,/upscaled\_local,/annotator\_map, and/png\_info.

from gradio_client import Client

client = Client("ysharma/Workflow1111", oauth_token="hf_...")

image, params, hires = client.predict(
    "a red fox in a snowy pine forest",  # Prompt
    "",                                  # Negative prompt
    "Cinematic",                         # Style preset
    "enhance fine detail",               # Hires refine instruction
    api_name="/image",
)

The same endpoints are alsoMCPtools. Launch withmcp\_server=True(guide) and every output node shows up as a tool an AI assistant can call. Point Claude Code, Cursor, or any MCP client at the server URL:

{
  "mcpServers": {
    "workflow1111": {
      "url": "https://ysharma-workflow1111.hf.space/gradio_api/mcp/",
      "headers": { "X-HF-Token": "hf_..." }
    }
  }
}

Now an agent can generate an image, read a prompt back out, or run detection as steps in a larger task, with no glue code. Each caller sends their own token in theX\-HF\-Tokenheader, so the Space holds none of its own.

https://huggingface.co/blog/gradio-workflow-1111#where-this-sits-next-to-comfyuiWhere this sits next to ComfyUI

AUTOMATIC1111 gave us the feature list, but the tool Gradio Workflow really gets compared to is ComfyUI, since both are node graphs. For a lot of what people want to build and ship,gr\.Workflowcovers the same ground.

  • **A node can be hardware you don’t own.**It can run throughInference Providers, call any Space on the Hub or any API, or pull from a dataset. That’s how Workflow1111 runs without a GPU of its own.
  • **Every output becomes a typed REST endpoint.**The endpoints are generated from the graph.
  • **Visitors can run workflows under their own identity.**Turn onOAuth, share the public URL, and anyone can sign in and use the app without installing anything.
  • **Mix models and modalities on the same canvas.**Diffusion models, LLMs, VLMs, detectors, and video models can all be part of the same workflow.
  • **Need something custom? Write a function.**A custom node is a Python function, so it can do whatever Python can.

The result is a multi-model pipeline that people can open in a browser, sign into, use right away, and call from code.

https://huggingface.co/blog/gradio-workflow-1111#build-your-ownBuild your own

Workflow1111 has 73 nodes, but it started with just this:

import gradio as gr

def your_function(text: str) -> str:
    pass

gr.Workflow(bind=[your_function]).launch()

bind=turns your functions into nodes,edges=connects them, and\.launch\(\)opens the canvas in your browser so you can keep editing there. When it’s ready,gradio deployputs the whole thing on a Space. Thegr.Workflow guidehas the full details, including the JSON schema and every operator type.

If you’d rather start from something that already works, openWorkflow1111, hitDuplicate, and pick one of the eleven pipelines to change: delete nodes, swap models, rewire the flow. If you’d rather start smaller, theprevious posthas five workflows you can get running in about a minute each.

Whatever you build, post it on X and tag@gradio. We’d be happy to amplify your workflows.

Similar Articles

Wire It, Run It, Deploy It: AI Workflows in Gradio

Hugging Face Blog

The article introduces `gr.Workflow` in Gradio, a feature that allows users to build AI pipelines as interactive, visual interfaces with drag-and-drop nodes, complete with live examples and easy deployment to Hugging Face Spaces.

Gradio Workflow

Product Hunt

Gradio Workflow launches a visual interface for building AI pipelines by connecting nodes, powered by Hugging Face, enabling easy integration and sharing via URL or REST API.

AUTOMATIC1111/stable-diffusion-webui

GitHub Trending (daily)

This open-source project provides a feature-rich web interface for Stable Diffusion, enabling users to easily generate, edit, and upscale images using various AI models and extensions. Built with Gradio, it supports txt2img, img2img, inpainting, and numerous community-driven tools for local AI image generation.