fix(lora): the curve-form note leads with its verdict, and prints whole

It was trimmed at "adaLN reads a compact…", which cut every actionable word:
how many dropped, that the rest of the LoRA still applies, and what to do. The
verdict is now the first sentence, and the line asks for its full text — this
only prints when a LoRA is half-landing, which is the one moment the whole
explanation earns its line.

Tests: 1830 python (+1), 68 JS.
This commit is contained in:
digital-garbage
2026-08-26 23:29:51 +03:00
parent 88cc86aef0
commit cf6d153f12
2 changed files with 29 additions and 8 deletions
+11 -8
View File
@@ -416,13 +416,13 @@ def _adaln_curve_note(model, bad):
if not getattr(dm, "use_adaln_curves", False):
return None
n = sum(1 for k, _, _ in bad if "adaln_proj" in k)
return (f"{n} adaLN adapters do NOT apply: this is a curve-form H3 checkpoint (adaLN "
f"reads a compact time-curve basis), and the LoRA was trained against the "
f"full-width form. They cannot be projected onto it — the basis that built the "
f"table is not in the checkpoint. They are DROPPED rather than attempted — each "
f"attempt builds the full-size delta before discovering it does not fit. The rest "
f"of the LoRA still applies. For the full effect use a LoRA converted for "
f"ComfyUI's H3 checkpoint.")
return (f"{n} adaLN adapters DROPPED, the rest of the LoRA still applies. This is a "
f"curve-form H3 checkpoint (adaLN reads a compact time-curve basis) and the LoRA "
f"was trained against the full-width form, so they cannot be projected onto it — "
f"the basis that built the table is not in the checkpoint. Dropped rather than "
f"attempted: each attempt builds the full-size delta before discovering it does "
f"not fit. For the full effect use a full-width H3 checkpoint, or a LoRA "
f"converted for this one.")
_DROPPED_FRAGMENT = re.compile(r"\| (\d+)/(\d+) DROPPED")
@@ -506,7 +506,10 @@ def resolve_lora_patches(model, lora, clip=None, name=None):
patches.pop(key, None)
curve = _adaln_curve_note(model, bad)
if curve:
_log.note_on_change(f"lora:adaln_curve:{name or '?'}", "FunPack", who + curve)
# full: the payload IS the detail here, and this only prints when a LoRA is
# half-landing — the one moment the whole explanation is worth its line.
_log.note_on_change(f"lora:adaln_curve:{name or '?'}", "FunPack", who + curve,
full=True)
note += f" | {len(bad)} adaLN adapters DROPPED (curve-form — see log)"
else:
# WITH the numbers. "trained against a different variant" is not actionable on
+18
View File
@@ -284,3 +284,21 @@ def test_the_sample_says_how_many_it_did_not_show(mm):
def test_an_empty_side_reads_as_empty_rather_than_blank(mm):
assert mm._sample_keys({}) == "(none)"
def test_the_curve_note_leads_with_the_answer_and_prints_whole(mm, monkeypatch, capsys):
"""It is trimmed to its first sentence like everything else, so the verdict — how many
dropped, and that the rest still applies — has to BE the first sentence. It also asks for
its full text: this only prints when a LoRA is half-landing, which is the one moment the
whole explanation is worth its line."""
import funpack_log as L
note = mm._adaln_curve_note(
_Model({"diffusion_model.blocks.0.adaln_proj.linear.weight": (16128, 64)},
use_curves=True),
[("diffusion_model.blocks.0.adaln_proj.linear.weight", (16128, 2688), (16128, 64))])
first = L.compact(note)
assert "DROPPED" in first and "rest of the LoRA still applies" in first
import inspect
assert "full=True" in inspect.getsource(mm.resolve_lora_patches)