Skip to content

Back to the catalog

Rebuilding AUTOMATIC1111 with Gradio Workflow
huggingface.cowriteup

Rebuilding AUTOMATIC1111 with Gradio Workflow

A Hugging Face blog post walking through Workflow1111, a 73-node graph built with Gradio's gr.Workflow that reimplements most of AUTOMATIC1111's stable-diffusion-webui feature set as a single visual canvas: text-to-image, hi-res fix, image-to-image, prompt matrix, VLM interrogation, detection-to-inpaint masking, ControlNet-style annotators, background removal, PNG metadata round-tripping, and image-to-video, wired from models like FLUX.1-Kontext, Qwen3-4B, Qwen2.5-VL, DETR, AuraSR, BRIA RMBG-2.0, and Wan 2.2 I2V A14B. It contrasts gr.Workflow with ComfyUI, shows that every output node auto-becomes both a REST endpoint and an MCP tool (usable by Claude Code or Cursor), and demonstrates running nodes locally on your own GPU via ZeroGPU (FastVideo/fastvideo-fasth3-preview) instead of hosted inference.

TL;DR Hugging Face rebuilds AUTOMATIC1111's entire feature set as a 73-node visual pipeline using Gradio's gr.Workflow, with every output auto-exposed as a REST/MCP endpoint.
Document

What it claims

Workflow1111 is a public Space, ysharma/Workflow1111. It packs eleven pipelines into one gr.Workflow canvas, and most of it runs without a GPU or a network call. The page counts 73 nodes overall, of which 36 are operator nodes. Of those 36, 32 are fn nodes, and 22 of those run entirely in-process. The authors estimate that about two-thirds of the canvas keeps working offline. Remote model calls run under each signed-in user's own Hugging Face quota, so the Space holds no token of its own.

How it works

Every node wraps one of four operator kinds:

  • fn: a Python function.
  • model: a model called through InferenceClient / Inference Providers.
  • space: another Gradio Space.
  • dataset: a row from a Hub dataset.

Several details differ from what the A1111 names suggest:

  • Hi-res fix is not a second denoising pass. It is a FLUX.1-Kontext edit with the instruction "enhance fine detail and micro-texture, keep the composition identical". The same Kontext node also serves as img2img.
  • Annotators have no model behind them. Canny, line art, sketch, luma-depth and posterize are plain NumPy fn nodes, taking about 0.5 s each on CPU. Box drawing and mask creation after DETR are also local (Pillow/NumPy); only the detection call leaves the machine.
  • Two upscalers. One is a local Lanczos resample. The other is AuraSR ×4, called as a space node. BRIA RMBG-2.0 is also a space node.
  • No loops. gr.Workflow has no loop operator, so the prompt matrix uses four side-by-side text-to-image nodes. Nodes at the same dependency depth run in parallel, so all four start at once. The same rule lets Qwen2.5-VL and a ViT classifier read one image concurrently.
  • Prompt expansion. Qwen3-4B's reply is turned into a tag list capped at 40 tags.
  • PNG metadata. Generation parameters go into the PNG parameters chunk, as A1111 does: prompt, negative prompt, steps, CFG, seed, size and model.

How to use it

The canvas starts from bound functions. edges= wires them together, and gradio deploy pushes the result to a Space:

import gradio as gr
def your_function(text: str) -> str:
    pass
gr.Workflow(bind=[your_function]).launch()

REST endpoints. Every output node becomes an endpoint. There are nine: /image, /edited_image, /generated_prompt, /recovered_prompt, /detected_objects, /x_y_grid, /upscaled_local, /annotator_map, /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",
)

MCP tools. Launching with mcp_server=True exposes the same outputs as MCP tools. Each caller supplies their own token:

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

Your own GPU. This is done with an fn node that loads a model, not with a special operator. FastVideo/fastvideo-fasth3-preview wraps FastH3, a 4-step distillation of MiniMax-H3, in @spaces.GPU(duration=..., size=...) and binds it with gr.Workflow(bind={"generate": generate, "status": status}). That example runs on ZeroGPU on Spaces. To run locally instead, you bind a function that loads a local checkpoint and call .launch() on your own machine.

Limits

  • No latency or quality figures. The page gives none for any pipeline, and the Kontext-based hi-res fix is not compared against A1111's version. The only timing given is about 0.5 s per annotator on CPU.
  • Remote nodes need sign-in or a token. They spend the caller's Inference Provider quota.
  • No loop operator. Repetition is done by duplicating nodes.
  • The ComfyUI comparison is qualitative only. No benchmarks are given.
  • No licences are given. The page names models (FLUX.1-Kontext, Wan 2.2 I2V A14B, RMBG-2.0, etc.) without stating their licences. Check each one before you build on it.

Organisations named here

  • Hugging Face
  • Gradio
  • AUTOMATIC1111
  • Claude Code
  • ComfyUI
  • Cursor
  • FastVideo
  • Model Context Protocol
  • ViT
  • Workflow1111

Technologies named here

  • gr.Workflow
  • FLUX.1-Kontext
  • Qwen3-4B
  • AUTOMATIC1111 / stable-diffusion-webui
  • Qwen2.5-VL
  • ComfyUI
  • ViT classifier
  • Inference Providers
  • DETR
  • InferenceClient
  • AuraSR
  • Hugging Face Spaces
  • gradio_client
  • BRIA RMBG-2.0
  • MCP
  • Wan 2.2 I2V A14B
  • FastH3
  • Pillow
  • MiniMax-H3
  • NumPy
  • ZeroGPU
  • gradio deploy
  • Gradio
  • Hugging Face
  • Model Context Protocol
  • Qwen3
  • Vision language model
  • Python

Techniques named here

  • Hi-resolution fix
  • Prompt matrix
  • VLM/classifier interrogation
  • Detection-to-inpaint mask generation
  • Parallel execution by dependency depth
  • PNG metadata round-trip
  • Auto-generated REST/MCP endpoints from the graph