8deb4fd739f43e7c145fc9dae408afc6d2ee2f2a
- MemoryEfficientSafeOpen now supports low_memory=True which disables mmap - Uses direct file reads with readinto() to avoid OS page caching - _deserialize_tensor avoids bytearray copy when input is already bytearray - merge_loras_to_model now uses low_memory=True for base model This should reduce peak RAM from 2x model size to 1x + overhead
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%



