Repository navigation
Fix issues found in code review - #6
Merged
Merged
Conversation
Eight findings from a review of 1.2.0. None changes behaviour for a correctly paired LoRA and model; the first two matter when the pairing is wrong. The FLUX and SDXL classifiers never received the dot-boundary fix the Universal loader got. They matched on the underscore-normalised key, which erases the separator distinguishing an outermost block stack from one nested inside a block, so an SDXL key input_blocks.4.1.transformer_blocks.0.attn1.to_q.weight was read as double-stream block 0. Anchoring on "." alone is not enough either, since the nested stack is also dot-preceded, so the stack patterns are anchored to the start of the module path after an optional known prefix. Real FLUX and SDXL keys are unaffected -- verified against 782 and 1696 authentic keys. Choosing the wrong loader for a model was silent: the keys still match, because ComfyUI builds the key map from the model, so the LoRA loads and every tensor lands in whichever single bucket the classifier reaches. A mismatch check now warns, on the info output and in the log, when 90% or more of the UNet tensors land in one block. A threshold rather than "all of them" because cross-family names overlap slightly: real SDXL keys through the FLUX classifier leave 98.7% in the catch-all and send the rest to the shared proj_out token. Measured at 99% and 100% for the two mismatched pairings, silent for all six correct ones. Also: - Families register through register_family() instead of mutating bobs_blocks' tables at import time. The old approach made behaviour depend on import order and left test_bobs_blocks one import away from a KeyError on "UNIVERSAL". - Tooltips are stored per family. FLUX/SDXL and Universal each define a block named "Text Encoder", and the Universal wording overwrote the other. - The "_head_" output token also matched multi_head_attention and head_dim_proj; it is now anchored to a real head module, along with out.<n>. - An unknown preset name logs a warning rather than silently acting as Custom. - FLUX block indices accept the negative form, matching the Universal loader. - Dropped a 1.01 bucket boundary guarding a fraction that cannot occur. - _mismatch_warning uses its blocks argument rather than the sparse grouped dict, which is dense in production but not in tests. Tests grow from 55 to 71, adding tests/test_node_behaviour.py for node registration, widget order, report formatting and the new warning. The real ComfyUI integration harnesses still classify 8000+ authentic keys across 11 architectures with nothing falling through. Bumps version to 1.2.1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TUT2wQ8UsjNgosRWu6jvpj
BobsBlazed
marked this pull request as ready for review
July 29, 2026 14:48
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.
Eight findings from a review of 1.2.0. None changes behaviour for a correctly-paired LoRA and model — the first two matter when the pairing is wrong.
1. The dot-boundary fix never reached the FLUX/SDXL classifiers
The Universal loader matches block stacks on the raw dotted key, because normalising
.→_erases the separator that distinguishes an outermost stack from one nested inside a block. The two dedicated classifiers never got that fix, so an SDXL key:matched the inner
transformer_blocksand was read as double-stream block 0.Anchoring on
.alone turned out to be insufficient — the nested stack is also dot-preceded. The patterns are now anchored to the start of the module path after an optional known prefix, which is the property that actually distinguishes them. Verified against 782 authentic FLUX and 1696 authentic SDXL keys: unchanged.Early DownsamplingOther Tensors, 22Final Output LayerOther Tensors2. Wrong loader for a model now warns instead of failing silently
Picking the wrong node was invisible: the keys still match — ComfyUI builds the key map from the model, so the LoRA loads — they just all land in one bucket, and the sliders quietly stop meaning what they say.
A mismatch check now fires when ≥90% of UNet tensors land in a single block, on both the
infooutput and the log. A threshold rather than "all of them", because cross-family names overlap slightly: real SDXL keys through the FLUX classifier leave 98.7% in the catch-all and send the rest to the sharedproj_outtoken, which exact equality would wave through.Measured against real key sets:
3. Import-order dependency in the shared registries
bobs_universalmutated four ofbobs_blocks's dicts at import time. Confirmed consequence: after that import, this line intests/test_bobs_blocks.pyraisesKeyError: 'UNIVERSAL':It passed only because the two test files happened to load
bobs_blocksunder different module names, so they got separate instances — luck, not design. Families now register through an explicitregister_family(), and the test drives offALL_BLOCKS.4–8. Smaller items
"Text Encoder";BLOCK_TOOLTIPS.update()meant the Universal wording overwrote the other. Tooltips are now stored per family.Output Headover-matching. The_head_substring also caughtmulti_head_attentionandhead_dim_proj. Now anchored to a real head module (head,head.head,out.<n>).Custom(only reachable from hand-edited workflow JSON).joint_blocks.-1.1.01bucket boundary guarding a fraction that cannot occur —depth_fractionmaxes at(n-0.5)/n._mismatch_warningwas keying offlen(grouped), which is dense in production but sparse in a unit test. It now uses itsblocksargument, which was otherwise unused.Testing
71 tests, up from 55, still with no ComfyUI or torch dependency. New
tests/test_node_behaviour.pycovers node registration, widget order, output signature, report formatting and the mismatch warning — including the exact 1674/22 distribution from finding 1, so the threshold can't silently regress to exact-equality.The real-ComfyUI integration harnesses were re-run: 8,000+ authentic keys across 11 architectures, still nothing falling through to
Other Tensors, and the node end-to-end run through a realModelPatcheris byte-identical (block isolation still exactly 384/1933).pyproject.tomlbumped to 1.2.1.Generated by Claude Code