Your GPU, as something an agent can drive.
diffusers-workflow runs Hugging Face Diffusers image, video and audio generation as jobs on your own GPU. An agent does the work. Claude Code, or any MCP client, picks or writes the workflow, checks what it will cost, runs it, and looks at what came back. You steer from the browser. Every workflow, run and output the agent made is in the web UI, where you can change a variable, run it again, compare takes and keep the one you like.
Python 3.12-3.14 | CUDA (NVIDIA) | MPS (Apple Silicon) | CPU (what runs where)
The job is the same: load models, wire steps together, get media out. What changes is who builds the graph and how it is checked before it runs.
| ComfyUI | diffusers-workflow | |
|---|---|---|
| A workflow is | a node graph you draw | a JSON document of named steps an agent writes, and you can edit as a form |
| A new model needs | a custom node pack | nothing, if diffusers has the pipeline: any pipeline class is reachable by name |
| Mistakes are found | links are type-checked on queue; the rest when it runs | at validation: schema, references and every argument against the real pipeline signatures, before any model loads |
| Before a long render | no estimate | validate_workflow quotes GPU minutes from this machine's own run history |
| Between runs | models stay loaded | models stay loaded (one persistent worker per GPU) |
| A result | an image with the graph embedded | the same, and a job that keeps the exact workflow it ran, drawn as a data-flow graph, re-runnable with a new seed |
It is not a ComfyUI replacement for hand-wiring a graph node by node. It is for describing what you want and letting an agent compose, price, run and judge it, then taking over in the browser where that is quicker.
| Ready-made templates | |
|---|---|
| Images | FLUX 3 Klein (text, edits, multi-reference, layout boxes), MiniMax-H3-Image (text, multi-reference edits at up to ~16 MP), FLUX.1 / FLUX.2 / Krea, Qwen Image (and edit), Z-Image, SDXL and SD 1.5; ControlNet, IP-Adapter, LoRA, inpaint and outpaint |
| Video with sound | MiniMax H3 (dialogue, multi-shot cuts, music videos, reference subjects and voices), LTX-2.5 (image-to-video, keyframes, 2x upscale, restore and colourise, alpha mattes), Kandinsky 6 |
| Music, speech, sound | MiniMax Music 3 (sung lyrics or instrumental), Audio8 TTS voice cloning and MMS TTS, MMAudio sound effects from text or under a clip, Whisper transcription |
| Longer than one clip | chained segments that hold the look and audio level across seams, repair of one bad segment in place, music and narration of any length, storyboards and timed animatics, cut-and-score assembly, and an OpenTimelineIO export that DaVinci Resolve opens as one clip per shot |
Anything else diffusers can load runs from a workflow too; the templates are where the agent starts, not a limit. The full list is in workflows/ and the dw plugin.
What you need first. A GPU driver (an NVIDIA driver 580 or newer gets the CUDA 13 torch build; an older one gets PyPI's CUDA 12 build, and no working driver gets CPU-only torch, which runs everything slowly; Apple Silicon needs nothing extra), and disk: torch and the venv take several GB, the first run downloads SD 1.5, a few GB more, and most other models are tens of GB each. To drive it, Claude Code or Claude Desktop. The installer brings its own Python; you need no git, Python or Node.
1. Install. Paste one line. It installs uv, Python, dw with the right torch
build for your machine and diffusers from GitHub, then runs dw setup, which
starts the server at login and connects Claude Desktop and Claude Code if you have
them. The torch download takes a while.
curl -LsSf https://github.com/dkackman/diffusers-workflow/releases/latest/download/bootstrap.sh | bashpowershell -ExecutionPolicy ByPass -c "irm https://github.com/dkackman/diffusers-workflow/releases/latest/download/bootstrap.ps1 | iex"Re-running the same line upgrades dw. Where everything goes, every dw setup
flag, checking the script's SHA-256 first, and troubleshooting are in
Installing dw.
2. Open the UI. Setup opens http://127.0.0.1:8765. The server runs in the
background from now on and starts again at login.
3. Start your agent. In a terminal, start Claude Code with
the notes channel, so a note you save in the UI
reaches the session as you save it. dw is not on your PATH, so run it from
the install's venv
(INSTALL.md):
~/.local/share/diffusers-workflow/venv/bin/dw agent& "$env:LOCALAPPDATA\diffusers-workflow\venv\Scripts\dw.exe" agentOr open Claude Desktop, which lists dw as connected. Start a new session either way: a session that was already open does not see the registration.
4. Check it works. Ask the agent: "Run templates/text-to-image with the
prompt 'a lighthouse at dusk'." That is the smoke test: SD 1.5, the smallest and
fastest model in the catalog, there to prove the install generates, not to show what
dw can draw. The example catalog ships with dw, so an
installed copy and a checkout both have it. The agent quotes the cost, and a direct ask like this one counts as the go-ahead, so it
may run straight away. The first run downloads SD 1.5 (about 4 GB), so it takes
about a minute on a fast connection and longer on a slow one; later runs reuse it.
The agent shows you the image, and it is in the web UI's gallery and under the
workspace's outputs/ folder (Workspaces).
5. Make a real picture. Ask for one without naming a model ("a lighthouse at
dusk, the best you can do"). The plugin's choosing-a-model skill runs
templates/preferred/text-to-image, which asks the server for its preferred
text-to-image model at a tier of draft, standard or best; the server picks the
first one in that tier that fits this machine, and the agent tells you which before it
spends. Those models are larger downloads than SD 1.5. Name a model or workflow and
that one runs instead.
The dw plugin gives Claude Code its skills and its dw
tools; setup installs it. To update it by hand later (get_server_info tells the
agent when the installed skills are older than the server), refresh the
marketplace and reinstall, then /reload-plugins or start a new session:
/plugin marketplace update diffusers-workflow
/plugin uninstall dw@diffusers-workflow
/plugin install dw@diffusers-workflow
Most of the shipped models (Flux, LTX, MiniMax, ...) are gated. Request access on
the model's Hugging Face page and run hf auth login once (setup offers to). Without it a run fails
partway through with a 401/403 from the Hub. templates/text-to-image uses a small,
ungated model, so it makes a good smoke test.
To work on dw itself, install from a clone instead.
- Everywhere: git; Python 3.12-3.14; Node.js 24.20 or
newer, which brings npm (
install.shuses it to build the web UI, and without it there is no page at/); and Claude Code, theclaudecommand. - macOS: the system
python3is too old. Install Python from Homebrew (brew install python@3.13) or python.org, and git with the Xcode Command Line Tools (xcode-select --install). Node also comes from Homebrew (brew install node). - Debian / Ubuntu: the venv module is a separate package:
sudo apt install git curl python3.12-venv(match your Python version, for examplepython3.13-venv). apt'snodejsis older than 24.20, so take Node from nodejs.org (its nvm line needs thatcurl). On Ubuntu,install.shmay ask for yoursudopassword once, toapt install bcwhen it is missing.
Clone the repository and run the install script. It picks the torch build the same
way, creates venv/ and installs the server, the MCP server and the web UI:
git clone https://github.com/dkackman/diffusers-workflow.git
cd diffusers-workflow
bash ./install.sh && source ./activate # Linux / macOS
.\install.ps1; .\venv\scripts\activate # WindowsStart the engine from the checkout and leave it running (it uses the checkout as its workspace):
dw-serve # web UI on http://127.0.0.1:8765In a second terminal, from the checkout, connect Claude Code without installing a service:
venv/bin/dw setup --no-service --no-desktopThat installs the dw plugin and points its dw tool server at this venv, and adds
the notes channel. To add the plugin by hand instead, type these lines
inside Claude Code, not in the shell; the plugin's dw server then starts only
once dw setup has written its launcher (INSTALL.md):
/plugin marketplace add dkackman/diffusers-workflow
/plugin install dw@diffusers-workflow
GPU on another machine, or in Docker?
Start the engine on the GPU box with --mcp and connect over HTTP. There is nothing
to install on the laptop:
# on the GPU box
dw-serve --host 0.0.0.0 --token "$DW_API_TOKEN" --mcp --workspace ~/studio
# on your laptop
claude mcp add --transport http dw http://gpu-box:8765/mcp \
--header "Authorization: Bearer $DW_API_TOKEN"The server's Connect page writes that line for you. The whole setup is in Remote GPU server.
On Linux with an NVIDIA GPU, the
dkackman/diffusers-workflow
image runs the server with torch, the engine and the web UI built in. It shares the
model cache and workspace with a native install on the same box. See
Docker.
Describe what you want. The agent has 69 tools covering the workflow catalog, the real diffusers pipeline signatures, the job queue, the gallery and the model cache, and it stays with a long render until it finishes:
A session sounds like this:
- "Make a 30-second musical trailer: four men in boater hats, a giant eye, a
score under it." The agent picks a shape from the catalog (
list_workflows), breaks the brief into shots, writes each prompt to the prompt library, and builds the workflow that renders the shots and cuts them to the score. - "What will that cost?"
validate_workflowchecks the JSON against the schema and the real pipeline signatures, with no model loads, and quotes an estimate in GPU minutes from this box's own history. Anything that spends GPU time or disk refuses to run until the agent passesacknowledged_cost, so it has to tell you what it is about to spend first. - "How's it going?"
wait_for_jobwaits out a render without polling. Thenget_output_frames,get_output_imageandget_output_audiobring the result back into the conversation, so the agent judges what it made against what you asked for. - "Shot three is the one. Keep it and start the next scene from it."
keep_outputturns the file into a named asset, and the next workflow references it asasset:hero-frame.png.
The dw plugin adds what a general-purpose agent can't know on its own: one skill per model family (MiniMax H3, MiniMax-H3-Image and Music 3, LTX-2.5, Kandinsky 6, FLUX 3 Klein) that picks the template for a request and states the rules that bite. Cross-cutting skills cover script-to-video, series with a consistent cast, storyboards and animatics, pieces longer than one clip, and a shared camera-and-look vocabulary.
One server holds several workspaces, each with its own workflows, assets and outputs. Two agents, or an agent and you in the browser, can share one GPU without saving over each other's work.
An ask of more than a couple of jobs gets a request: the agent writes its plan (the goal and the items it will make) into the workspace, links each job to its item, and records which take it kept, so the plan outlives the session. The Requests page shows where each request stands, what needs you, and each item's takes and minutes spent. Notes you leave on an item, a take or a file (from the request page, a job page or the gallery) are read by the agent before it plans again. See Requests.
With the notes channel, a note reaches the agent as you save it: dw-mcp --notes-channel runs beside an open Claude Code session and tells it which item,
take or file the note is on, and the agent acts (a retake, then the cut again).
It uses Claude Code's channels research preview, so it needs an interactive
session started with the development-channels flag, and may change. Setup:
the notes channel.
The tool reference, setup for other MCP hosts and the troubleshooting table are in MCP Server.
The web UI shows everything the agent made and lets you take over at any point. It runs on the same persistent GPU worker, so models stay loaded between runs.
A workflow the agent wrote is a form you can edit. The workflow's description, recent outputs and variables are on one page. Change a prompt, a frame count or a LoRA scale and press Run.
Every job is a recipe. A job keeps the exact workflow it ran and draws it as a
graph of how data flows between steps. Click a step to see what it produced. The
run's warnings sit above the graph, so a problem the agent missed, such as an
audible level jump at a cut, is in front of you with the argument that fixes it.
Run again repeats the job, New seed gives you another take, and Run
again with changes… or a preset button (tier: standard) queues it with only
the variables you change - the rerun page says changed: …. Progress
streams live for each denoising step, and a cancel stops the job cleanly at the
next step.
The gallery groups outputs by the workflow that made them, with final and intermediate files kept apart. Any image reopens as the workflow that produced it. Keep as asset adds a file to the asset library for later workflows to use.
The editor works on the agent's JSON. You can view the workflow as a form, as JSON, side by side, or as a flow graph. The forms and autocomplete come from the real diffusers pipeline signatures, so every argument a pipeline takes is there with its documentation. Validate catches schema errors and argument typos before any model loads.
There is also a prompt library, with an Enhance with AI panel that expands an idea into a full prompt using a local language model. The model manager shows the Hugging Face cache (size, last use, free disk) and downloads or deletes models with live progress.
The pages are described in Server & Web UI. The UI and the agent
both use the server's HTTP API, which you can browse at /docs on a running server
(see The HTTP API).
Every front end reads and writes the same thing: a JSON workflow of named steps,
each a diffusers pipeline or a utility task. Its arguments are references to
variables, earlier steps' results, stored prompts and assets, not hard-coded
values. That is how text-to-image chains into image-to-video, and how a generated
image reopens as the recipe that made it. You rarely need to write one by hand. When
you do, the Workflow Guide is the reference, the
JSON Schema is the exact structure, and
workflows/ has runnable examples for each model family. There is also
a command-line client, python -m dw.run workflow.json prompt="a cat", which queues
a job on a running server (see Server & Web UI).
Here is the shape, trimmed: a still from FLUX 3 Klein, animated by LTX-2.5.
{
"variables": { "prompt": "a lighthouse at dusk, waves breaking", "seed": null },
"seed": "variable:seed",
"steps": [
{
"name": "still",
"pipeline": {
"configuration": { "component_type": "ModularPipeline" },
"from_pretrained_arguments": { "model_name": "black-forest-labs/flux-3-image-klein" },
"arguments": { "prompt": "variable:prompt", "width": 1280, "height": 720 }
}
},
{
"name": "clip",
"pipeline": {
"configuration": { "component_type": "LTX2ImageToVideoPipeline" },
"from_pretrained_arguments": { "model_name": "Lightricks/LTX-2.5-Diffusers" },
"arguments": { "prompt": "variable:prompt", "image": "previous_result:still" }
},
"result": { "content_type": "video/mp4" }
}
]
}component_type is a diffusers class name and arguments are its __call__
arguments, so the diffusers docs are the reference for what a step takes. The real
templates add the device placement, quantization and size rules each model needs.
The engine also covers:
- Quantization: BitsAndBytes, TorchAO, GGUF and SDNQ, set per component, and any other backend with a config class (optimum-quanto, say) by import.
- Acceleration: FirstBlockCache, FasterCache, MagCache, TaylorSeerCache,
torch.compileand attention backends. - Adapters and prompts: LoRA, IP-Adapter and A1111-style prompt weighting.
- Step-output caching: re-running a fixed-seed workflow, or one that changed only a later step, reuses the steps that did not change.
- Utility tasks: upscaling, face restoration, segmentation, captioning, frame interpolation, audio slicing, cut-and-score assembly and more.
A workflow can reach any diffusers pipeline or quantization backend by dynamic
import, so loading one can execute arbitrary Python. Treat a workflow file from
someone else the way you'd treat a .py script. See
Trust model.
Field reports. At the end of a session, ask the agent what got in its way, and
have it file each bug or gap as an issue on dkackman/diffusers-workflow with the
field-report label. The label marks a report as coming from real use. A report
from anyone but the maintainer is reviewed before the agent loop
acts on it.
Using it
- Installing dw - the one-line install,
dw setup,dw agent, updating and troubleshooting - MCP Server - the agent's tool surface (Claude Code, Claude Desktop, other MCP hosts)
- dw plugin - the model-family and composition skills
- Server & Web UI - the web UI, the command line, and the HTTP API with its OpenAPI spec
- Workspaces - where your content lives, run directories, several workspaces on one server
- Remote GPU server - the server, UI and MCP from another machine
- Docker - the server in a container on a Linux NVIDIA box
Workflows in depth
- Workflow Guide - JSON structure, variables, steps, data flow, references
- Tasks - image, video and audio utility tasks, ControlNet preprocessors
- Quantization - BitsAndBytes, TorchAO, GGUF, SDNQ
- Inference Acceleration - caches,
torch.compile, attention backends, MPS - Fast on 24GB - tested speed/memory settings per model family
- LoRA, IP-Adapter, Prompt Weighting
Reference
- Architecture - each concept, the module that owns it, and the check that enforces it
- Worker Guide - the persistent GPU worker and troubleshooting
- Security - validators and the trust gate (quick reference)
- Dependencies, Testing, Releasing
- Agent Loop - what the automated implementer/tester labels mean
- Attributions - code from other projects, and the projects whose ideas dw reimplemented





