Workflow1111 Rebuilds AUTOMATIC1111 Features with Gradio Workflow
TL;DR
Workflow1111 is a Gradio Workflow that reproduces the core feature set of AUTOMATIC1111's stable‑diffusion‑webui using 73 nodes and eleven media pipelines, letting anyone run text‑to‑image, inpainting, upscaling, video generation and more from a browser without owning a GPU.
What Workflow1111 Is
Workflow1111 is a single gr.Workflow canvas that stitches together eleven distinct media pipelines. The graph contains seventy‑three nodes of four operator kinds (fn, model, space, dataset). Each node wraps a function, a Hugging Face model accessed via InferenceClient, another Gradio Space, or a dataset row. The result is a modular, browser‑based UI that mirrors the tabs and extensions of AUTOMATIC1111's stable‑diffusion‑webui.
"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." – Hugging Face blog
Core Pipelines and Their Implementations
Text‑to‑Image
- Replicates the txt2img tab with controls for negative prompt, steps, CFG, seed, width, height, and checkpoint selection.
- Prompt passes through a
fnnode that adds style presets and cleans text, then amodelnode calls the chosen diffusion checkpoint via Inference Providers. - A post‑process
fnnode writes generation parameters into the PNG metadata, enabling later retrieval.
Hi‑Resolution Fix
- Implements AUTOMATIC1111's upscale‑then‑refine workflow with a two‑node detour.
- The output of the text‑to‑image pipeline feeds a FLUX.1‑Kontext
modelnode with a refine instruction ("enhance fine detail and micro‑texture, keep the composition identical").
Image‑to‑Image
- Reuses the same Kontext node: upload an image, describe the desired edit, and receive the edited result.
LLM‑Generated Prompt
- Sends a rough prompt to a Qwen3‑4B
modelnode. - A downstream
fnnode formats the LLM response into a capped list of up to forty tags, which can be fed to any diffusion model node.
Image‑to‑Prompt (Interrogate)
- Uses Qwen2.5‑VL‑7B‑Instruct to generate a textual description of an input image.
- In parallel, a ViT‑base‑patch16‑224 classifier returns label probabilities.
- Parallel execution means both results are available in roughly the time of a single model call.
Detection‑to‑Inpaint Mask
- A DETR‑ResNet‑50 detector identifies objects (e.g., people, dog, bicycle, car) and produces bounding boxes.
- One branch draws the boxes on the image; another converts boxes to a binary mask for downstream inpainting.
- Detection runs remotely; drawing and mask creation happen locally with Pillow/NumPy.
Prompt Matrix
- A
fnnode expands a base prompt with four suffixes, creating four parallel text‑to‑image nodes. - A final node stitches the four results into a contact sheet.
- No loop operator is needed; parallel nodes run simultaneously.
Upscale & Background Removal
- Two upscaler paths: a local Lanczos resample (
fnnode) and an external AuraSR ×4 Space (spacenode). - Background removal calls the BRIA RMBG‑2.0 Space, keeping the model isolated from the main canvas.
Annotators (ControlNet‑style Pre‑processors)
- Canny, line art, sketch, luma‑depth, and posterize are implemented as pure NumPy
fnnodes. - 32 of the 36 operator nodes are
fnnodes, 22 of which run entirely in‑process without network calls, allowing most of the canvas to stay functional offline.
PNG Info
- Mirrors AUTOMATIC1111's PNG metadata storage: a post‑process node writes parameters to the PNG
parameterschunk; a dedicated pipeline reads them back (prompt, negative prompt, steps, CFG, seed, size, model).
Image‑to‑Video
- The PNG Info node also feeds a Wan 2.2 I2V A14B
modelnode that animates the image (e.g., a sleeping fox waking up). - A single upload can drive multiple downstream pipelines.
Running on Your Own GPU
- By default, all
modelandspacecalls use remote hardware via Inference Providers or external Spaces, so the workflow works without a local GPU. - Any
fnnode can be swapped for a locally‑loaded model. The blog cites FastVideo/fastvideo‑fasth3‑preview, which runs a distilled MiniMax‑H3 model on a ZeroGPU allocation. - Example binding syntax:
@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() - ZeroGPU automatically provisions a GPU for the function call and releases it afterward;
gr.Workflowremains oblivious to the allocation.
Every Output Is an Automatic REST API
- Each output node becomes a typed endpoint (e.g.,
/image,/edited_image,/generated_prompt). - Example client call:
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", "", "Cinematic", "enhance fine detail", api_name="/image" ) - Endpoints are also compatible with the Model Context Protocol (MCP), enabling AI assistants (Claude Code, Cursor, etc.) to invoke them directly.
Comparison with ComfyUI
| Feature | Workflow1111 (Gradio) | ComfyUI |
|---|---|---|
| Hardware abstraction | Nodes can point to remote Inference Providers, Spaces, or datasets; no local GPU required. | Primarily local GPU execution; external calls require custom scripting. |
| Automatic API generation | Every output node becomes a REST endpoint without manual routing. | No built‑in API generation; developers must expose endpoints themselves. |
| OAuth‑based multi‑user access | Users sign in with Hugging Face accounts; usage is billed to their quota. | Typically single‑user desktop application. |
| Mixed‑modality graphs | Diffusion, LLM, VLM, detection, video models coexist on one canvas. | Supports multiple model types but integration often needs custom nodes. |
| Custom logic | Simple Python fn nodes allow arbitrary code on the canvas. |
Custom nodes require writing C++/Python extensions. |
The blog concludes that Gradio Workflow offers a browser‑first, zero‑install experience that matches the breadth of ComfyUI while adding remote execution and auto‑API capabilities.
Getting Started with Your Own Workflow
- Create a minimal workflow:
import gradio as gr def your_function(text: str) -> str: return text.upper() gr.Workflow(bind=[your_function]).launch() - Bind additional functions, models, or Spaces using the
bind=argument. - Connect nodes with the
edges=parameter or interactively on the canvas. - Deploy with
gradio deployto publish on Hugging Face Spaces. - Duplicate Workflow1111 from the public Space, delete or replace nodes, and experiment with new pipelines.
For full schema details, see the official Gradio Workflow guide.
Why It Matters
- Demonstrates that complex, multi‑model UI stacks can be assembled without a local GPU, lowering the barrier for creators and researchers.
- Provides a unified, auto‑generated API surface, making it trivial to integrate generative pipelines into larger systems or AI assistants.
- Positions Gradio Workflow as a direct, cloud‑first competitor to desktop‑only node editors like ComfyUI, expanding the ecosystem for rapid prototyping and deployment.
Feel free to duplicate the Space, remix the pipelines, and share your creations on X tagging @gradio.