22e7701411509813be4d3022f59e765d4b0ece38
The matched-shape branch computed torch.linalg.norm(tensor_a, dim=1) for every non-4-D tensor, including 1-D weights (e.g. x_pad_token, norm .weight). A 1-D tensor has no dim=1, so this raised 'Dimension out of range ... but got 1' and aborted the whole extraction. The code already skips 1-D tensors a few lines later, so bail out before the norm instead. Fixes #15
ComfyUI-ModelUtils
A collection of ComfyUI custom nodes for inspecting, modifying, merging, and creating model files. Supports Models, TextEncoders, LoRAs, Checkpoints, and Embeddings.
Features
- MetaKeys – Inspect and display metadata and tensor keys from model files
- RenameKeys – Batch rename tensor keys using pattern matching
- PruneKeys – Remove unwanted layers/keys from models
- Mergers – Combine 2 or 3 models with configurable blend modes and ratios
- LoRA Extraction – Extract LoRA adapters from model pairs using various SVD rank selection methods (Fixed, Ratio, Quantile, Knee-detection, Frobenius-norm)
Example Workflows
Acknowledgements
The LoRA extraction functionality was inspired by and references the excellent work from:
- kohya-ss/sd-scripts – Training scripts for Stable Diffusion
- KohakuBlueleaf/LyCORIS – Advanced LoRA techniques
- bmaltais/kohya_ss – Windows-friendly GUI for sd-scripts
License
See LICENSE for details.
Languages
Python
100%



