From cf6d153f1277e4f6dbd923ea63e9dde82574c1ce Mon Sep 17 00:00:00 2001 From: digital-garbage <133010426+digital-garbage@users.noreply.github.com> Date: Wed, 26 Aug 2026 23:29:51 +0300 Subject: [PATCH] fix(lora): the curve-form note leads with its verdict, and prints whole MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- model_management.py | 19 +++++++++++-------- tests/test_lora_shape_mismatch.py | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/model_management.py b/model_management.py index 62b90020..e77b9de4 100644 --- a/model_management.py +++ b/model_management.py @@ -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 diff --git a/tests/test_lora_shape_mismatch.py b/tests/test_lora_shape_mismatch.py index ba88602d..8b0cf60b 100644 --- a/tests/test_lora_shape_mismatch.py +++ b/tests/test_lora_shape_mismatch.py @@ -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)