def addnet_hash_legacy(b):
    """Old model hash used by sd-webui-additional-networks for .safetensors format files"""
    m = hashlib.sha256()

    b.seek(0x100000)
    m.update(b.read(0x10000))
    return m.hexdigest()[0:8]
Old model hash used by sd-webui-additional-networks for .safetensors format files
scripts/train_kohya/utils/lora_utils.py