Repository navigation
dsh-comfyui: projects, validation and a rung ladder over ComfyUI - #17
Merged
Merged
Conversation
Adds packages/dsh-comfyui, a host-only bundle (one row, no route, no browser
half, zero npm dependencies) that turns a small readable project spec into the
two files ComfyUI actually consumes, checks them, and reports what a run
produced.
Seven tools:
comfy_status install / server / catalog / python as four facts that fail
independently. Probes 8188 AND the Desktop ports 8000-8003
(Desktop does not use 8188). Starts nothing.
comfy_nodes the catalog in force - a live /object_info, a cache, or the
built-in core table - with each class's input ORDER, which is
what widgets_values means.
comfy_project new (from a template or an inline spec, rebinding model
filenames to this machine's own file lists), list, show,
build, import.
comfy_validate ComfyUI's own checks offline, with /prompt's error strings
(required_input_missing, return_type_mismatch,
value_not_in_list, dependency_cycle, prompt_no_outputs, ...)
plus the node KEY and input NAME.
comfy_run build, refuse a graph with errors, submit, wait for /history,
report files with /view URLs and their path on disk - or the
node that raised.
comfy_test the ladder over the shipped library: compile always (writes
nothing), run when a server answers.
comfy_cli comfy-cli as a SECOND test path: comfy run --workflow (it
converts the canvas itself), node deps-in-workflow, launch
--background, stop. Never installs anything.
The reason it exists is one trap and one gap:
* widgets_values is an UNNAMED positional array, and a class declaring
control_after_generate inserts an extra value right after itself. Measured
on ComfyUI 0.21.1, KSampler.seed has it, so its array is
[42, "fixed", 4, 1.5, "lcm", "sgm_uniform", 1.0]. A converter that drops
index 1 opens a graph whose cfg, sampler and scheduler are all shifted, and
nothing reports it. The compiler derives that array from /object_info and
the package check asserts it.
* with no server nothing checked that a graph's checkpoint exists. A new
file check reads the INSTALL (models/<folder>/, input/, comfy-cli's extra
model roots) for any file input whose option list the catalog did not know,
and reports value_not_in_list with the folder, the file count and the
nearest name - so v1-structural on a machine whose models are present is a
claim somebody made.
Every answer names the rung it reached: v1-structural (core table),
v2-schema (a complete server catalog), v3-queued, v4-executed.
Four examples (two need no model at all, so a new machine proves the queue
before a download), six skills (the fundamentals, the two workflow dialects,
the HTTP API as this install has it, comfy-cli across platforms, authoring a
node class, the project dialect), and a package check of 364 assertions that
needs neither a server nor a CLI: a fake ComfyUI answers the real routes with
real-shaped bodies, a fake comfy-cli answers the measured 1.29.0 envelopes, the
canvas round-trips back to the identical prompt, and every refusal is produced
by name.
comfy-cli facts were measured, not guessed, against 1.29.0: --json is a GLOBAL
flag (comfy --json env; comfy env --json is a usage error), every answer is an
envelope with the payload under data, and node deps-in-workflow refuses without
a valid workspace and ComfyUI-Manager - both sentences are reported instead of
raw stderr, and --workspace names the tree comfy_status found.
Checks run: node packages/dsh-comfyui/checks/check-comfyui-node.mjs (364, 0
failures, the live half skipped - no server here), check-node-routes.mjs,
check-scripts.mjs, check-no-secrets.mjs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
packages/dsh-comfyui— a host-only bundle (one row, no route, no browser half, zero npm dependencies, no bundled engine) that turns a small readable project spec into the two files ComfyUI actually consumes, checks them, and reports what a run produced.Seven tools:
comfy_status,comfy_nodes,comfy_project,comfy_validate,comfy_run,comfy_test,comfy_cli.Six skills: the fundamentals, the two workflow dialects, the HTTP API as this install has it, comfy-cli across platforms, authoring a node class, and the project dialect.
The two problems it exists for
1. The unnamed array. A workflow's
widgets_valuesis a positional array of values with no names, and a class that declarescontrol_after_generateinserts an extra value right after itself. Measured on the installed ComfyUI 0.21.1,KSampler.seedhas it:A converter that drops index 1 opens a graph whose cfg is 4, whose sampler is
1.5— and nothing reports it. The compiler derives that array from/object_info, and the check asserts this exact array.2. Nothing checked the files without a server.
/object_infois what turns a dropdown into a file list, so with the app closed a graph naming a 2 GB checkpoint validated "clean". A new file check reads the install (models/<folder>/,input/, plus the extra model roots comfy-cli reports) for any file input whose option list the catalog did not know, and reportsvalue_not_in_listwith the folder, the file count and the nearest name. It runs on the compiled prompt, so@bindingsare already filenames.The rung ladder
Every answer names the rung it reached, so "it compiles" is never printed as "it runs":
v1-structuralv2-schemav3-queued/promptaccepted itv4-executed/historyentry finished and named filescomfy-cli, measured not guessed
Every CLI fact was verified against 1.29.0 on this machine (via a throwaway
uvxrun, nothing installed):--jsonis a global flag:comfy --json env.comfy env --jsonis a usage error (No such option: --json) — the first version of this PR got that wrong.{schema, type, ok, command, version, where, data, error}; the payload is underdata, the CLI version is top-level, and a refusal carrieserror.code/message/hint.comfy node deps-in-workflowrefuses before reading the graph without a valid workspace ('<path>' is not a valid ComfyUI workspace) and without ComfyUI-Manager — a Desktop install keeps its Manager inside the app. Both sentences are reported in words, and--workspacenames the treecomfy_statusfound so the first refusal is avoided.comfy run --workflowaccepts the UI canvas and converts it itself: an independent check on what this package generated.comfy_clinever runscomfy install, installs a node, downloads a model or removes anything.Verification
node packages/dsh-comfyui/checks/check-comfyui-node.mjs→ 364 assertions, 0 failures, live half skipped (no server on this machine). A fake ComfyUI answers the real routes with real-shaped bodies; a fake comfy-cli answers the measured envelopes; the canvas round-trips back to the identical prompt; every refusal is produced by name; the skills' fenced examples are parsed (json/js/python) or checked against the documented routes and subcommands.check-node-routes.mjs,check-scripts.mjs,check-no-secrets.mjs→ pass.Honest limits
comfy_test action=runand the port-table's live comparison are therefore unproven here; the port table is transcribed from the installed 0.21.1 source and asserted against a fixture, and/object_inforeplaces it wholesale the moment a server answers.comfy_cli action=depscannot succeed on a Desktop install (no Manager in the tree) — that is comfy-cli's rule, now reported rather than hidden.Test plan
Then with ComfyUI running:
comfy_status→comfy_test action=run examples=["smoke-image","smoke-video"](neither needs a model) →comfy_project action=new template=text-to-image.