dw.serve runs the workflow engine as an HTTP server with a web UI: browse
and run workflows, edit them in a form-based editor driven by the live
pipeline signatures, watch jobs stream progress, review and compare outputs,
manage input assets and the models on disk.
python -m dw.serve # http://127.0.0.1:8765
python -m dw.serve --port 8000 --workflow-dir ./workflows --output-dir ./outputs --prompt-dir ./prompts --asset-dir ./assets
# or point it at a workspace, which supplies all four directories
python -m dw.serve --workspace ~/studio
# your own workflows, with a checkout's examples alongside them read-only
python -m dw.serve --workspace ~/studio --examples-dir ~/src/diffusers-workflow/workflows
python -m dw.serve --host 0.0.0.0 --token "some-long-random-string" # reachable off this machine
python -m dw.serve --host 0.0.0.0 --token "..." --mcp # ...and drivable by an agent on another machine
python -m dw.serve --devices cuda:1 # run the worker on the second card
python -m dw.serve --devices cuda:0,cuda:1 # one worker per card, two jobs at once
python -m dw.serve --trust-workflows # only if nothing untrusted can reach POST /api/jobs - see Security modelInstalled as a package, the same server is dw-serve. The other flags are
--output-layout {run,flat} (WORKSPACES.md) and
-l/--log_level; --help gives each flag's default. Which directories a
server uses, and in what order they are resolved, is in
WORKSPACES.md. Running it for other machines is
REMOTE.md; in a container, DOCKER.md.
The server gzips a response when the client sends Accept-Encoding: gzip
and the body is at least 1 KB, except /mcp and what is already compressed
or must stream (event streams, images, video, audio, zips, a 206 range).
The body decodes to the same bytes. The web UI's /assets/* files carry
content hashes and are cached as immutable for a year; index.html is
no-cache, so a reload after an upgrade fetches the new build.
On an installed copy (INSTALL.md), dw setup runs the server as a
per-user service that starts at login:
dw-serve --host 127.0.0.1 --port 8765 --mcp --managed, from the venv of the
dw that ran setup, in the install root as its working directory (so the
workspace is never your home by accident: WORKSPACES.md).
It binds loopback with no token, as a plain dw-serve does. With no
--examples-dir it offers the example catalog the package carries. A re-run
of dw setup rewrites the service and restarts it.
| macOS | Linux | Windows | |
|---|---|---|---|
| Definition | launchd agent ~/Library/LaunchAgents/com.github.dkackman.dw-serve.plist |
systemd user unit ~/.config/systemd/user/dw-serve.service |
scheduled task dw-serve, at logon |
| Restarts | always (KeepAlive) |
always (Restart=always, after 5 s) |
on a non-zero exit, 3 times a minute apart, per login |
| Logs | ~/Library/Logs/diffusers-workflow/dw-serve.log, dw-serve.err.log |
journalctl --user -u dw-serve |
none kept; run dw-serve by hand to see an error |
| Restart | launchctl kickstart -k gui/$(id -u)/com.github.dkackman.dw-serve |
systemctl --user restart dw-serve |
schtasks /End /TN dw-serve, then schtasks /Run /TN dw-serve |
| Stop | launchctl bootout gui/$(id -u)/com.github.dkackman.dw-serve |
systemctl --user stop dw-serve |
schtasks /End /TN dw-serve |
| Start again | launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.github.dkackman.dw-serve.plist |
systemctl --user start dw-serve |
schtasks /Run /TN dw-serve |
On macOS a killed server comes straight back (KeepAlive); bootout is the way
to stop it. It is started again at the next login either way.
Lingering on Linux. A user unit stops at logout unless lingering is on for
your user, which a headless box reached over ssh needs. Setup offers
sudo loginctl enable-linger <you>; dw setup --status says whether the server
stops at logout. sudo loginctl disable-linger $USER turns it off.
dw setup --uninstall removes the service along with the registrations.
The Server → System page shows the installed dw version (GET /api/system/dw)
in its Software panel. On a
server setup's service started (--managed), when PyPI has a newer release
(checked at most every ten minutes; the server's newer decides, a PEP 440
compare, so 0.10.0 is newer than 0.9.0 and 1.0.0rc1 older than 1.0.0;
when it is null no update is offered), an Update dw button asks first, then
(POST /api/system/dw/update) upgrades diffusers-workflow[server,mcp] in the
server's venv with torch pinned to the installed build and the recorded torch
index, moves diffusers to main, runs dw setup --yes --no-open --no-service
to refresh the registrations (best effort: a failed refresh is logged and the
restart still happens, since the new packages are installed), and exits with
code 75 so the service manager
restarts the server. The page reconnects when it is back.
The update is refused (409) while a job is running or queued, while a model
download is active, or while a diffusers update runs. If a job is queued after
the packages are installed, the restart is withheld so the job is not killed,
and the status says to restart dw-serve when it finishes.
Any other server - a checkout, the contrib/systemd unit, a LaunchDaemon,
Docker - has nobody to restart it, so the page shows the one-liner to run
instead (the POST answers 409 with the same command).
Everything the web UI and the MCP server do goes through one HTTP API, and a running server describes it:
| Path | What it is |
|---|---|
/docs |
Swagger UI: every route, its parameters and response, with Try it out |
/redoc |
The same document in ReDoc, for reading |
/openapi.json |
The OpenAPI document itself |
The same document is committed as
ui/src/lib/generated/openapi.json
for client generation or reading without a server. It is generated, not
written: scripts/dump_openapi.py writes it from the server, CI fails when
the committed copy is stale, and its info.version is fixed at "0" so it
is the same on every machine. GitHub shows it as plain JSON; to browse it,
use /docs on a running server. Neither document declares the bearer token;
see Authentication. The sections below cover the
Jobs API, the Introspection API and
Files and models in prose.
For route authors: every POST, PUT, PATCH and DELETE route is
@writes(kind, ...) or @NO_CHANGE(reason) (dw/server/changes.py), which
is what moves the change counters the UI's open pages reload from.
tests/test_changes.py fails on a route with neither, and on a declaring
route with no case.
Each job runs in a persistent GPU worker (WORKER_GUIDE.md): models stay loaded between runs, so re-running a workflow with a new prompt skips the load.
dw.run is a thin client of dw.serve: it queues a job over HTTP, prints
its progress, and reports the run directory the server wrote to - start the
server first.
python -m dw.run workflows/templates/text-to-image.json
python -m dw.run workflows/templates/text-to-image.json prompt="a cat" num_images_per_prompt=4
python -m dw.validate workflows/models/flux-dev.jsondw.run takes WORKFLOW [name=value ...] [--server URL] [--workspace NAME] [--token TOKEN] - --server defaults to DW_MCP_URL, else
http://127.0.0.1:8765; --token to DW_API_TOKEN. Where the output lands,
which workspace's prompts:/asset: references resolve, and the output
layout are all dw.serve flags (--workspace, --output-dir,
--prompt-dir, --asset-dir, --output-layout on the server) - dw.run
only says which server and which of its workspaces to run in.
python -m dw.test runs a small built-in workflow end to end - it downloads
SD 1.5 (a few GB) and generates one image on whichever accelerator was found.
The server reads these from its environment (e.g. .env) and its workers inherit them; changing one needs a restart.
| Variable | Default | Effect |
|---|---|---|
DW_API_TOKEN |
none | The bearer token, when --token is not given (Authentication) |
DW_WORKSPACE, DW_PROMPT_DIR, DW_OUTPUT_LAYOUT |
unset | The workspace, prompt library and output layout when no flag names them (WORKSPACES.md) |
DW_DEVICE |
detected | The device when neither --devices nor the devices setting names one; ahead of the device setting and detection (Choosing the card) |
DIFFUSERS_HELPER_ROOT |
~/.diffusers_helper |
Where settings.json, the job history (jobs.sqlite) and model-use.json live |
DW_PUBLIC_URL |
unset | The origin absolute URLs in responses are built from (REMOTE.md) |
DW_QUANTIZED_CACHE |
off | 1 caches SDNQ on-the-fly-quantized components on disk, so a later cold load skips the quantize. Anything else is off. See QUANTIZATION.md |
DW_QUANTIZED_CACHE_DIR |
<HF_HOME>/dw-quantized |
Where the cache lives; resolved to an absolute path at start and pinned for the workers |
DW_HOST_CLAIMS_DIR |
<tmp>/dw-host-claims-<uid> |
The folder every dw.serve on the machine shares for its running jobs' host-RAM claims, so one server's host-RAM hold counts another's jobs (Dispatch). Servers that should see each other must agree on it |
--devices cuda:1 runs the worker on that card, pinned with
CUDA_VISIBLE_DEVICES (and DW_DEVICE=cuda), so inside the worker it is the
only card visible. A bare cuda, or no flag, pins nothing. The devices
setting in settings.json is the standing form of the flag; the flag wins. A list
(--devices cuda:0,cuda:1) runs one worker per card, each running one job at
a time. Refused at startup: a card named twice, a bare cuda in a list, and
a single card the machine lacks or a list none of whose cards is present -
the message names the cards that are (cuda:0 (NVIDIA GeForce RTX 4090),
...). A list entry the machine lacks is otherwise dropped with a warning
naming it, and the server starts on the rest.
Each job's record carries device, the card it ran on as the server
addresses it ("cuda:1 NVIDIA GeForce RTX 3090"): set when the job starts,
null while queued and for jobs recorded before the field existed. Observed
cost figures are bucketed by it: only runs from cards of the same name as
the one the server runs on now count, so a 3090's runs never inform a
4090's estimate. Rows with no device count only while the server is on the
box's default card.
The sidebar lists every workspace on the server (+ new creates one; names
sharing a prefix fold into one group). The selected workspace opens into
Overview, Workflows, Jobs, Requests, Gallery, Assets, Editor, and the hash names
it (#/ws/studio/gallery), so a link and a reload land where they say; a
pre-workspace bookmark (#/gallery) redirects to the last workspace used.
Below the workspaces, Shared holds what every workspace sees - Prompts,
the common Assets library and the read-only Examples - and Server
holds Activity, Models, Connect and System. The header carries the breadcrumb, a VRAM
meter per card with a status popover (workers, queue), the API-token key
icon, a finish-alert toggle, the theme toggle, and links to these docs and
/docs; the workflow schema is a top-bar icon beside the OpenAPI link
(#/server/schema), not a sidebar row. ? lists the keyboard shortcuts.
The text filters on Jobs, Gallery, Assets, Prompts and Schema share one rule: every word typed must be somewhere in what the page searches, in any order, case aside. The Workflows and Examples search matches whole words and ranks them instead.
-
Overview - the workspace at a glance: its note, recent outputs, the running and last finished jobs, its workflows (ones with a proof image first, and a New workflow button), its asset count and disk usage. Each panel loads and fails on its own, so a slow gallery does not hold the jobs list back and an error shows in place of that panel. Manage deletes the workspace (disabled for
default). Until Got it is pressed in this browser, a first-run card at the top says what dw is and linkstemplates/text-to-image(the Examples page, or the Workflows page, when the listing lacks it) and points at Make a better one on the finished job's page; storage that throws keeps the dismissal for the session (ui/src/lib/firstRun.ts). -
Workflows - every workflow on the workspace's own
--workflow-dir, as cards with the last image it made, its summary, the server's observed run time, andconfigures/ read-only marks. Shape buttons and trait chips filter by what a workflow makes (theshape/traitsvocabulary ofGET /api/workflows); folders become collapsible groups. Shared → Examples is the same page over the--examples-dirtrees. A card opens the workflow's page: its recent outputs, a run form generated from its variables (withasset:/prompt:/output:pickers; each rule the workflow declares invariable_constraints- its range, grid, minimum length - and the author's reason show under the field they govern, a list-entry rule under its list; the editor shows the same lines, read-only; a preset selector is a dropdown of its bundles, with a line naming the variables they set, and the fields a bundle sets show the chosen bundle's values as placeholders - only the selector is sent, so the server applies the bundle itself; in the editor the selector stays a text field with that line and its bundle names; a workflow that declarestierand composes onepreference:key lists under thetierdropdown what each tier runs on this host, fromGET /api/preferences?key=<k>&resolve=true- the target, the targets skipped greyed with their reason, or the refusal a tier would give - with the chosen tier marked and no per-tier figure, the run check's being the chosen one's; the run check lists eachplan.preferencesline;ui/src/lib/preferences.ts), the raw JSON on request, Edit, Duplicate, Run and delete. Under the title, the card's curated figure says whose it is and the settings it holds for - "a maintainer's figure: ~3 min · 22 GB VRAM, measured on RTX 4090 at num_frames=121" (the card'scost_drivers, a list as its entry count, an object as{…},nullasunset) - then this server's observed time; a workflow with nocostshows no curated line. The catalog card's tooltip carries the same "a maintainer's figure, measured on … at …" line. The page checks a run as you edit: on load and 600 ms after the last change it postsPOST /api/validate?sizes=falseby name with exactly the arguments Run would send (blank fields dropped), and once more with sizes after 3 s idle; an answer to anything but the latest values is dropped. A box beside Run shows the plan (describePlan, as the editor's), a verdict, and the findings: one whose path isarguments.<name>orvariables.<name>for a field the form shows prints under that field, every other error and warning in the general list, all as plain text. The check informs only - Run is never disabled by it, and a Run the server refuses still says why in a toast. Opening an example in the editor saves a copy into the current workspace. -
Editor - build or modify a workflow without writing JSON by hand. Forms come from the live pipeline signatures (Introspection API), and references (
variable:,previous_result:,asset:,prompt:,output:,builtin:) autocomplete or open a picker. Four views: form, split (form beside JSON, both editable, applied when a side loses focus), json (Monaco with the workflow schema), and flow, a read-only data-flow graph - a box per step, an arrow perprevious_resultlabelled with the argument it feeds, entry steps marked, and fan-in steps flagged with their cartesian-product multiplier where it is known statically; a chained step draws its segments inside its box, one chip per segment with what each seam carries. A variable declaredrequired: trueis marked required in the form. Clicking a step in the flow jumps to it in the form. Validate, save and run from the same screen; whenever the answer carries a plan it is shown under the verdict - under the error list too when the answer is invalid, as one naming a repo that isn't there is. The plan reads: step and list counts; the estimate with its basis, the card it is priced for when that says more than the backend (on <card>, or- for <card>closing an inherited or no-figure line), whether it is low confidence, blended toward the curated figure, inherited from a template, or withheld (with the template it was not priced from) or unpriced for a stated reason; the host RAM the run is projected to hold (host RAM ~N GB (observed | fit to N runs | declared | inherited from the template)); how many steps the step cache would serve; and the weights to download first, a gated repo this box's token can't reach or one that isn't found named as such (POST /api/validate'splan, rendered byui/src/lib/plan.ts). -
Jobs - the workspace's queue and run history (history persists in
~/.diffusers_helper/jobs.sqlite), filterable by status. The list holds every live job and the newest 50 finished ones; Show older loads the next 50. The status filter and the search see only what is loaded, and say so ("Searching the newest N of M jobs.") with a Search all button that loads the rest (ui/src/lib/jobsListing.ts). A job queued or running when the server stopped is listed ascancelledwitherrorstartingserver restart:(After a restart). A row's proof comes from the current workspace's gallery, so in the all-workspaces view another workspace's row has no proof slot. A failed or cancelled row shows itsreasonon a muted line under the workflow name, cut to one line with the full text on hover. A restart that cancelled jobs still to rerun gets a banner per batch (restart_batch), newest first, saying "N jobs were cancelled by a server restart" with a Rerun… button (hidden under a status filter that hides cancelled rows). N is the server's count (GET /api/jobs/{id}/restart-batch), so a batch partly beyond the loaded rows is counted whole, and one wholly beyond them is found among the newest 50 cancelled jobs. The size is asked once per batch, and again when the listing shows a new rerun or after the banner's own rerun; if it cannot be read, the banner counts the loaded tombstones no loaded row'srerun_ofnames. Only the click calls the rerun route - the poll never does: its preview lists what would be queued with each estimate and a total, and what is skipped with why; confirming resends withacknowledged_cost: true, cancelling queues nothing, and a preview with nothing left to rerun says so and hides that banner for the session (ui/src/lib/restartBatches.ts). Waiting jobs lead the list in queue order, the next to run on top; the rest follow newest first. A waiting job shows its place in line, can be moved (the place is in the whole queue, so a list narrowed to a workspace or a request asks the server how many jobs are queued rather than counting its own rows), and showswaiting_forwhile held (for host RAM, or because every card is busy): the jobs list adds a short reason (· host RAM/· cards busy) to the queued row with the full text on hover, and the job page's hover matches the hold. The job page also refetches onqueue_waitand on a livewarning, and shows a warn-tone stall line (no event for 4m in loading) from the latestphase_stalluntil another event arrives. A job's page streams step progress, denoise ticks, the phase between them (loading, decoding, saving; a model download shows its bytes and rate), its log, and its results as they land - finals first, intermediates folded, and a section perresult.subfolderwhen a step chose one. Cancel, Run again, New seed, Run again with changes… (a form over every declared variable with this run's values as placeholders; only the fields that differ are sent as the rerun'sarguments), one button per other value of eachpresetsselector the run declares (read from the workflow file as it is now; an inline workflow has none), Make a better one on a succeededtemplates/text-to-imagejob (openstemplates/preferred/text-to-imagefilled in with the job's prompt and seed, and no size or tier, so the tier's size and the server's default tier apply; nothing is queued until Run, so the run check shows any download first;ui/src/lib/job/betterOne.ts), and Export (gathers the run into the workspace'sexports/withPOST /api/jobs/{id}/exportand downloads the zip - the same bundle as MCP'sexport_job; replacing an existing export asks first). An.otiozamong the results is drawn as a timeline strip (clips sized by duration, gaps hatched, a copy button for each clip'soutput:reference).A chained step (one whose shots carry
planned_segments) gets a Segments table below Results, one row per segment its take holds, read off the step's manifest entry and headed "k of N planned" (astop_aftertake shows fewer rows than planned). Each row has a thumbnail (the segment's own clip underkeep_segments, else the take seeked to the segment's start frame, loaded only as it scrolls into view), its frame range, its attempts against the budget (2 of 3, 1 + the chain'sretriesas the run's definition resolved it) with the kept seed when a re-roll was kept, and one cell per recorded measure - the value against its ceiling (0.41 ≤ 0.6;≥for a floor likeaudio_dbfs) marked pass, warn (a warn-only measure that failed) or fail, taken from the record'sfailed, never recomputed. A measure the UI does not know shows under its own name. A segment 1 the check had nothing to compare says "nothing measured"; a resumed segment, a(repaired)one, and a checked chain recorded before measures were kept say "not recorded"; a chain run withcheckoff has no measure cells (ui/src/lib/job/ChainSegments.svelte, its rows fromui/src/lib/chainRows.ts).Each row ends with Repair this segment. It is live only when the chain step loads a model that a pipeline step of
templates/minimax/repair-segmentloads (today H3; the rule is read off both definitions, not a family name), on rows 2..N whose segment file the run kept, in a take with no(repaired)segment. Pressing it opens that template's workflow page withchain_takeset to the take'soutput:reference andsegmentto the row's number; nothing runs until Run. A disabled button says why, in one sentence: no repair-segment template for this model family, segment 1 cannot be repaired (re-render with a new seed), a repaired take has no segment files, or the run did not keep its segments. A take that stopped short of its plan, kept every segment's file, and whose chain'sstop_afterandresume_fromare both declared variables offers Continue the chain above the table. Its confirm quotes an estimate:POST /api/validatewith the job's workflow and the rerun's merged arguments, read as the plan's figure line (one that cannot be priced says so). Confirmed, it reruns the job withresume_fromset to the last segment'soutput:reference andstop_aftercleared, and opens the new job. What each action offers and sends isui/src/lib/chainActions.ts.Every job page, live or from history, ends with an Event log section, collapsed until clicked; nothing is fetched before then. Opening it reads
GET /api/jobs/{id}/event-login pages of 500, followingtruncated, and stops at 5,000 events ("showing the first 5,000; more on the server"). Each row is the event's seq, its time since the job started, its kind (a warning's ownkindbeside it, e.g.warning · phase_stall), and its message or the rest of its payload as compact JSON; a kind select filters the rows to one kind. The route'snote- what a finished job's history dropped, or that it kept no log - shows above the rows, and an unknown or pruned job says "no event log for this job". While the job is live a Refresh button fetches the events after the last one shown. The section keeps its own rows: the Progress list, the flow view and its chips still read the live stream alone (ui/src/lib/job/EventLog.svelte). -
Requests - the workspace's requests ledger (WORKSPACES.md): what was asked of an agent, as the plan it wrote. The list is one row a request - up to three thumbnails of its latest results, the title, one line that is the sentence the request's page leads its needs with ("Needs you: 1 waiting for your OK, 2 ready to run.") or, with nothing for you, the first of running, queued, n planned, nothing running, all done, still open and nothing planned yet (a server older than the
needsthe list asks for gives the status line, failed first), a bar of its items with done of those in the plan, minutes spent (measured, so no~) and left (estimated), the notes waiting for the agent, and when it was last written. Requests with items waiting for your OK come first, then those with something else for you to do, then those with a job in flight; closed ones are hidden until the filter is set to all (?show=all).A request's page leads with where it stands in a sentence ("Rendering Shot 3. 4 of 9 done."), then what needs you (items ready to run, failed, with two good takes and none accepted, or whose accepted take's files are gone), a bar with one segment an item - each goes to its row - and the minutes. Each item is a row: its result as a picture linked to the job that made it (a dashed slot until there is one), its title, its state as a word, and one figure. ready is a planned item a job could be queued for now and waiting one whose dependency is not done, named with its own state; cancelled is a failure whose every attempt was cancelled. Opening a row shows its takes oldest to newest, with the accepted one or the latest standing as the result marked, what it follows and what needs it, the workflow and arguments it would run, and its note. Dropped items fold into a group under the plan. What you asked, the goal and the plan's changes - newest first, your own writes folded into one line - sit beside the plan on a wide window and fold under it on a narrow one.
You edit the plan from its rows. Under each good take, Accept makes it the item's result and, once that is saved, stars the take's file (Accepted pressed again clears the choice; its Undo takes back the acceptance only, the star stays). The grip at the start of a row reorders it - drag it, or focus it and press ArrowUp/ArrowDown, Home or End; the order is written once, shortly after the last move. A row's more actions menu has the same four moves, a note, the item's jobs and outputs, and Drop from plan; a dropped row has Restore. Accept and drop show at once and can be undone from the toast for eight seconds. A drop asks first only when it does more than the row shows: other items wait on it (the drop takes that dependency away from them), nothing was run for it (the ledger deletes it outright, and the page can restore it only until you leave), or its job is queued or running (the drop does not cancel it).
Closing is yours. An agent cannot close a request; it proposes the close, and the page shows a banner under the header: "The agent proposes to mark this done: " ("abandon this" for an abandon), with Close and Keep open. Close writes the proposed state as the request's menu does (with the same Undo), which settles the proposal as accepted. Keep open opens one optional line (up to 200 characters, Esc cancels) for the agent, then declines the proposal with it; the page then says "You kept this open: " until the agent proposes again. A request with a proposal waiting carries a close proposed tag on its row in the Requests list and on the Overview.
Notes for the agent go on the request or on an item (each up to 4000 characters; Ctrl+Enter saves, Esc sets the draft aside, and an unsaved draft survives a reload of the tab). An item holds a list of them, so a second note does not replace the first, and each is edited or removed on its own. A note can carry references to what it is about: a chip per reference ("take 2 · shot3.mp4", or the item's title for a planned shot) that links to the job or file. Write one where you are looking: on the request page (the attempt strip has Note this take, and the request's own box has an item picker, so one note can cover several shots, before or after a render), on a job page (a panel by the
request › itemlink, and Note this file on each output) or on a gallery file (when a job linked to a request item published it; with several, it asks which take). Job page and gallery are for jobs linked to a request item only. A reference that has gone stale (item dropped, run purged) is greyed out. The line under each saved note says only what the ledger shows - that the agent has, or has not, written since - and when the agent writes after a waiting note, a toast says so, once per note per page load. The save button asks the server whether a session is listening (the notes channel). It reads Send to agent when one is, and the line under a waiting note says it will see the note within about 10 seconds; it reads Save note when none is, and the line says the agent reads it the next time it updates the plan. Saving works either way. "Listening" only means a session has the channel set up: one started without the development-channels flag still counts, and Claude Code drops its events (MCP.md).When the agent holds items for your review, a banner says how many are held, counts down to the deadline, and says whether an agent session is listening (the notes channel); with none, it says nothing will run at the deadline. A note you leave on the request redirects every hold, and one on an item redirects only that item's; the note box warns before you save how many held items it stops from starting on their own. The banner then says so, and whether the agent is connected to read the note. Run now… is offered in every state but due with the agent connected; it opens the priced dialog below, and the page never starts a held item itself.
The page queues jobs only when you ask, and only after pricing them. Run {n}… in the header (Run what can run now) takes every ready item, ticked, and offers each failed item that can run again (its dependencies done, a stored workflow) unticked under Failed before. Tick one to run it again.; the button shows whenever the dialog would offer anything, so a request with only failed items has it, and {n} counts every item offered, ticked or not; a ready row has Run…, a failed or cancelled one whose dependencies are done Run again…, and a done row's menu Run another take…. Each opens a dialog that validates every item first (the spend button stays disabled until each has its quote) and shows, per item, its workflow, the quote with what it rests on (No time estimate for this workflow. when there is no figure, the engine's reason behind Why there's no estimate), what the step cache would serve and what must be downloaded, a gated or missing model in the workflow page's words (the row stays tickable), the plan's own estimate when the quote is more than a quarter off it, and a warning when every step is cached - such a run reproduces the last take rather than making a new one. Will not run lists the other items with the reason each is left out (waits on another, no stored workflow, already queued, or the workflow page's refusal and Ask the agent to fix the item's workflow or arguments., the engine's messages behind Engine detail), and Afterwards says which items become ready once these finish - the page never starts them for you. On Run {n} job(s) each ticked item is submitted in plan order, linked to its item with its stored arguments as the ledger holds them and the quoted plan as its cost acknowledgement; a row reads queued only once the server has queued it, a price that moved since the quote is re-priced on its row with Run at this price, and a refusal (the request was closed, the item dropped) is said on its row.
The header's more actions menu marks the request done, abandons or reopens it - nothing can be run on a closed request - and deletes a closed one from the ledger after a confirm (its jobs and outputs stay). A closed request shows its plan read-only: no grips, Accept, row actions or note boxes, saved notes still readable, and a line above the plan with a Reopen button that writes the same state change as the menu's.
The agent may rewrite the plan while you edit it. The page never sends back a plan it read earlier: it reads the request again and makes your change over that. When the item you changed is as you saw it, the change goes on top and a line above the plan says so, naming the agent's write (See changes goes to it). When you were dropping an item or accepting a take and the agent has changed that item, nothing is written and the row asks - Drop anyway or Keep it. When the change no longer applies (the item is gone), the page says so and keeps a note's words for you to copy. The page refreshes itself while the request is open, announces what changed to a screen reader, and keeps the plan it has, with its age and a Retry, when a refresh fails.
The list pages (Requests, Gallery, Assets, Prompts, Workflows, the overview and Compare) show a write they did not make - an agent over MCP,
dw.run, a job finishing - within about five seconds, from the workspace's change feed (GET /api/workspaces/{name}/changes, below). That reload is quiet: no spinner, the rows stay where they are, picks and an open selection are kept, a note you are typing is never replaced, and a reload that fails keeps what is on screen. The Jobs page polls on its own every 3 s while the tab is visible. -
Gallery - everything in the workspace's output directory (
<workflow>/<run id>/, see WORKSPACES.md), grouped by workflow, with a text filter and Final / Intermediate / Starred chips (it opens on finals). A file's detail panel shows its settings, the job that made it, what it was made from, its run and file notes, a star (S), Keep as asset (promotes it into the asset library under a stable name, so a later workflow carriesasset:<name>rather than a run id that pruning would break), and open as workflow, which loads anembed_metadataimage's embedded definition into the editor with its seed pinned. Each tile has a checkbox (shift-click extends a range, Select all takes what the filter shows); a selection downloads as one zip, is deleted in bulk (anything that fails to delete stays selected), or, for two to four files, opens in Compare.The panel's Findings list the level findings the metadata reply carries (warn first, each with the server's words and, for a timed one, its place as m:ss.s). On a video or audio file, Assess runs every assessment probe through
GET /api/gallery/{name}/assess- read-only, nothing queued or stored - and replaces the list with its reply, under a muted line naming the rules applied and each probe that did not apply, in the server's reason. The result is held for the page's life, by workspace and file; a refusal shows beneath the list it leaves in place. On a still the button is disabled and its title says why. -
Compare - two to four outputs side by side, with the arguments that differ between their runs called out, each run's time, and every video on one transport so a difference in motion is seen at the same frame.
-
Assets - the input side of the gallery: the asset library as folder groups of a contact-sheet grid with a detail panel, notes, upload (button or drop; the library it lands in is named) and delete. A workspace's page shows its own library and only the shared and examples assets its workflows use (
used_by); Shared → Assets shows the wholecommonlibrary. Entries a nearer library shadows are listed by name under their library; read-only tiles have no checkbox. -
Prompts (Shared) - the prompt library (resolved as in WORKSPACES.md and pinned for every job, so the page and
prompt:resolution agree), plus the read-onlyprompts/beside each--examples-dir: cards with descriptions, intended-model badges and tags, foldered like workflows. Each opens in an editor with form, split and JSON views and an Enhance with AI panel that expands an idea into a full prompt with a local language model (a preset per target model family, run as an ordinary queued job). Deleting a prompt warns which workflows reference it. -
Models (Server) - the Hugging Face hub cache: each cached repo with sizes, revisions and two dates, plus free disk.
last_job_useis when a dw job that named the repo last started (epoch seconds, kept inmodel-use.jsonbeside the settings,nullif none has since tracking began);last_accessedis the files' atime, the labelled fallback whenlast_job_useisnull- a copy or backup bumps it and a noatime or relatime disk may never move it. Deleting a repo forgets itslast_job_use. Download a repo by id with live progress (cancellable; partial files resume on retry), and delete one to free disk (refused while a job is running or queued). -
Preferences (Server › Models › Preferences,
#/server/models/preferences; Models is a two-tab page, Preferences first, then Downloaded, the hub cache above) - thepreference:ladders, each answering what runs on this machine. One card per key shows its tiers (draft,standard,best): the model each tier picks with ready, or "downloads N GB before its first job" (a link to Downloaded; there is no download button here), or "Nothing fits this machine" with the reason. Models passed over are struck through with a plain reason, and the ones after the pick read "fallback, not checked here". It comes fromGET /api/preferences?resolve=true&full=true, which also carries each key'sused_byworkflows andcontract. Ashippedorchanged on this serverbadge says where the ladder comes from. Requests that don't name a tier run at is a selector that writesPUT /api/preferences. Edit opens one key (one edit open at a time) as a chain editor: each model a chip, in the order tried; drag a chip, press Alt+Left or Alt+Right on it, use its arrows, or remove it with the x; + add picks from the catalog, optionally Only on these devices. After 300 ms the unsaved ladder is dry-run (POST /api/preferences/{key}/check, below) and each chip shows its state. The footer reads "Unsaved changes - Jobs already queued keep the model they were given" with Discard and Save (PUT /api/preferences/{key}with the key's etag asIf-Match; a tier emptied reads "No models: requests at this tier are refused" and cannot be saved). Reset to shipped (DELETE) appears only on a server key. New preference checks the name as the server would (a letter or_, then letters, numbers,_and-) before adding an unsaved card. A 422 shows the server's refusal beside the key; a 412 (someone else wrote the key, or the default tier, since the page read it) offers Reload, which drops the edit for the server's copy, or Overwrite, which writes it again over that copy. -
Schema (Server) - the workflow JSON schema the server validates against, as a browsable tree: the root and every definition, with types, required markers, defaults, enums and descriptions.
$reflabels jump to their definition; a filter narrows the list. -
Activity (Server,
#/server/activity) - what the server is doing now: health (workers per card with its pid, per-card memory where the backend reports it), the downloads in progress, a line while an update is in flight, then the queue and history across every workspace, with a workspace filter. A request filter there (req=) is read in one workspace - the one picked, else the current one, which the picker then shows - because a request id names a request inside a workspace; picking every workspace drops the filter. On either jobs list a filter the server refuses (areqthat is not a request id) shows the server's message over no rows. -
Connect (Server,
#/server/connect) - how to reach this server: bind address and LAN addresses, whether a token is required, whether/mcpis mounted, and the Connect from another machine panel with the browser URL and theclaude mcp addline (its token header only when a token is required) for a chosen address (on a loopback bind: built from the page's own address when it was reached through a reverse proxy or a tunnel, with no rebind advice, only to keep the bind it has; read on the box itself - which a plainssh -Ltolocalhostalso looks like - the command that restarts it bound to the network, with a token, in their place, andssh -Lnamed as the safer way). -
System (Server,
#/server/system) - the Runtime panel (Python, torch, CUDA, driver and package versions, with a copy button), the resolved directories, Software (the dw and diffusers updates) and the Caches panel (below). Software shows the installed diffusers version (with its commit for a git install) and Update from GitHub installs HEAD - new pipelines usually land there before a PyPI release. Refused while a job is running or queued; on success the idle worker restarts so the next job imports the new version. Pinning a commit or reverting is the API's (POST /api/system/diffusers/update, below). Without git (an installed copy) it installs the GitHub archive ofmain's commit. Beside it, the dw version, with Update dw on an installed copy (Update dw).
The old #/server/status, #/server/preferences, #/jobs, #/server and
#/models links redirect to these pages, keeping their query.
The System page's Caches panel lists dw's disk caches (GET /api/caches:
size, files, last used, the volume's free space; the quantized cache expands
into a table of its entries, each with a delete button) with a Clear button
per cache that asks first, quoting what clearing costs, and shows the
server's refusal while a job is running or queued:
One server can hold several workspaces, each with its own workflows/,
assets/ and outputs/, sharing the root's prompt library; the root's own
folders are the workspace named default. Every scoped route takes an
optional ?workspace=<name> (omitted means default), POST /api/jobs also
accepts "workspace" in the body, and a job keeps the directories it was
submitted with through the run, a rerun, and when history serves its files.
GET /api/jobs spans every workspace unless one is named. A workspace is a
namespace, not a security boundary: the API token is all-or-nothing. The
layout, the reserved names and how each client picks one are in
WORKSPACES.md.
| Route | What it does |
|---|---|
POST /api/jobs |
Queue a run: {"workflow_path": ...} or an inline {"workflow": {...}, "base_dir": ...}, plus arguments for variable overrides. workflow_path accepts a stored workflow name as listed by /api/workflows (with or without .json, nested names included), or a relative/absolute path that still resolves under --workflow-dir - confined the same way the /api/workflows CRUD routes are; a path that names a real file outside that directory is rejected with 400, not opened. Answers with argument warnings from signature checking. Takes an optional acknowledged_cost: true is recorded as acknowledged: boolean; the object {fingerprint, minutes, downloads} from a validate answer's plan is bound - the server re-plans the run for the arguments given and answers 409 when the fingerprint differs or a repo in downloads_required (pipeline model_names and the repos task steps fetch) is not in downloads (a download that has since vanished is not a refusal); the body is {"detail": {message, reason: "fingerprint" | "downloads" | "unplannable", acknowledged, plan, acknowledge}} with the current plan, so the caller re-quotes from it, and acknowledge - the {fingerprint, minutes, downloads} to resend - whenever there is a plan. A null in downloads (a URL with no repo) is ignored. The validate plan sent unedited is bound too: when downloads is absent, its downloads_required repos (and estimate.minutes) are what was acknowledged; an explicit downloads, even [], wins. minutes is recorded, never compared. Nothing is required: the web UI and every caller that sends nothing are acknowledged: none, and every job answer and history row carries acknowledged (and acknowledged_cost when bound). POST /api/jobs/{id}/rerun takes the same field and checks against the stored spec; a fresh seed does not change a fingerprint. Takes optional request and item (both or neither, each matching ^[a-z0-9][a-z0-9-]{0,63}$) linking the job to an item of that workspace's requests ledger; a link the ledger cannot admit is refused 422 with detail: {code, message}, code one of unknown_request (no such request, or no workspace root), request_closed (done or abandoned), unknown_item, item_dropped. The job summary and detail carry request and item when set (absent otherwise). A rerun inherits the link; when it no longer admits, the rerun still queues and keeps the link, with a rerun_ledger_link_<code> warning. |
GET /api/jobs?workspace=&status=&request=&item=&limit=&prompts= |
Queue + history summaries, oldest first, with total beside them. request keeps the jobs linked to that request, and item (with request) those linked to that item. status narrows to one state or a comma-separated set (queued, running, succeeded, failed, cancelled; anything else is a 400); limit keeps the newest N, and total still reports how many matched, so a bounded answer cannot be mistaken for a complete one. Each summary carries device, the card the job ran on ("cuda:1 NVIDIA GeForce RTX 3090"; null while queued and for older jobs), and rerun_of, present on a job started by rerun: the id of the job it reran; absent for a fresh submit. A failed or cancelled job with an error carries reason, the error's first line clipped to 160 characters with a trailing … (the full error stays on the detail); a restart tombstone also carries restart_batch, its dead server's server_instance - the key a restart batch groups by. Both are absent, never null, otherwise. No parameters means every job; the web UI asks for every queued and running job and the newest finished ones with limit. prompts=true adds prompts: job id -> the prompt argument each listed job was submitted with (queued, running and historical alike; read the same way as the gallery's), absent unless asked |
GET /api/jobs/{id} |
Full detail: spec, events, manifest, error. A manifest entry for a step served from the step cache carries reused: true. Every entry carries subfolder - the in-run subfolder the step's result.subfolder chose, '' for none. A for_each step appears in the manifest as its members (shot@wide_open, shot@closeup), because the manifest records what ran; the run's workflow.json keeps the for_each form, because it records what was asked. Carries output_kinds: each manifest file mapped to its media kind (image, video, audio, text, or null), and each file-carrying run event (step_end) carries the same map for its own files. The entry of a pipeline step that ran carries timing (see Step timing). Carries rerun_of - present on a job started by rerun: the id of the job it reran; absent for a fresh submit. Carries host_memory_job_peak_committed_mb, the job's peak committed host memory (anonymous + shared + device-mapped pages, the figure the host-RAM gate projects from), null until a reading lands. |
DELETE /api/jobs/{id}/run |
Delete the run directory a finished job wrote, whole, from the output root the job ran against (no workspace selector applies): {job_id, run_dir, deleted, run_swept}. 404 for an unknown job or one with no run directory, 409 for one still queued or running |
GET /api/jobs/{id}/workflow |
The workflow the job ran: {id, definition, realized, seed_variable}. seed_variable names the variable a new_seed rerun would draw into (null when the workflow has none), read from the workflow as written rather than the realized copy, whose seed is pinned. realized: true is the copy the run itself wrote (workflow.json in its run directory), with arguments, seed, prompts and output:latest pinned; false falls back to the submitted definition, which is what a job from before run tracking has. 404 means neither is readable - the job itself still is. The equivalent MCP tool is get_job_workflow (see MCP.md) |
POST /api/jobs/{id}/export?workspace=&overwrite= |
Gather one finished job into <workspace>/exports/<job id>/: workflow.json, manifest.json, job.json, README.md, assets/, inputs/, outputs/. 201 with the file list, total bytes, anything it could not find, a zip_url, and the three JSON files inline. 404 unknown job, 409 for a job still running or an existing export without overwrite |
GET /exports/{id}.zip?workspace= |
The same tree as one archive, built on request rather than kept as a second copy. Entries are named <job id>/<relative path>. Ungated exactly as /outputs is |
GET /api/jobs/{id}/events |
Server-sent events stream; ?after=N / Last-Event-ID replay missed events, so reconnects are lossless. Every event carries seq and at - seconds since the job started (since it was queued, for the events before that) - so a step's cost is a subtraction: step_start to generating is what a reused pipeline still pays before it runs; generating is emitted when the pipeline call starts, so generating to the first pipeline_step is the prompt and reference encoding plus the first denoise pass (timing.encode_s in the manifest is the encoding alone; see Step timing). A job in memory keeps every event; one served from history (after a restart, or once it is older than the 20 most recent finished jobs) keeps only its last 200 |
GET /api/jobs/{id}/event-log?after=-1&limit=200&kinds= |
The same events as the SSE stream, as one JSON page: {id, status, events, last_seq, truncated, note}. after is exclusive; page by passing back the previous last_seq. limit is capped at 1000. kinds (repeatable) keeps events whose event or kind is one of those named (log, warning, phase_stall, ...). A job restored from history serves the bounded event tail persisted with it; a job that finished before events were retained returns an empty list and a note saying so. The web UI reads it as /api/jobs/{id}/journal, the same route under a name content blockers leave alone (EasyPrivacy blocks /event-log?). |
POST /api/jobs/{id}/cancel |
Cooperative cancel: takes effect at the next step boundary or denoise step. During a model load or a task step, which cannot be interrupted, a cancel_pending event says it waits for that to finish. The wait is bounded: a job still running 30 s after the cancel in a load or task step, or 300 s after it in any other phase (a denoise pass that does not end), has its worker terminated and ends cancelled, with a log event saying so and no manifest; the next job starts a new worker with a cold model cache |
POST /api/jobs/{id}/rerun |
Re-queue a finished job's spec. Body {"new_seed": true} draws a fresh seed into the workflow's seed variable instead of repeating the original arguments; 400 when the workflow pins its seed to a literal or names none. Body {"arguments": {...}} merges variable overrides over the stored arguments before admission (shallow, by name; the one-call promotion of a draft is {"arguments": {"tier": "standard"}}, which keeps the draft's staging at the same seed - best re-stages, so it is a render of its own). A rerun with arguments keeps the original's seed unless new_seed: a seed the template drew at run time (a null seed variable) is read from the original's realized workflow, and when that is gone the job carries a rerun_seed_unknown warning and draws a fresh one. A variable the workflow does not declare is a 400, the seed variable together with new_seed is a 400, and a bound acknowledged_cost is checked against the plan of the merged arguments. The new job's detail carries overrides when any were given. A plain rerun of a seeded workflow is served whole from the step cache — the earlier run's files, republished with reused: true, generating nothing. The new job's summary and detail carry rerun_of: the id of the job it reran (absent on a fresh submit) |
GET /api/jobs/{id}/restart-batch |
A restart batch's size, for the tombstone's server_instance: {server_instance, size, pending} - size is every job that restart cancelled, pending those not yet rerun and not in a deleted workspace. Spans every workspace; queues and estimates nothing. 404 unknown job, 400 not a tombstone |
POST /api/jobs/{id}/move |
Reorder a queued job: {"direction": "up"|"down"|"front"|"back"}. Job listings carry each waiting job's queue_position, and waiting_for while one is held (host RAM, or every card busy). |
Each worker runs one job at a time, so with one device (the default) one job
runs at a time; submissions queue in order, and the waiting part of the
queue can be reordered. With several --devices the dispatcher walks the
queue in order and gives each job the first free card, in --devices order,
that fits it. A job that fits no free card keeps its place while a smaller
one behind it takes the card (backfill).
What a job needs, in order:
- the workflow's declared
vram_estimateprojected over the job's arguments - hard: a job bigger than every card is refused at submit with a 400 naming the largest card; - else the smallest
costentry'svram_gbfor this device type - soft: if no card is that big, the job runs on any card; - else any card.
A card's size is its GiB rounded up (a 3090 counts as 24) when compared to a
cost figure; a declared estimate is held to the card's GiB to one decimal
(a 3090's 23.6), the ceiling admission uses. Cancel reaches only the worker
running that job, and a worker crash fails only its own job.
OOM ranking. With more than one worker, each dispatch sets its
worker's Linux oom_score_adj to 1000 and every other live worker's back to
its spawn-time value (the server's own, e.g. 200 under a systemd user unit;
the kernel refuses an unprivileged write below that), so a host-RAM squeeze
kills the newest job. A refused write is a warning on the job. Under systemd
the unit needs OOMPolicy=continue (scripts/dw-serve.service sets it): the
default stop answers one worker's OOM kill by stopping the whole server.
Host-RAM hold. A queued job may carry a projected host-RAM
peak (host_ram_need; see
Host-memory history). When it fits a
free card, dispatch also checks host RAM: available is MemAvailable less
what each running job's projected peak still has to add beyond its worker's
committed memory now (nothing for a running job with no figure), and the job is
held while its peak exceeds available plus the committed memory of the idle
worker it would reuse. Committed is RssAnon + RssShmem + the pages of the
worker's /dev/nvidia* mappings (the driver's pinned host memory, which Linux
files under RssFile); the rest of RssFile, the checkpoint pages a worker
mmaps, is page cache that MemAvailable already counts as free. Two workers
loading different checkpoints evict and re-read each other's pages - a
slowdown, not an OOM. Every peak is taken with a margin of 10%, at least 2 GB,
since a peak recorded at phase boundaries is a lower bound. Backfill applies.
Another dw.serve on the same machine counts too: each server
publishes its running jobs' peaks to a shared claims directory
(DW_HOST_CLAIMS_DIR, else a per-user folder in the system temp dir) under
a file lock, and each dispatch adds the other live servers' claims to its own
running jobs. The default folder is used only while it is a real directory
the server's user owns that no one else can write: one planted at that
predictable path by another local user is refused, and the gate falls back
to this server's own jobs. A job is claimed once its worker is up, so a
job on a cold card counts as soon as its worker starts. A claim carries the
worker's driver-pinned host memory, so a sibling charges it on the basis
this server's own gate does. A job is never held when no other job is running on this server
or another, nor when it has no figure, nor where host RAM cannot be read
(macOS without psutil). A held job is re-checked every 10 s. The hold emits one queue_wait event (message
waiting for host RAM: needs ~N GB with its margin, ~M GB free; not a warning), and job
detail and summaries carry waiting_for - that message - only while held. waiting_for also appears (queued behind N running job(s) on every card) while every card is busy.
An observed or fitted figure never refuses a submit; it only delays a start,
and the OOM ranking is the backstop for a wrong projection. A workflow's
declared host_ram_gb (a number or a variable: a presets.tier bundle
sets) is a floor under the projection, and the one figure that refuses:
validate and submit fail at host_ram_gb when it, with the margin, exceeds
the host's total RAM - the H3 best tier's 69 GB on a 64 GB machine.
Affinity. Among the free cards a job fits, dispatch prefers a rerun's
original card, else the card whose worker last ran the same workflow (the
same file, or an inline definition's id), whose pipelines and step cache
are warm. A busy preferred card is not waited for. When a worker's workflow
changes, its step cache and any model the next workflow does not load are
freed (WORKER_GUIDE.md). A validation's cache probe and
its plan.estimate ask about the card the job would go to now, named in
priced_for. GET /api/memory and POST /api/memory/clear take an
optional device.
The RSS peak a job records (host_memory_job_peak_rss_mb) is job-scoped: where the job raised the worker's process-lifetime peak, the new peak minus the worker's resident size at the job's first phase boundary, and null where it raised nothing; the committed peak is an absolute reading of the whole worker process, a previous run's leftovers included. Nothing compares the two. The dispatcher reads a running worker's committed memory from /proc/<pid>/status alone (never smaps, which is slow for a large worker) and adds the driver-pinned term from the worker's last memory report.
A server that dies uncleanly (a crash, kill -9, a power cut) leaves its
queued and running jobs open; the next server closes them as cancelled
with an error starting server restart: - its tombstones. To get them
back:
- Find one:
list_jobs(status="cancelled"): a row withrestart_batchis a tombstone, and rows sharing that value are one batch (itsreasonreadsserver restart: …). Any one tombstone names the whole batch. - Preview:
rerun_job(<tombstone>, restart_batch=true)withoutacknowledged_costqueues nothing and answerswould_queue- every tombstone of that restart, oldest first, each with its workspace andestimate- plusskipped. Quote the total to the user. - Queue: the same call with
acknowledged_cost=truequeues the members increated_atorder, each in its own workspace and each withrerun_of. A member already rerun is skipped asalready rerun as <id>, so a repeat queues nothing twice; one in a deleted workspace, or refused by admission, is skipped with its reason and the rest still queue.
new_seed and arguments are refused with restart_batch (one override
cannot fit every member), and so is a bound acknowledgement. A job that is
not a tombstone, or one closed before tombstones recorded their server, is
refused (400) as not a restart tombstone. A member that was running redoes
its finished steps: the step cache does not survive a restart. The REST form
is POST /api/jobs/{id}/rerun-restart-batch, and
GET /api/jobs/{id}/restart-batch counts a batch without queuing or
estimating anything. While a dw update is running the server takes no jobs,
and the batch says so before admitting any member: the acknowledged call
answers 409 with the refusal as its detail, as a single rerun does, and the
preview answers 200 with would_queue: [] and refusal naming it. A preview
carries refusal: null when the batch would be admitted.
Each server holds a lock under servers/ beside jobs.sqlite for its
lifetime, so a second server sharing the database never closes a live
sibling's jobs as tombstones.
A pipeline step's manifest entry carries timing, where its time went; the
fields are in WORKSPACES.md, which MCP serves as
get_guide("workspaces", section="Step timing"). A step that set a cache also
carries timing.cache, its skip counts (see the cache_stats event below).
Every event in the stream carries a seq and an event name:
| event | when | payload |
|---|---|---|
job_status |
queued/running/terminal transitions | status |
log |
worker output lines; each top-level block of a ModularPipeline as it starts (MiniMaxAI/MiniMax-H3: vae_encoder) - the lead-in before the denoise loop is where a reference encode's minutes go, and the block name is what says which one it is in; and each file the saving phase writes, named as it starts (writing shot.mp4 (121 frames)) and costed as it finishes (wrote shot.mp4 in 1.3s (1.4 MB)), which is the other stretch a step spends with its denoise counter frozen |
message, and for a file file plus seconds on the closing one |
memory |
device memory after a run | info |
run_start |
the run directory is chosen, before the first step | run_id, identity, run_dir |
workflow_start |
the run begins | workflow, total_steps, steps, seed |
step_start / step_end |
each step | step, index, total_steps; files, subfolder and, for a pipeline step that ran, timing at the end. A step served from the step cache adds reused: true to step_end, and its files are the earlier run's files rather than newly written ones |
iteration_start |
each argument combination in a step | step, iteration, total_iterations |
pipeline_step |
each denoise step | step, total_steps. Emitted for a pipeline that takes a callback_on_step_end, and for a ModularPipeline (H3, LTX-2, Qwen-Image), which takes none - there the denoise block's own progress bar is what reports |
phase |
the step changes what it is doing | phase, detail |
pipeline_released |
a step with release_pipeline drops its pipeline |
step, index, gpu_memory_allocated_mb and gpu_memory_allocated_before_mb (both null where the backend cannot say). Emitted between the step's generation and its files being written, which is where the release happens - so the ordering is readable off the event stream rather than by trying to poll memory through a sub-second write |
warning |
a step finds something wrong with what it is about to write | message, plus a kind and the figures behind it (level_spread: spread_db, measure, command; fps_mismatch: declared_fps, source_fps; audio_no_headroom: file, peak_dbfs - a deliverable at or above -0.5 dBFS, which an mp3 or AAC encode decodes over full scale; step_elided: step, overridden_by when a supplied argument is what made it unreferenced; cache_stats_unavailable: cache_type - the installed diffusers moved the private hook state dw reads, so the step's cache counts are null; the run is unaffected). Also appended to the job's warnings, prefixed with the step it fired in - the event keeps the moment, warnings keeps it where a caller polling the finished job will look, since a warning about the artifact outlives the run that noticed it |
cache_stats |
a pipeline call that set a cache finishes its denoise, once per call |
step, segment (only on a chain segment, e.g. segment 1/3), and the fields of timing.cache: type, threshold, forwards, computed, skipped, hit_rate. Counts are null for a cache diffusers keeps no per-forward decision for. For watching live (get_job_events(kinds=["cache_stats"])); the manifest entry's timing.cache is the record |
workflow_end |
the run finishes | manifest |
queue_wait |
a queued job is held for host RAM (below) | reason: "host_ram" or "gpu_busy", message |
cancel_pending |
a cancel arrives during a phase that cannot be interrupted | phase |
A warning with kind: "phase_stall" is emitted when a phase has gone 30 s
without an event, and every 30 s while it stays silent (phase,
seconds_since_phase_start, seconds_since_last_progress). It is
informational - long silent stretches are normal for some models - and,
unlike other warnings, never lands in the job's warnings.
A step spends most of its wall clock outside the denoise loop, and
pipeline_step cannot see any of it. phase is what fills that silence:
loading (with the model or component in detail), cached (the same
pipeline as a previous run - milliseconds, not minutes), generating
(the denoise loop, or a chain's segment N/M - which is why the counter
restarts), decoding (latents, after the last denoise step), saving
(writing files, including video encode - it names each file on the log
stream rather than running silent, since the denoise counter is frozen at its
last step throughout) and task (a task step, named in
detail). Emits are a handful per step, not per denoise tick.
GET /api/jobs/{id} carries a progress block while a job is running
(null before it starts and once it is terminal, where the manifest is the
better answer). It is the same information the event log holds, kept as the
events arrive so a caller does not have to page back through a trimmed log
to learn where a long render is:
| field | |
|---|---|
step, step_index, total_steps |
the workflow step being run |
phase, phase_detail |
the latest phase and what it named |
seconds_in_phase |
how long it has been in it |
seconds_since_event |
how long since anything at all happened - the number that separates a slow run from a stuck one |
denoise_step, denoise_total_steps |
the denoise loop's counter, null until it starts |
A null denoise_step under generating is the pipeline's lead-in: prompt
and reference encoding plus the first denoise pass, which runs well over a
minute on a large video model. On MiniMax H3 the first pass dominates and
varies by card (measured on one box: 86 s on one card, 422 s on another, for
the same image + video job); the reference encode (vae_encoder) is about
6 s for an image and 50-53 s for a 5 s 960x544 video. Each top-level block of
a SequentialPipelineBlocks modular pipeline emits a log as it starts
(before_encode, text_encoder, vae_encoder, denoise, decode on H3),
so the last event says which block the run is in; a conditional container
is not narrated, since it runs one branch. seconds_since_event is a stall
signal once denoise_step is a number, or in any phase other than
generating.
Even then it is coarse. With a transformer block cache
("cache": {"type": "first_block"}) most steps are served in seconds and
every few one is computed in full, so a healthy run can emit four
pipeline_step events in 20 s and then nothing for 133 s. Liveness is
denoise_step having moved between polls minutes apart, not silence against
a fixed threshold; on H3 that threshold would have to exceed ~140 s.
The editor's forms come from these; they are just as usable from scripts:
-
GET /api/pipelines,GET /api/pipelines/{name}— diffusers pipeline classes and their call signatures -
GET /api/classes?kind=pipelines|models|schedulers|quantization,GET /api/classes/{name}?target=call|init|load(defaultinit) — any allowed class (diffusers + registered extension modules), described for calling, constructing, orfrom_pretrainedloading -
GET /api/tasks— the task commands and processors -
GET /api/tasks/{command}— a task's argument schema, read from its registered implementation's real signature -
GET /api/schema— the workflow JSON schema.?section=answers one part of it -steps,pipelines,tasks,result,variablesorconfiguration- as{section, sections, elsewhere, schema}, whereelsewherenames the section holding each definition the fragment still$refs; the no-argument call is the whole schema, unchanged -
GET /api/guides— the documentation that bears on choosing a capability: each guide's name, what it covers, and its section headings -
GET /api/guides/{name}?section=— one section of a guide; section names match loosely. Without asectionthe answer is the guide's index - its opening, its first section, andsections/withheldnaming the rest - rather than the whole file. Served by the engine, so an MCP client at another version reads the guides for the server it drives. A checkout serves the repo'sdocs/; an install the copybuild_dist.shputs underdw/docs/ -
POST /api/validate— schema validation plus signature-level argument warnings for pipeline and task steps (catches the typo before the model loads);warningsalso names an entry key of a list-driven variable that no step reads, at the entry's path (variables.shots[0]or, when the caller's ownargumentssupplied the list,arguments.shots[0]). Acceptsworkflow_path(same resolution and confinement as/api/jobs, above) as an alternative to inlineworkflow- exactly one of the two, or a 400. Every schema violation is returned inerrors([{path, message}], sorted by path, capped at 25), and joined one per line inerror. It also takes theargumentsa caller is about to run with, and checks them the way the run would: a name the workflow does not declare, a value that will not coerce to the declared type, and anasset:,prompt:oroutput:reference that names nothing this workspace can reach - each reported atarguments.<name>.POST /api/jobsmakes the same check and answers 400 rather than queuing a job that would fail on its first step;checked_argumentson a valid answer names what was covered, since without arguments the verdict is about the stored defaults only. A reference set a pipeline would refuse is an error here too - too many images, videos or audio clips for the family, or, for MiniMax-H3, audio as the only reference - because the pipeline enforces those only once its checkpoint is loaded, minutes into an acknowledged run (dw/reference_limits.py, which reads each limit off the diffusers block that enforces it rather than restating it). A LoRA loaded onto the wrong checkpoint partition is an error for the opposite reason - the pipeline accepts it: MiniMax-H3'sref2vaholdstransformer_refalone, so an FL2VA-trained adapter loads onto it, the run succeeds and only the identity retention is worse (dw/adapter_compatibility.py). Aweight_namecarrying neitherref2vnorfl2vcannot be placed, so it is awarningsentry naming the rule rather than a refusal - a reference-trained checkpoint nobody has named yet still gets through. The LoRA catalog is read first: aprovenentry for thatmodel_nameandweight_namewhoseworkflowsits in one partition decides it, so aref2vastep loading a file the catalog proves fort2va/fl2vais refused, whatever its name says. Atrialorrejectedentry'sworkflowonly warns; promoting the entry toprovenis what makes it refuse. The CLI and the worker have no catalog and keep the file-name rule alone.A valid answer also carries
plan, what the run will execute for those arguments - its fields and rules are under Validate plan below.
A valid POST /api/validate answer carries plan: what the run will execute
for the arguments given, fingerprinted so an acknowledged_cost can be bound
to it (Jobs API). plan is null when it could not be built; an
invalid answer carries no plan key.
| Field | Meaning |
|---|---|
fingerprint |
sha256:… over the work the run does (Fingerprint below). Send it back in acknowledged_cost to bind the run to this plan |
steps |
The expanded member count, after elision |
elided_steps |
[{step, reason, overridden_by?}], in written order: the steps that will not run because nothing after them reads their result and they save no file (the last step always runs). They are already left out of steps, the downloads and the fingerprint. overridden_by names the supplied variable (or item: field) that made the step unread - an elision on purpose; without it nothing ever read the step, so check for a misspelled reference. The run warns step_elided for each (Progress events) |
list_entries |
{variable: length} for each for_each over a list variable |
cached_steps |
How many of steps the step cache of the card the run would go to would serve: 0 for an unseeded workflow (which also gets a warning, since 0 alone does not tell a disabled cache from an empty one), null when that worker is busy or did not answer |
workspace |
The name of the workspace whose step cache was probed, so a cached_steps: 0 against the wrong workspace's outputs can be seen |
downloads_required |
What the run must fetch first (Downloads below); [] when nothing |
estimate |
The run's minutes and what they rest on (Estimate below) |
host_memory |
{projected_mb, basis, runs} (plus inherited_from when basis is inherited), the run's projected host-RAM peak (Host memory below); absent when there is no figure |
Fingerprint. Taken over the realized, expanded definition after elision,
with each prompt: inlined, the seed and every key that cannot change the
output (cost, cost_drivers, vram_estimate, descriptions, a result's role,
subfolder and file name) removed, and output:…/latest/… left unpinned. The
same work hashes the same; a longer list or an edited stored prompt does not.
Downloads. downloads_required lists each model_name the hub cache does
not hold and each repo a task step fetches (dw/tasks/weights.py; a repo
shared with a pipeline step is listed once, a reference or local-path argument
gives none). Acknowledgements compare entries by repo. An entry takes one of
four shapes:
- Repo -
{repo, gb, gated, access_blocked}, a whole repo. - File -
{repo, filename, revision, gb, gated, access_blocked}, a task that fetches one file rather than a whole repo.revisionis a 40-character commit pin ornullformain;gbis that one file's size, from a HEAD of the file;gatedisnull, since that HEAD does not say;access_blockedistruewhen the HEAD is refused by the gate,falsewhen it succeeds. Listed when that file at that revision is not in the hub cache (checked per file, so another cached file of the same repo does not count); a whole-repo entry for the same repo subsumes it. - Components -
{repo, components, revision, gb, gated, access_blocked}, a modular step's ownmodel_namewhen itsload_componentsloads some components from another repo (pretrained_model_name_or_path, which is listed whole).componentsare the subfolders left onmodel_nameby itsmodular_model_index.jsonwith the overrides laid over it,revisionthe oneload_componentsnames for them (nullformain), andgbonly their files not cached. Nothing left to fetch gives no entry; an index that can't be read (offline, uncached) listsmodel_namewhole instead. Its adapter file is then a file entry of its own. - URL -
{repo: null, url, gb: null, gated: null, access_blocked: null}, eachfrom_single_fileURL (a direct file URL is never gated).restore_facesalso lists facexlib's weights this way (detection_Resnet50_Final.pth, andparsing_parsenet.pthunlessuse_parseis false) while they are missing from facexlib's weights directory; they download outside the Hugging Face cache.
The fields, on every shape that has them:
gb- the size from the hub;nullwhen it could not be asked.?sizes=falseskips the hub, and thengatedandaccess_blockedarenulltoo.gated- the hub's own field for the repo (false,"auto"or"manual"), ornullwhen the lookup itself failed for a reason other than the gate.access_blocked-truewhen this box's Hugging Face token has not been granted access to a gated repo,falsewhen the repo isn't gated or the token is accepted,nullwhen it could not be determined - "unknown" is not "not blocked". A gated repo's own metadata is served by the hub regardless of this token's access, somodel_infosucceeding proves nothing about the gate: a gated entry gets a second, real check - a HEAD request against one of the repo's own files - and it is that request'sGatedRepoErrorthat setstrue(the pre-flight signal for what would otherwise be a 403 partway into a run). It isnullwhen there is no file to probe or the probe fails for an unrelated reason (e.g. offline).validate_workflow'swarningscarries one line per entry withaccess_blocked: true.not_found-truewhen the hub answers that the repo does not exist (a misspelledmodel_name, or a private repo this token cannot see); validation then fails with an error atmodel_name. An unanswered lookup leaves the key out.
Estimate. estimate is the run's minutes from this box's own history when
it has one, otherwise from the workflow's cost block. Quote minutes;
basis says what it rests on, and the flags say how far to trust it.
| Field | Meaning |
|---|---|
minutes |
The quote; null when there is no figure |
basis |
Where the figure came from (Bases below) |
device |
The serving backend (cuda, mps, cpu) the figure is asked for |
measured_on |
The hardware name the figure was measured on - the cost entry's name, or this box's card for its own history; null when there is none, or the composed children it sums disagree |
priced_for |
The card the run would be dispatched to, whose history the figure is (Dispatch) |
runs |
How many cold runs an observed or inherited figure is read from (for inherited, the template's); null for a curated figure |
partial |
true when part of the run added nothing to minutes: a composed child with no cost block or history, or the workflow's own steps unpriced while a child is priced. The figure then understates the run |
unpriced |
What contributed nothing: the workflow's own id when its own steps went unpriced, else each composed child's path. With minutes null it still names the composed children that left it unpriced (partial is then false). [] when nothing did |
cached_minutes |
The share of minutes the caller would actually wait for once the cached steps are subtracted: minutes × (steps − cached_steps) / steps. Equal to minutes when nothing is cached, 0.0 when everything is, null when either figure is null |
tempered |
true when a thin observed history was blended toward a curated figure (Thin history below); absent otherwise |
observed_minutes |
With tempered: the raw observed figure before the blend - the same number list_workflows reports as observed_minutes |
curated_minutes |
With tempered: the figure it blended toward |
low_confidence |
true when the figure is an approximation: scaled from another setting, measured at another setting of a driver nothing scales (differs), inherited from a template with differences, or thin history with nothing to blend toward. Validate warns when an inherited figure is, and never refuses; tell the user the figure is rough |
scaled |
What the figure was re-priced along, in words: steps, canvas, frames or a scales_with driver moved off the defaults it was measured at; a checked chain's worst case; for inherited, more pipeline steps or frames than the template's run; for a task-only workflow priced from declared task rates, task rates: and each step's fixed seconds plus seconds per input second over its input's length |
per_segment |
true when an observed figure is a matched chain's, read per segment from this box's history |
differs |
The drivers that moved with no rule to scale by, with low_confidence true; for inherited, what the workflow sets differently from the template ([] when nothing) |
inherited_from |
With inherited, or a withheld figure: the catalog template whose runs priced it |
withheld |
With basis unknown, minutes null and inherited_from set: why that template's runs could not be re-priced for this workflow (its size cannot be compared to the template's). Validate warns cost estimate withheld: …; the run has history, but no honest figure |
unpriced_reason |
With basis unknown: why there is no price - no declared rate: and the commands of a task-only workflow that declare no task rate, when there is no withheld (no pipeline to inherit from, no cost block, no runs of its own), or a step under the experimental experimental_hybrid_windows, whose minutes and every *_minutes are null because nothing measures its time |
Bases. basis is one of:
observed- the cold median of this server's own finished runs of this shape, withrunssaying how many. Preferred over a curated figure, and quoted only for the bucket the caller's arguments fall in. A composed child is not added to it: an observed run already measured the whole run, children included, sopartialisfalse.catalog- the stored total, for a run whose lists are the ones it was measured with.per_entry- re-priced from a measured per-entry rate, when the entry carriesper_entry.derived- an estimate, not a measurement: the stored total extrapolated linearly over a list whose length the caller changed, or scaled in proportion alongnum_inference_steps,widthxheightandnum_frames(per entry in a list, summed) that the caller moved off the variable defaults acostentry is measured at, withscalednaming each moved axis. A non-numeric value of one of those isunknown. A driver acostentry names inscales_withscales the same way: Music 3'saudio_duration, or that field summed overmusic-long's sections. The ceiling is what is quoted, so a track that ends early costs less. A workflow of task steps alone, with no cost block and no runs here, isderivedfrom its commands' declared task rates (register_command(cost=),docs/TASKS.md): each step's fixed seconds plus seconds per second of its input media's probed length, summed and rounded up to 0.1 minute, alwayslow_confidence. A step whose input is an earlier step's output takes the longest length any step's inputs resolved to, and one with no input that resolves is priced at its fixed seconds alone; each such step is named indiffers. One undeclared command leaves the whole workflowunknown.other_device- no entry for the serving backend; the first entry's figure, which is a warning rather than a quote.inherited- an inline workflow has no catalog name, so its price is this server'sobservedruns of the catalog template that loads the same pipeline (component_type+model_name+workflow, as the VRAM ceiling is inherited), named ininherited_from.differslists what the workflow sets differently among offload, quantization, frame count, attention backend, cache, LoRA and reference count; more pipeline steps, frames, inference steps or canvas pixels than the template's run re-price it in proportion, as the catalog figure is scaled, withscalednaming each axis.low_confidenceis true whendifferslists anything or the figure was scaled.unknown- no figure: no cost block, more than one list changed so there is nothing honest to extrapolate along, or awithheld/unpriced_reasoncase above.
How the figure is adjusted.
- Undeclared drivers. Any other declared driver moved off its default -
H3's
weights_dtypeor LoRA - has no rule to scale by: the (scaled) figure is kept under whatever basis it has, withlow_confidencetrue anddiffersnaming the drivers that moved, because it was measured at another setting of them. - History not used. This box's history is passed over for the curated figure when it was another backend's, when every comparable run was warm (the weights already resident, which would under-quote the load), or when a list entry's own cost field moved past what the history covered (a shot lengthened) and the bucket does not say what frames its runs rendered, since history buckets on the list's length.
- A shot lengthened. When it does - the observed block's
entry_frames, the median of its newest cold runs'num_framessummed over the list entries - the history is rescaled to this run's frames instead: cold and warm minutes are eachfixed + (minutes - fixed) x run frames / bucket frames, thefixedshare being thecostentry'sfixed_minutesover itsminutes. The basis isderived,scaledreads "scaled from the observed X min at N frames: num_frames M vs N", andlow_confidenceis set only when the ratio falls outside 0.5-2.0. A thin bucket still tempers, toward the curated figure scaled to the same frames. A block with noentry_frames(older history, entries withoutnum_frames, a matched chain's per-segment figure, or aninheritedone) keeps the discard above. - Drivers this box never ran. A run whose drivers have no history of their
own (a preset tier, other steps, a bigger canvas) is priced from the same
run's history at the default preset, or failing that at the default drivers
too, scaled by how far they moved:
derived,low_confidence, withscaled. - Checked chains. A chain that may re-roll or words-check is quoted at its
worst case: this box's history is re-priced for the re-rolls and Whisper
passes it may pay (
derived,scaledsaying so), and the quote is never below the same chain unchecked plus what checking adds (scaledsays when that floor was taken). - A first pass at a new shape. A
costentry'sfirst_at_shape({minutes, keys}) addsminutesonce for each distinct shape this run has that this card has not run the workflow at yet: a shape is the effective (presets-resolved) values ofkeys, plus each list-driver entry'snum_frames. Seen means a succeeded, full (noresume_fromorstop_after) run of the same workflow - an inline one'sinherited_fromtemplate - on a card of this card's name that finished after thetritoncache's newest clear (its.dw-clearedrecord; none, every run counts).templates/minimax/dialogue-shortdeclares 6.0 min on the 3090 row (#1697's probe). The term is added last, after the checked-chain floor, andscalednames up to three unseen shapes;basis,warm_minutes,cached_minutesandlow_confidenceare not moved, and the fixed share above does not include it. The fingerprint does not cover the minutes, so a shape another job finishes first can drop the term between a 409 and the re-run. - Composed children. A composed child's cost is added to a curated figure,
and
partialis true when a child has none. A parent with no cost of its own takes its priced children's basis; when every child's share was this box's own history, the total isobserved.
Thin history. Below 3 cold runs an observed figure is not quoted at
full authority. It is blended toward the curated figure scaled to the run
(or toward this box's default-drivers history scaled to it, when a preset
tier's or a changed driver's own bucket is the thin one): one run counts for a third of the blend, two for
two thirds, three or more not at all. The blend is marked tempered: true
and keeps basis: observed, with observed_minutes and curated_minutes
beside it so minutes can be reconciled against either. With nothing to
blend toward, minutes is left alone and low_confidence is set instead.
Host memory. host_memory is the run's projected host-RAM peak,
{projected_mb, basis, runs}, plus inherited_from when basis is
inherited. basis is:
observed- the largest committed job peak of this machine's successful runs with the same memory key, or the largest job peak RSS where none measured it.fit- the list-run projection from the workflow's own history, on the same basis.declared- the workflow'shost_ram_gb, when it is larger than either or there is neither;runsis 0.inherited- no run of its own memory key, no fit and no declaration: the largest peak among this machine's successful runs of the catalog templates that load the same single pipeline identity, each at its default arguments;runscounts the runs of the template that gave it, andinherited_fromnames that template.
-
GET /api/workflows— the stored workflow names, plus adetailsentry per workflow:description,kinds(the output content types' top-level halves),steps,variables(a count) andvariable_names, andprompt_refsnaming the stored prompts it leans on, andconfigures- for a workflow undermodels/, thetemplates/name it is a tuned configuration of, empty when it is a template itself or when the name does not resolve (thenconfigures_missingcarries what was written). Four more say what the workflow makes, read off its definition (a top-levelshape,traitsorsummaryin the file overrides):shape, one ofimage,image-set,image-edit,shot,sequence,audio,text,utility;traits, a sorted subset ofhas-audio,chained,image-conditioned,identity-referenced,needs-input-media,composes-workflows;summary, the first sentence of the description, capped at 120 characters; andcost, the maintainer-measured{device, name, vram_gb, minutes}runs, ornullwhen nobody has measured it - a list-driven workflow'scostentry may also carry a measuredper_entry({variable, minutes, entries}), the cost of one entry of the list it was measured against. A card'scost_driversis a map from each driver the workflow declares to its default with any preset bundle applied - the settings the curatedcostwas measured at, which for a preset template can differ from the raw definition'svariables(GET /api/workflows/{name}). The response'scost_basissays what that is -curated: figures a maintainer measured once and wrote into the workflow, never derived from this server's own job history, sonullmeans nobody wrote one down rather than "this box has never run it". Beside it,observedis the derived figure the same listing is allowed to carry: what this box's own finished runs of that workflow took, ascold_minutes/cold_runs(model load included, so comparable to a curatedcost) andwarm_minutes/warm_runs(model already resident), with thedriversthe figure is for,since, andunclassified_runswhen a run's persisted events were trimmed past itsloadingphase. Runs are bucketed by the workflow's declaredcost_drivers, so a 345-frame run never informs a 124-frame figure; a list driver buckets on its length. A workflow declaring no drivers counts only runs that overrode nothing, and a run whose every step was a step-cache hit is excluded. The compact view carries onlyobserved_minutes(cold) andobserved_runs;GET /api/workflows/{name}/variablescarries the whole block. Derived from the job rows, so the figures outlive a pruned run directory, and cached against the jobs table's high-water mark.observednever replacescost. Amodels/entry takes itsshapeandtraitsfrom the template it configures and keeps its owncost. A list-driven workflow (one with afor_eachstep) also carrieslists: per list variable, the fields an entry takes, the steps run over it and the default's length. Variable defaults are left out (an order of magnitude more payload); cached by file mtimeOptional query params narrow and shrink it:
?shape=&traits=&configures=&include_models=&view=compact.shapekeeps entries of that shape andtraits(comma-separated) those carrying all of them - an unknown value in either is a 400 whosedetaillists the vocabulary.configures=<template>keeps that template's model configs.view=compactis the agent's projection: it dropsdescription,origin,writable,prompt_refs,stepsandvariables, keepssummary,shape,traits,cost,kinds,variable_namesandlists(carried only when the workflow has a list-driven step, likeconfigures), and lists templates only unlessinclude_models=trueor aconfiguresasks otherwise.inputs=trueadds to each full-view detailinputs: every variable that feeds a media argument (image,mask_image,video,audio, ...) or sits in alocationobject, and the kind it takes (image,video,audioorfile); without it the key is absent.times=trueadds to each detailmtime(epoch seconds, when its file last changed) andcreated(when it was first written) where the filesystem records a birth time (macOS, the BSDs; not Linux), never the mtime in its place; without it neither key is sent, so MCP's listings are unchanged -
GET/PUT/DELETE /api/workflows/{name}— read, save, delete workflow files (confined to--workflow-dir);PATCHapplies a JSON merge patch (RFC 7396,application/merge-patch+jsonor JSON) to the stored version and saves the result asPUTwould, under the same lock, so a save in between is not lostGETsends anETag("+ 32 hex characters of the file's SHA-256 +") andPUT/PATCHsend the one for the file they wrote. A write is unconditional unless it carriesIf-None-Match: *(409existswhen the writable file is there) orIf-Match: <etag>(409stale_write, with the currentetagor null, when the writable file differs or is gone). AGETof a name that resolves to a read-only source (an example, a builtin) sends that source'sETag, but a save lands as a new copy in the writable source, so a client saving it sendsIf-None-Match: *(create-only), notIf-Matchwith that tag -
GET /api/workflows/{name:path}/download— download a workflow file as JSON -
GET /api/workflows/{name:path}/variables— a workflow's variables and what they default to, without the definition around them. Long string defaults are cut to 200 characters and named intruncated, including strings inside a list default, named likeshots[0].prompt;full=truereturns them whole. Each entry also carriesoriginandwritable, and the body carrieslibraries,shadowedand theworkspaceit lists. Saving one whose validation gate itself crashes answers 500; an invalid one is 400 -
GET /api/prompts,GET/PUT/DELETE /api/prompts/{name}— the prompt library (confined to--prompt-dir, names held to what aprompt:reference can load); the listing carrieslibraries,shadowedand anorigin/writableper entry indetails; deleting a read-only entry is a 403; saves are validated against the prompt schema, served atGET /api/prompt-schema.times=trueaddsmtimeand, where the filesystem has one,createdto each detail, as the workflow listing doesGETandPUT /api/prompts/{name}send the sameETag, andPUThonoursIf-None-Match: *(409exists) andIf-Match(409stale_write) as a workflow save does; without either header it overwrites -
GET /api/prompts/{name:path}/download— download a prompt file as text -
GET /api/loras?model=&workflow=&status=&tag=,GET/PUT/DELETE /api/loras/{name}— the LoRA catalog (see LORAS.md): one JSON file per tried LoRA, in the root's writableloras/ahead of the shipped read-only ones. The listing (declared asLoraList) carrieslibrariesand anorigin/writableper entry;modelis a Hub repo id or a workflow name and matches exactly.GETof an entry that cannot be parsed is a 404 naming it unreadable; deleting a read-only entry is a 403; saves are validated against the entry schema, served atGET /api/lora-schema -
GET /api/loras/recommend?model=&query=&limit=— catalog entries for the model ranked against the query, then Hub candidates for the same exact base (the one place dw searches the Hub, only when called);hub_errorwhen the Hub is unreachable, and a concurrent search gets the catalog rows only -
GET /api/enhancers,POST /api/enhance— prompt-enhancement presets, and{"idea": ..., "preset": ..., "model_name": ..., "device": ...}to queue an enhancement as an ordinary job whose saved text file is the result -
GET /api/gallery,GET /api/gallery/{name}/metadata,DELETE /api/gallery/{name}— outputs and their embedded metadata (the metadata'slinked_jobslists every job linked to a request whose manifest lists the file, a step-cache reuse included, so a note can name the take). Delete takes a file, or a run directory (<workflow>/<run id>) to remove the whole run; a run's directory goes with its last media file. Each gallery entry carriesfolder(the workflow identity, the run id dropped) andsubfolder(what followed the run id - thefinal/intermediatea step'sresult.subfolderchose,''when it chose none);?folder=and?subfolder=filter independently (?version=too - with?folder=, the one run the gallery labelsv4), and the reply'sfoldersandsubfolderslist every distinct value over the whole tree,''always a member of each so root-level files stay selectable. Each entry also carriesrole,finalorintermediate(null for a flat-layout file with no run, or a file of a run that recorded no role whose subfolder says nothing and that no later run read;intermediateonce a later run read the file, unless the step'sresult.roledeclared it), andGET /api/gallery?role=finallists only those (repeatable; a null role counts as final). Seedw/roles.pyfor how a role is decided; the metadata route reports the file'sroleand the run'sinputstoo, andfindings: each level problem the probed soundtrack shows (full_scale,near_silent), measured againstdw/audio_qc.py's thresholds, in the assess route's finding shape. An image with an alpha channel or atransparencychunk hasmedia.alpha(min,max,transparent_fraction,partial_fraction,opaque_fraction, over its first frame), andfindingssaysalpha_opaque(info) when every pixel is opaque. For an.otiozbundle (export_timeline), the metadata'smediais the timeline -tracks(clips in order with name, frames, seconds and media member),has_audio_trackandmembers. Two opt-ins add to the listing, and a caller that sends neither gets exactly the keys above:?media=trueaddsduration_secondsto each audio and video entry on the page (each file's probe is memoised on its path, mtime and size, so a second listing re-probes only what changed), and?prompts=trueaddsprompts, run id -> thepromptargument its job was submitted with (a list's strings joined by newlines, cut to 2000 characters), for the runs on the page; a run whose job history no longer holds has no entry -
GET /api/gallery/{name:path}/download— download an output file -
GET /api/builtin-workflows— the packaged fragments a sub-workflow step names asbuiltin:<name>.json(dw/workflows/), which no workflow listing includes; the editor offers them in the step's path field -
GET /api/gallery/{name:path}/thumbnail— a small JPEG of an image, or of a video's first frame; 404 for other kinds.namemay be anasset:reference, which the editors' asset picker uses for its grid -
GET /api/gallery/{name}/image?max_dimension=768&crop=x,y,w,h&max_bytes=&format=auto— an image output orasset:sized for an inline answer: cropped (clamped), fitted tomax_dimension, and withmax_bytes(a base64 budget) halved until it fits. HeadersX-DW-Original-Size,X-DW-Returned-Size, and when they applyX-DW-CropandX-DW-Downscaled-To. Takes?token= -
GET /api/gallery/{name}/frames— frames of a video output orasset:as PNG tiles, with exactly one selector:at(comma list of seconds orframe:N),count(an evenly spaced contact sheet) orseams(trueor 1-based seam numbers: the frames either side of each shot boundary).boundariesandnamesgive the shots; without them, the shots the run's manifest (or a kept asset's sidecar) recorded.max_dimension(default 512),crop=x,y,w,hin source pixels, andmax_total_bytes: over it every tile shrinks to one shared size anddownscaled_tosays which (MCPget_output_frames) -
GET /api/gallery/{name}/audio?start=&duration=— the soundtrack of an output orasset:as WAV, or an excerpt; headersX-DW-Durationand, for an excerpt,X-DW-Excerpt-Start/X-DW-Excerpt-Duration. A whole audio-only file is served in its own encoding. 404 for a file with no soundtrack (MCPget_output_audio) -
GET /api/gallery/{name}/assess?probe=&detail=— every assessment probe that applies to a finished cut (analyze_shots,analyze_seams,analyze_sync_drift,analyze_held_frames), run in the server process on one decode: mergedfindings,rules_applied,rules_skipped, andnot_applicableper probe the file cannot feed.detail=trueadds each probe's answer underprobes;probenames one and answers with its full body. Findings are places to look, not verdicts (dw/assessment_rules.py; MCPassess_output) -
POST /api/gallery/compare— two to eight outputs side by side, and how far each is from a baseline; read-only, queues nothing. Body:names(2-8 gallery names orasset:references, one row each),at(1-8 moments, seconds or"frame:N"; default 4 evenly spaced frames of the shortest video),crop([x, y, w, h]: the region shown and measured; or one box per name, shown only),baseline(default the first name),max_dimension(default 384, longest side of each cell),texture_bands(default false: add per-output texture energy by wavelength band, below) andmax_total_bytes. Moments resolve to one frame index against the baseline (the first video if the baseline is a still) and every output is read at that frame number; a frame past an output's end is a blank cell. A still among videos repeats in every column; all stills give one column andatis ignored with a note. A crop must lie wholly inside every output's frame (400 otherwise). Reply:image(the grid as base64 PNG:data,mime_type,width,height; a row per output under a label band, each cell stampedframe N),downscaled_to(overmax_total_bytesthe whole grid shrinks, never below 64 px per cell; null when nothing shrank),baseline,region(full frame,crop [...], orfull frame (per-output crops are display only)),fps_differs(videos with different frame rates, so one frame number is not one second),columns({moment, frame}),rows(name, kind, size, crop, and for a videoframe_countandfps),metricsandnotes. Ametricsentry per non-baseline output holdscells(one per column:psnr_db,ssim,mean_abs_diff,reason) andpsnr_db/ssim/mean_abs_diffsummaries (mean,min,max), measured at source resolution; PSNR isidenticalwhen equal and SSIM is on luma (11x11 Gaussian window, sigma 1.5). An output whose size differs from the baseline gets null metrics and thereasonsize differs from baseline: WxH vs WxH, never a resize; a cell past an end sayspast end (N frames). Withtexture_bands, the reply adds atexture_bandsheader (fine"2-8 px",mid"8-32 px",coarse"32-128 px") and atexturelist, one entry per output:name,row,baselineandcells, each withtexture(luma,chroma_rg,chroma_bg, each{fine, mid, coarse}, RMS on a 0-255 scale after a least-squares plane is removed),texture_ratio(non-baseline only: output over baseline, null where the baseline band is 0) andreason. Each non-baselinemetrics[].cells[]entry carriestextureandtexture_ratiotoo. A band longer than the box's short side is null. One name is allowed with bands (it is the baseline: no ratios).cropmust be one shared box (a per-name list is a 400: "texture bands need one shared box") of at least 16 px a side. Errors: 400 bad request, out-of-bounds crop, every moment past every end, or not an image or video; 404 unknown name; 413 over the decode pixel limit; 422 undecodable file -
POST /api/gallery/archive—{"names": [...]}(1-1000) bundles a multi-file selection into one zip, named by each file's gallery-relative path so output subfolders survive; the gallery's bulk download. An unknown or out-of-directory name 404s the whole request rather than yielding a partial archive -
GET /api/workspaces/{name}/requests[/{id}],PUT /api/workspaces/{name}/requests/{id},DELETE /api/workspaces/{name}/requests/{id}?revision=N— the requests ledger (WORKSPACES.md has the rules). Reads derive from the jobs linked throughPOST /api/jobsrequest/item.GETandPUTof one request takereasons=true(the web page sends it): a failed or cancelled attempt then carriesreason, the first line of the job's error. Without it no attempt does, so the agent's reads are unchanged.GETof the list takesneeds=true(the web page sends it): each row then carriesneeds, how many items want the user by reason (held,ready,failed- can run again -revised,choose,accepted_missing) andnotes_waiting, the request page's rule (ledger_views.needs_counts). Without it no row does, andGET /api/requestsnever carries it. Every list row carriesclose_proposed: truewhile an agent's close proposal waits on the user (absent otherwise).Writing.
PUTtakes one request's whole plan:title,goal,items,revision(the one read, 0 to create) andwhy.- Optionally
prompt(create only),state(open,done,abandoned; a write withby: "agent"may reopen, but a close from it is 422close_needs_user),close_proposal,purge(keys of left-out items to remove for good) andby(user, the default, oragent). close_proposalis{state, reason}or null from an agent (propose or withdraw; 422request_closedwhen the request is not open after the write) and{outcome: "declined", note?}from the user (422no_close_proposalwhen none is pending). A user write that closes the request settles a pending proposal as accepted. Left out, the stored one stays.GETof one request returns it when there is one; the write's history entry carriesclose. The rules are in WORKSPACES.md.- A
notesfield, on the request or an item, is ignored on write: notes have their own routes (below), and a whole-plan write keeps the stored ones. - An item's
acceptedtakes{"job": id}or a bare job id of a succeeded job linked to that request and item, stored as{job, run_id}, or null to clear it. - An item's
review_untilis an ISO time with an offset 60 seconds to 24 hours ahead (422invalid_review_until,review_too_soonorreview_too_farotherwise); the hold's rules are under WORKSPACES.md.review_set_atandrevieware ignored on write. The server never starts a job at the deadline.
Deleting.
DELETEremoves the ledger entry at that revision and answers{id, workspace, deleted, revision, linked_jobs}; the linked jobs keep their rows, link and files, so the job and galleryrequestfilters still find them. A request later created under the same id starts with no attempts: only jobs created since a request was are its takes (itsattempts, status,spent_minutes,accepted, note refs and a later delete'slinked_jobs).Reading an item. Each item carries:
status-dropped,done,running,queued,failed,plannedorrevised; on a revised itemrevised_becausesays what moved (["arguments"], may includeworkfloworprompt:<name>when a referenced prompt's text changed after the take).ready- a job could be queued for it now.attempts-[{job, status, note?, reason?, minutes, output}], oldest first;reason(why a take failed or was cancelled) only withreasons=true.noteis the take's run note as it stands now (an edit withPUT /api/notesreplaces the one submitted, a cleared one drops the key).result-{job, run_id, output}or null.accepted_missing- only when true.spent_minutes.review_set_atand a derivedreview({until, state, seconds_left},stateone ofholding,redirected,due) -reviewonly while the item isplannedorrevisedon an open request.
Wherever it appears,
outputis{name, kind}- the gallery name of the one file that stands for the job, andimage,video,audioortext- or null. A job that wrote no image, video, audio or.txtgets its JSON (or.csv,.tsv,.md,.srt,.vtt) file astext; the gallery still does not list it. Any other file type leaves null.Reading a request and the list. The request view and each list row carry
spent_minutesandremaining_minutes. A list row also carriesstatus_counts(with arevisedkey when any),ready(items a job could be queued for now) andcover(up to threeoutputs of the latest results); the list carriesunreadablewhen the file is not a ledger.GET /api/gallery?request=<id>[&item=<key>]lists only files of runs whose jobs are linked to that request (or that item of it).Refusals. A refusal's
detailis{code, message}:Status code400 invalid_request404 unknown_request(delete)409 stale_revision(withcurrent_revision),ledger_full,too_many_dropped_items,request_has_active_jobs(withjobs),ledger_unreadable,no_workspace_root413 ledger_too_large422 prompt_is_write_once, and thereview_untilcodes above503 ledger_busy -
POST,PUTandDELETE /api/workspaces/{name}/request-notes— the user's notes for the agent (WORKSPACES.md has the rules).POSTtakes{request, item?, text, refs?}(noitem: the request's own note;refsis[{item?, job?, output?}], at most 16) and answers{note, revision};PUTtakes{request, note, text}and edits the text only;DELETE ?request=<id>¬e=<id>removes one. The server does the read-modify-write under the ledger lock, adds auserhistory entry and bumps the revision, so a caller sends no revision. Refusals: 404unknown_request,unknown_note; 422invalid_note_ref(a job not linked to the item, an output not in its manifest, a job still running with anoutput),too_many_refs,too_many_notes(20 per item or request),unknown_item,item_dropped. -
GET /api/requests— every workspace's open requests, newest change first, as{requests, unreadable?}: each row is a request summary (the list route's) with itsworkspace, andunreadablemaps a workspace whoserequests.jsonis not a ledger, or that could not be resolved while it was listed, to why; the others still list. It is the one read a notes channel makes when it watches the whole server, and markedX-DW-Notes-Channel: 1it counts as a poll of every workspace, including one made after it. -
GET /api/workspaces/{name}/notes-channel—{listening, last_seen}: whether a notes channel polled this workspace's request list in the last 30 seconds. A markedGET /api/requestscounts for every workspace. The channel marks its polls with anX-DW-Notes-Channel: 1header, and the server keeps the time in memory only. It means a session has the channel set up, not that Claude Code is passing its events on (MCP.md). -
GET /api/workspaces/{name}/changes—{epoch, workspaces, kinds}: the workspace's change counters, how the UI notices a write it did not make (an agent over MCP,dw.run, a job finishing).kindsholds one counter each forrequests,prompts,workflows,assets,gallery,jobs,modelsandloras; every server write that changes what a page lists bumps its kind after it succeeds, and a failed write bumps nothing. The prompt library and the shared asset library are shared, so a write to either moves that kind in every workspace;models(a download ending, a delete, a cache clear, a diffusers update) andloras(a catalog save or delete) belong to the server, so they always do.workspacesis one server-wide counter (a workspace created or deleted, or its note changed). Counters only grow and live in memory:epochis a random id that changes on a server restart, or when a workspace is deleted and made again under the same name, so a client that sees a new epoch reloads everything. An unknown workspace is 404. Not an MCP tool: an agent reads what it changed from its own calls. -
GET /api/workspaces,POST /api/workspaces({"name": ...}),DELETE /api/workspaces/{name}?acknowledged=true— the workspaces on this server (layout). Delete answers with what it would remove and refuses until acknowledged, refusesdefault, and refuses a workspace with jobs still queued or running. Each listed workspace carriesusage({files, bytes}), an approximate walk of its own folders at most once a minute; the shared prompt library counts againstdefaultalone.times=trueaddsmtime, the newest mtime of its own folders and the entries directly in them (a workflow saved, an asset folder filled, a run landing inoutputs/<workflow>/), andcreated, its root's birth time where the filesystem records one.exports/beside the workspace folders holds one directory per exported job and is never listed as a workspace -
POST /api/workspaces/{destination}/copy({"source": ..., "runs": [...], "assets": [...]}) — copy runs and assets from one workspace into another. Arunsentry is<workflow>/<run id>, or a bare<workflow>for all its runs; anassetsentry is a library-relative path as afterasset:, or a folder (proj/) for every file under it. Naming neither, a source equal to the destination, a path that escapes or reaches a symlink, or a sidecar named directly is a 400, an unknown workspace, run or asset a 404, and a server without a workspace root, a destination that is not writable, a run whose job is still queued or running, or a different file already at an asset's path a 409 (detail.conflictsnames every one). All or nothing. The reply is{source, destination, copied: {runs, assets}, already_present, renumbered, warnings: {unresolved_output_refs, absolute_paths, no_jobs}, bytes_linked, bytes_copied};renumberedmaps"<workflow>/<run id>"to{"from": 3, "to": 7}. What is copied and how is in WORKSPACES.md. -
GET /api/assets— the asset library: input media, each with theasset:reference a workflow carries rather than a path, since a path only means something on the server's own machine. Empty rather than an error when no library is configured.librarieslists the roots searched, in order, each{origin, root, writable}— which of them an upload or delete can actually reach is the one withwritable: true.shadowedlists the entries a nearer library hides: same shape as anassetsentry but withouturl(that URL would serve the shadowing file, not this one), plusshadowed_bynaming the origin that won. Anassetsentry carriesused_bywhen any of the workspace's own (writable) workflows names it in anasset:string, variable defaults included - a reference a run passes as an argument is not seen; the web UI shows a workspace only the shared assets its workflows use.?media=trueaddsduration_secondsto each audio and video asset returned, through the gallery's memoised probe; a caller that does not send it gets the keys above. The workflow and prompt listings carry the samelibrariesandshadowed([{name, origin, shadowed_by}]); a filter narrowsshadowedwith the entries. Upload, keep and delete answer 409This workspace has no asset librarywhen there is none -
POST /api/assets/keep({"name": ..., "asset_name": ..., "overwrite": false, "shared": false}) — keep a generated file as an input asset under a stable name, returning itsasset:reference, which survives the run's outputs being pruned. The copy stays inside the workspace and is a hard link where the filesystem allows one. Refuses an existing name unlessoverwrite: an existing name withoutoverwriteis a 409 whosedetailis{code: "exists", message}.asset_namemay name a folder and takes the kept file's extension when it carries none (a contradicting one is a 400) — the same rule the upload route follows, and what keeps a kept asset from landing under an extensionless name the library listing never shows."shared": truekeeps it in<root>/common/assetsinstead, the library every workspace shares -
DELETE /api/assets/{name}— remove one file from the asset library, deleting from whichever library on the search path holds it (the workspace's own before the shared one, the orderasset:resolves in). An asset from a read-only examples library answers 403, the same as a read-only prompt or workflow; a name nothing holds answers 404 -
POST /api/assets/archive—{"names": [...]}(1-1000) bundles a multi-file asset selection into one zip, each entry named by its library-relative path (the name itsasset:reference carries). It resolves down the same search path a run does, so a selection spanning the workspace's library, the shared one and an examples tree is one archive; an unknown or out-of-library name 404s the whole request, and a duplicate name (repeated, or differing only by surrounding whitespace) collapses to one entry. Media is stored rather than deflated, since it is already compressed, except raw formats that still compress (.bmp,.wav); everything else deflates, as do the export zip's text files -
POST /api/uploads?filename=&asset_name=&shared=¬e=— the raw bytes of one image, video or audio file, or a.cube3D LUT forapply_lut, as the body (no multipart). 200MB ceiling, checked fromContent-Lengthbefore a byte is read and again on the body; the extension is held to the allowed image, video, audio and.cubelist. Saved under the asset library'suploads/- the shared asset library at<root>/common/assetswhenshared=true, else this workspace's own - with a generated name, or asuploads/<asset_name>(folders allowed, the file's extension assumed, confined the waykeep_output's name is). Answers 201 withreference(asset:uploads/<name>, which a saved workflow can carry and still resolve later) andurl, the same file under/inputsfor previews. 409 when the workspace has no asset library. WithIf-None-Match: *anasset_namealready taken is a 409exists(answered from the file's existence, never by reading it) and nothing is written; without it the upload replaces the file. This is how the UI's file pickers get a local file onto the machine that runs the workflow -
GET /api/models,DELETE /api/models?repo={repo_id}— hub cache inventory and deletion -
GET /api/caches,DELETE /api/caches/{name},DELETE /api/caches/{name}/entries/{entry}- dw's disk caches of derived data (not the hub cache above):inductor(torch.compile's kernels),triton(Triton's own cache, which holds SDNQ'striton.jit/autotune kernels and is shared with any other Triton user on the machine) andquantized(the SDNQ quantized-component cache,DW_QUANTIZED_CACHE_DIR;enabledfollowsDW_QUANTIZED_CACHE=1, and an off cache still lists and clears). A cache with entries (quantized) lists them inline asentries(id,bytes,files,unreadable,model,subfolder,component,created,last_hit; an entry with a missing or unreadableentry.jsonisunreadable: trueand deletable) pluslow_disk(free space undermin(50 GiB, 10% of the volume)). The entry DELETE answers{"name", "entry", "deleted": true, "freed"}; the id must match^[0-9a-f]{64}$(else 400, before any path is built), 400 on a cache without entries or an unmarked root, 404 for an unknown entry. Forquantized, both it and the whole-cache DELETE also 409 while a model download is active. The GET answers{"caches": [...]}, each withname,root,enabled(tritonis false where it is not installed, as on a Mac),bytes,files,last_used(newest mtime, epoch seconds),clearable,not_clearable_reason(only when not clearable),cost_of_clearing,disk_freeanddisk_total. The DELETE answers{"name", "cleared": true, "freed", "files"}; 404 for an unknown name (the detail names the valid ones), 409 while a job is running or queued, 400 when the root is not clearable. It empties the root but keeps the root and its.dw-cachemarker: children are renamed into<root>/.clearing-<pid>-<rand>/, then deleted. Clearing costs a recompile or re-autotune on the next first step of each shape (100-300 s per shape on MiniMax-H3 fortriton). A clear also writes its time to a.dw-clearedfile beside the marker; atritonclear makes estimates forget the shapes run before it, so a template'sfirst_at_shapeterm comes back for each one (#1615). A populated root that an environment variable points away from its default has no marker and is not clearable until you create the.dw-cachefile in it by hand (read per request, no restart); see SECURITY.md. The System page's Caches panel drives all three. Behind the bearer token like every/api/*route -
POST /api/models/download({"repo_id": ...}),GET /api/models/downloads,POST /api/models/downloads/{id}/cancel— background snapshot downloads with byte-level progress -
GET /api/system/diffusers,POST /api/system/diffusers/update— installed diffusers version/commit, and a background diffusers install/ update (refused while a job is running or queued). The POST body is optional JSON,{"commit": ..., "revert": ...}: with neither, it installs from GitHub HEAD - forced in with--force-reinstall --no-deps, since main keeps one dev version string for a release cycle and a plain upgrade would keep an older commit, then a plainpip install diffusersfor any dependency the new commit adds;commit(7-40 hex characters, validated before it reaches the command line) pins the git install to that commit instead of HEAD. Without usable git (an installed copy, or nogiton the host) diffusers installs from a GitHub archive, which names a full hash, so acommitshorter than 40 characters is refused there with 400; a 40-character one is lowercased before it reaches the updater;revert: truepins back to the known-good published release instead of installing from git - the diffusers floor version read frompyproject.toml(pip install diffusers==<floor>).commitandrevertare mutually exclusive. The status response includesbefore(the version/commit that was installed when the update started) alongside the liveversion/commit, so a revert has a concrete before/after to compare -
GET /api/system/dw,POST /api/system/dw/update— the installed dw version, the newest release on PyPI (latest,nullwhen it cannot be read),newer(whetherlatestis a newer release than the installed version, by PEP 440;nullwhenlatestisnullor either version can't be parsed), whether this server ismanaged, thecommandthat updates it by hand, and the state of a running update; the POST starts one (Update dw) -
GET /api/memory,GET /api/health— worker VRAM/RAM stats and liveness; memory answerslive(whetherinfowas measured by this call),stale,reason(job_running,worker_stopped,worker_busy,worker_unreachable) andage_seconds, so a cached reading is never mistaken for the worker's memory now -info: nullmeans nothing has been measured because nothing is resident. Withoutdevice(?device=cuda:1) the first card's reading is at the top level andworkershas one entry per card, each naming itsdevice; with it, that card's alone (400 for a card this server has no worker on). health also reportshostname,version,device, thequeuedcount, theattention_backendsthis device can run, and whethermcpis mounted, so a remote client can tell which machine answered.current_jobis the longest-running job andworker_aliveis true if any worker is alive;workershas one entry per card (one with a single device):{device, name, vram_gb, current_job, alive, host_memory_rss_mb, pid, workspace, oom_score_adj}-deviceis the ordinal (cuda:1) andnamethe GPU's own name, the two halves of a job'sdevice- the last three absent when the worker process isn't running, andworkspace- the workspace ofcurrent_job- absent while the worker is idle (oom_score_adjis read from/procat call time, so it shows the kernel's value: 1000 for the latest dispatch's worker in a pool, the spawn-time value - the server's own - for the others) -
POST /api/memory/clear— drops every loaded pipeline and the step cache on each idle card (MCPclear_memory), and returns the memory reading taken right after. A card running a job is left alone:workersreports it{device, cleared: false, reason: "job_running", job}. With?device=cuda:1it clears that card alone and answers{cleared, info, device}. Refused with 409 when no card asked about is idle - the caller retries once the job finishes rather than this call blocking until it does -
GET /api/server— connection details for the Connect and System pages:hostname,version,device, thebind_host/port/wildcard_bindthe server was started with,auth_required(whether a token is configured - never the token itself),trust_workflows(whether--trust-workflowsis on),mcp(mountedplus itspath), thedirectoriesin use, andruntime- Python version, torch version and the CUDA version torch was built against, the NVIDIA driver version (vianvidia-smi, when it's on PATH), and the installed versions of diffusers, transformers, accelerate, bitsandbytes, peft, safetensors and sentencepiece (nullfor one not installed) - for diagnosing an environment mismatch between boxes without shelling in; the machine's non-loopbackaddresses; a client composes its URLs from an address, the port and the MCP path; andstorage, read-only (#1457):job_historyis{path, size_bytes, rows, oldest, newest}- the SQLite file plus its-wal/-shmsidecars, a realCOUNT(*)of its runs, and the first and lastcreated_atas epoch seconds - andlogsis{path, size_bytes, backups, total_bytes}- the active log file, how many of its rotated backups (at most 7) are on disk, and the bytes of all of them. A figure that can't be read isnull, never an error;logsisnullwhen no log file is configured. The System page shows both as a Storage panel beside Caches
A note is optional plain text on a run, on a file in a run, on an asset or
on a workspace, saying what it is for. At most 4,000 characters (longer is
a 400); null or "" clears it. Only the server writes notes: a run's and
its files' live in notes.json in the run directory, an asset's in
notes.json in its library directory, and a workspace's in workspace.json
at its root (dw/notes.py).
PUT /api/notes?workspace= with {"target": ..., "note": ...} sets or
clears one. target is one of:
- a gallery file name (
output:accepted) - that file's own note. A flat-layout file has no run directory and answers 409notes need a run directory; - a run directory,
<identity>/<run id>- the run note; asset:<name>- resolved down the asset search path the way the asset delete resolves it, a read-only examples tree answering 403;workspace:<name>,workspace:defaultfor the root's own (409 on a server with no workspace root).
The answer is {target, note, note_source}: the target's effective note
after the write, and whether it is the file's own ("file") or its run's
("run"); note_source is null for a workspace and when there is no note.
A file's effective note is its own, else its run's. An unknown target or
one that would leave its root is a 404 (a name a workspace cannot take, or
an invalid asset name, a 400), and a write that fails a 500. Notes are free
metadata and need no acknowledged_cost.
GET /api/notes?target=&workspace= reads one target's own note
(a file's, never the run's it falls back to) as {target, note, etag}, the
etag in the ETag header too: a strong tag over the note's text, "" for
none. A PUT that sends If-Match with it writes only if the note is still
that text, else answers 409 stale_write with the current etag and
writes nothing, the way a workflow save does. If-Match: * always matches a
note, since a note is never missing. The header is opt-in: without
it a PUT is last-writer-wins, as MCP's set_note is.
Notes are set at creation too:
POST /api/jobstakesnote. It is kept on the job (notein every job summary and detail, and in history) and written as the run note when the worker reports the run directory (run_start); a rerun carries it forward.POST /api/uploads?note=keeps it beside the upload. An upload over an existing name takes its own note or none, never the old file's.POST /api/assets/keeptakesnote; without one the kept asset takes the source file's effective note.
They are read back on every listing: a gallery entry's note is the
effective one; the metadata route carries note, note_source and the
run's run_note; an asset entry and a workspace entry carry note. Each is
absent when unset. Deleting an output drops its note and its star; deleting
an asset drops its note and its kept provenance and shots, so a later file
under the same name inherits none of them.
PUT /api/stars with {"name": <gallery file name>, "starred": true|false}
stars or unstars one output file - the "keep" mark for culling a run. A star
is stored in the run's notes.json ("starred": [...]) beside its notes, and
the gallery listing carries "starred": true on a starred file. Only a file
in a run directory can be starred: a flat-layout file has no run directory
and answers 409, and a run, asset or workspace target is a 400.
A preference:<key> reference (WORKFLOW_GUIDE.md)
resolves through a ladder: tier (draft, standard, best) -> an ordered
list of targets, the first that fits this host wins. A target is a catalog
workflow name, or {"workflow": ..., "arguments": {...}, "devices": [...]}.
dw ships ladders (dw/preference_defaults.json). This server's own
overlay, preferences.json in the settings directory, replaces whole keys
and is written only by these routes:
GET /api/preferences?key=&resolve=answers{default_tier, etag, preferences: {key: {source, etag, ladder}}}.sourceisshipped, orserverwhen the overlay replaces the key.resolve=trueaddsresolutions, this host's pick per tier (target,skippedwith each reason,line), or theerrorvalidate would give. Resolution here judges the device and smallest card only: it makes no Hub calls, so a gated or undownloaded target shows up only in a validate plan.key=reads one key (an unknown one is a 404) and puts its etag in theETagheader. MCP'sget_preferencesis this withresolve=true.resolve=true&full=true(the Preferences page's read) resolves as admission does: a gated or undownloaded target is skipped or noted (notes, with the download size), and each key addsused_by, the workflows that reference it, andcontract, the variables every target must take. Plainresolve=trueis unchanged and Hub-free, and so is the run form's and MCP's answer.POST /api/preferences/{key}/checkwith{ladder, full, known_blocked}dry-runs a ladder that is not saved: per tier{target, skipped, notes, after, error, target_errors, warnings}(the pick, what was passed over and why, the notes such as a pending download, the targets after the pick, the refusal when nothing fits, each target a PUT would refuse, and each contract variable a target does not take). It never writes.full=falsemakes no Hub calls (a name inknown_blockedis skipped as gated);full=trueprobes as admission does. A ladder of the wrong shape is a 422; a key not in the store is allowed.PUT /api/preferences/{key}with the ladder as the body ({"best": ["models/z-image"]}) replaces the key's ladder, or adds a key. The answer is the key as GET gives it, withresolutions. It is a 422 when the ladder is the wrong shape, names a workflow the catalog does not hold (every one named), or gives a target arguments its workflow refuses. A ladder nothing on this host fits is stored: itsresolutionsshow the refusal, and validate gives the same refusal.DELETE /api/preferences/{key}resets a key to what ships (removed: false,source: shipped). A key only the server had is gone (removed: true), and an unknown key is a 404.PUT /api/preferenceswith{"default_tier": ...}sets the tier a reference withouttierresolves at. Its etag is the top-leveletagGET answers.
Every write takes an opt-in If-Match, checked under the overlay's lock. A
stale one answers 412 stale_write with the current etag and writes
nothing. (The note routes answer 409.) A write lands atomically. A job
already queued keeps the target its admission pinned, and only a later
submit or validate sees the change.
The server is built to serve your own GPU to your own browser, not the network:
- Binds to
127.0.0.1by default.--host 0.0.0.0(or any other non-loopback address) is possible; without a token configured (see Authentication, below) the server logs a startup warning, since anything that can reach that address can queue jobs and browse/delete files. - Requests carrying an
Originheader are rejected (403) unless its hostname is a loopback name, the configured--host, or the hostname the request itself was addressed to (Host). The last clause lets a browser on another machine use a--host 0.0.0.0server by LAN IP or hostname; it still blocks cross-site pages and DNS rebinding, where the attacker's page carries its ownOriginwhileHostis whatever resolved. Scheme and port are ignored, so a TLS-terminating proxy that forwardsHostunchanged needs no configuration. AnOriginthat cannot be parsed is refused the same way (403), not answered with a 500. - Every response carries
X-Content-Type-Options: nosniffandX-Frame-Options: DENY: a browser renders nothing as a type the server did not declare, and no page elsewhere can frame the UI. The UI itself carries no Content-Security-Policy yet. /outputsand/inputsshare the UI's origin, where the API token lives in localStorage, so a file served as an active document type (text/html,application/xhtml+xml,text/xml,application/xml,image/svg+xml) carriesContent-Security-Policy: sandbox: it opens under an opaque origin with no script. Range and ETag answers are unchanged. The engine does not write a result of any of those types (below), so such a file is one planted on disk.- Requests carrying a
Hostheader that names neither a loopback address nor the configured--hostare rejected (400). A wildcard bind (--host 0.0.0.0or::) skips this check - clients reach such a server by the machine's LAN IP or hostname, never by the bind address, so there is no allowlist to build from it. This is defense-in-depth, not the DNS-rebinding fix by itself - theOrigincheck above already covers browser requests, since a browser'sOriginreflects the real requesting origin regardless of what DNS name resolved to this address. TheHostcheck closes the remaining gap: a non-browser client (curl, a script, the MCP client) that never sendsOriginat all. - Every path from HTTP input goes through
dw/security.pyvalidation; workflow files (both the/api/workflowsCRUD routes and aworkflow_pathgiven to/api/jobsor/api/validate) are confined to the workflow directory, prompt files to the prompt directory, outputs to the output directory, and traversal (../) is blocked throughout. - Inline workflow definitions are schema-validated before queueing, and
their
base_diris validated like any other path input. - A workflow JSON file can execute arbitrary Python (
pre_load_modules, dotted*_type/config_typevalues - see Trust model).dw-serverefuses that surface by default for every job it runs, inline or from a file, MCP-submitted or not;--trust-workflowslifts the refusal for the whole server and should only be passed when nothing untrusted can reachPOST /api/jobs. --mcpmounts the MCP tool surface at/mcp(Streamable HTTP) behind the same token as/api, for an agent on another machine with no local install. Both/mcpand/mcp/are answered, and the token is accepted only as anAuthorization: Bearerheader there - never as?token=. It is refused on a non-loopback bind without a token. See REMOTE.md.
There is no authentication by default - the checks above assume a trusted local machine or LAN. An optional static bearer token closes that gap:
python -m dw.serve --token "some-long-random-string"
# or
export DW_API_TOKEN="some-long-random-string"
python -m dw.serveWhen a token is configured, every /api/* and /mcp request must carry
Authorization: Bearer <token> or gets a 401. The UI's static files,
/outputs, /inputs and /exports/{id}.zip stay reachable without it: the
page has to load far enough for a user to enter the token, and an
<img>/<script> tag cannot attach a header. That is why an active document
served from /outputs or /inputs is sandboxed (Security model, above).
Six GET routes also accept the token as ?token=, because a browser loads
them without being able to set a header: the SSE stream
GET /api/jobs/{id}/events (EventSource), GET /api/gallery/{name}/thumbnail
and GET /api/gallery/{name}/image (<img> tags), and the three /download
routes (gallery output, workflow, prompt; <a download>). The allowance is
bound to those routes, not to a path suffix. It is a narrower trade-off - a
token in those URLs can leak into logs or browser history - and every other
route, /mcp included, takes the header only.
The web UI's key icon in the header stores the token in localStorage and
attaches it to every API call, as a query parameter on the routes above; a
/?token=... link saves it the same way. Anyone with the browser profile can
read it back. The MCP server reads the same DW_API_TOKEN (or
dw-mcp --token), so one export configures both ends - see MCP.md.
A token configured this way is a single shared static secret, not a login
system: there is one token, checked with a constant-time comparison, and no
notion of separate users or sessions. It raises the bar for exposing the
server on a LAN or beyond; it is not a substitute for a real network
boundary (a firewall, a VPN, or simply binding to 127.0.0.1) for anything
more exposed than that.
Running on another machine - token, firewall, systemd unit, the browser,
--mcp, and beyond the LAN - is REMOTE.md.







