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:
@@ -487,3 +487,46 @@ def test_every_parameter_says_when_to_move_it(db, user_id, configured):
|
||||
"the negative prompt's one real trap: phrasing it as an instruction"
|
||||
)
|
||||
assert "portrait" in schema["properties"]["width"]["description"]
|
||||
|
||||
|
||||
def test_the_schema_states_this_instance_s_defaults(db, registered):
|
||||
"""Every "Default 20." in those descriptions was written when there was one
|
||||
set of defaults in the world. A schema still saying "Default 512" beside an
|
||||
instance that draws at 1024 is worse than saying nothing: the model reasons
|
||||
from it and omits the parameter, arriving at the right behaviour for the
|
||||
wrong reason or the wrong one silently."""
|
||||
from lembas.services.images import tool as image_tool
|
||||
|
||||
schema = image_tool.schema_for(
|
||||
db, {"default_width": 1024, "default_steps": 30, "default_sampler": "dpmpp_2m"}
|
||||
)
|
||||
properties = schema["properties"]
|
||||
|
||||
assert "Default 1024." in properties["width"]["description"]
|
||||
assert "Default 30." in properties["steps"]["description"]
|
||||
assert "Default dpmpp_2m." in properties["sampler"]["description"]
|
||||
# And the rest of the sentence survives -- these say what to do *instead* of
|
||||
# the default, which is most of their value.
|
||||
assert "SDXL" in properties["width"]["description"]
|
||||
|
||||
|
||||
def test_a_whole_number_default_is_not_written_as_a_decimal(db, registered):
|
||||
""""Default 8.0" is text a model reasons about, and reads as a precision
|
||||
somebody chose."""
|
||||
from lembas.services.images import tool as image_tool
|
||||
|
||||
schema = image_tool.schema_for(db, {"default_cfg": 6})
|
||||
|
||||
assert "Default 6." in schema["properties"]["cfg"]["description"]
|
||||
assert "Default 6.0" not in schema["properties"]["cfg"]["description"]
|
||||
|
||||
|
||||
def test_the_punctuation_after_a_default_is_kept(db, registered):
|
||||
"""`denoise` says "Default 1, which is what you want…" while the rest use a
|
||||
full stop. A rewrite that assumed one would produce a sentence that does not
|
||||
read."""
|
||||
from lembas.services.images import tool as image_tool
|
||||
|
||||
schema = image_tool.schema_for(db, {})
|
||||
|
||||
assert "Default 1, which is" in schema["properties"]["denoise"]["description"]
|
||||
|
||||
Reference in New Issue
Block a user