Defaults an administrator can actually set

There were none. `workflow.DEFAULTS` was the only source, so 512x512, euler and
twenty steps were what every instance got whatever card it was running on -- and
512 square on an SDXL checkpoint is precisely what the tool's own description
warns produces duplicated limbs. The two ways round it were both bad: bake
literals into a template where the placeholders should be, or write prose in the
instructions box and hope.

Three rungs now, most specific winning, with DEFAULTS staying underneath as the
floor so an instance that sets nothing behaves exactly as it did and a floor
improved in code still reaches everybody. An empty box is "no opinion" rather
than zero, which matters: read as a number it would set every instance to zero
steps, and ComfyUI refuses that in a way that looks like a broken model.

The right control for each, because a text box is wrong for most of them. The
samplers and schedulers were already being discovered by the Test button, stored,
and read by nothing at all -- they are the pickers now. A stored value missing
from the list is kept as an option anyway, or opening this page and pressing Save
would silently clear a working setting. Checkpoints are chosen rather than typed,
and the instance default is a rung of its own instead of "whatever happens to be
first in a textarea somebody filled in some order".

And batch, at last: `batch_size` was a literal 1 in the base template, so an
administrator whose card can comfortably make four had no way of saying so.
Deliberately not something a model may set -- one asking for six because it is
unsure is the exact cost this must not invite.

The tool's schema restates the defaults it quotes. Every "Default 20." in there
was written when there was one set of defaults in the world; left alone, an
instance drawing at 1024 would go on telling the model 512, and the model reasons
from that sentence rather than ignoring it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jaroslav Beneš
2026-08-06 11:50:37 +02:00
parent fb54a236ae
commit 6fcb9c9892
16 changed files with 784 additions and 39 deletions
+49
View File
@@ -124,3 +124,52 @@ this is read off a form, and `resolve_tools` still decides whether the tool
exists, so forcing one that was never offered does nothing. `payload.pop(
"tool_choice")` after the first round is load-bearing: left in place the reply
would draw a picture, be asked again, and draw another.
## The defaults an administrator can set
**There were none, for the whole life of the feature.** `workflow.DEFAULTS` was
the only source, so 512×512, `euler` and twenty steps were what every instance
got whatever card it was running on — and 512² on an SDXL checkpoint is exactly
what the tool's own `width` description warns produces duplicated limbs. The two
ways round it were both bad: bake literals into a template where the
placeholders should be, or write prose in the instructions box and hope the
model obeys it.
`resolve(given, settings=…)` is three rungs now, most specific winning:
**`DEFAULTS` → the instance's `default_*` settings → what the model asked for.**
`DEFAULTS` stays underneath as the floor, so an instance that sets nothing
behaves exactly as it did, and improving a floor in code still reaches everyone.
**An empty setting is "no opinion", not zero.** `_number` in `admin_images`
returns `""` for an empty box and `instance_defaults` skips it. Reading it as a
number instead would set every instance to zero steps, which ComfyUI refuses in
a way that looks like a broken model.
**The samplers and schedulers were already being discovered and read by
nothing.** `comfy.discover()` has fetched all three lists since the Test button
existed, and only `checkpoints` was ever used. The pickers are built from the
other two. A stored value that is not in the list is kept as an option anyway,
or opening the page and pressing Save would silently clear a working setting.
**`batch` is a placeholder a model cannot set.** `batch_size` was a literal `1`
in the base template, so an administrator whose card can make four at a time had
no way of saying so. It is absent from `MODEL_SETTABLE`, deliberately: a model
asking for six because it is unsure is the exact cost this must not invite.
**The schema restates the defaults it quotes.** Every "Default 20." in
`SCHEMA` was written when there was one set of defaults in the world.
`_restate_defaults` rewrites each one from what this instance actually resolves
to — a schema saying "Default 512" beside an instance that draws at 1024 is
worse than saying nothing, because the model reasons from it and omits the
parameter, arriving at the right behaviour for the wrong reason or the wrong one
silently. The regex keeps the punctuation it found, since `denoise` says
"Default 1, which is…" and the rest use a full stop.
**The workflow editor's legend shows the resolved value beside each
placeholder.** A list of names answers "what may I write"; the question somebody
has in front of a workflow that came out wrong is "what happens if I leave this
out", and that answer moved the day instance defaults arrived. It is resolved
through the same call a generation makes, so the two cannot disagree. The legend
also states the two names that are not ComfyUI's own — `{{model}}` fills
`ckpt_name` and `{{sampler}}` fills `sampler_name` — which is the mistake that
costs an afternoon.