CivArchive
    LoRA and Checkpoint Metadata Remover and Name Changer - Metadata Remover / Rename
    Preview 134025909

    How to Use

    This Python script removes metadata from .safetensors files (commonly used for LoRAs, embeddings, and other Stable Diffusion / AI model files) and saves clean copies to a separate folder. It is especially useful for cleaning LoRAs before sharing them or rename them (just rename the original .safetensors file and run the script).


    1. Prerequisites

    • Python 3.8 or higher installed.

    • The safetensors library installed.

    Install the required package (run in your terminal / command prompt):

    Bash

    pip install safetensors torch

    Note: You only need torch if it's not already installed, safetensors is the main dependency.


    2. Prepare the Script

    1. Unzip and save the provided script as metadata_remover_and_rename.py (it is already attached in this conversation).

    2. Edit the folder paths at the top of the file.

    Open the file in any text editor (Notepad, VS Code, etc.) and update these two lines:

    Python

    # Folder containing the .safetensors files (This is where your Loras are)
    input_folder = r"XXXXX"   # ← Change this
    
    # Folder for the cleaned files
    output_folder = r"ZZZZZ"  # ← Change this

    Example (Windows):

    Python

    input_folder = r"C:\Users\YourName\Downloads\MyLoRAs"
    output_folder = r"C:\Users\YourName\Downloads\Cleaned_LoRAs"

    Example (macOS / Linux):

    Python

    input_folder = r"/Users/YourName/Downloads/MyLoRAs"
    output_folder = r"/Users/YourName/Downloads/Cleaned_LoRAs"
    • Use r"..." (raw string) to avoid issues with backslashes on Windows.

    • The script will create the output folder automatically if it doesn't exist.


    3. How to Run the Script

    Option A: Run from Terminal / Command Prompt (Recommended)

    1. Open a terminal / command prompt.

    2. Navigate to the folder where the script is saved:

    Bash

    cd path/to/your/script/folder
    1. Run the script:

    Bash

    python metadata_remover_and_rename.py

    or

    Bash

    python3 metadata_remover_and_rename.py

    Option B: Run from an IDE (VS Code, PyCharm, etc.)

    • Open the file and click the "Run" button (or press F5 in many editors).


    4. What to Expect

    • The script will process only .safetensors files in the input_folder.

    • For each file it will:

      • Load the model weights.

      • Save a new copy in the output_folder without any metadata.

    • You will see console output like:

    text

    Metadata removed: my_lora.safetensors
    Metadata removed: another_model.safetensors
    All files have been processed.
    • Original files are not modified — they remain in the input folder.


    5. Optional Improvements

    Process subfolders recursively

    This requires a small change (ask if you need help).

    Add metadata (e.g., add your name or license)

    Change the save line to:

    Python

    save_file(tensors, output_path, metadata={"author": "YourName", "license": "CC-BY-NC"})

    6. Troubleshooting

    ModuleNotFoundError: No module named 'safetensors'

    Run pip install safetensors

    Permission errors

    Run terminal as Administrator or use paths you have write access to

    Script does nothing

    Make sure input_folder contains .safetensors files and paths are correct

    Large files take time

    This is normal — big LoRAs can take several seconds each


    7. Safety Notes

    • This script removes all metadata (author, trigger words, version info, etc.). Make sure you keep a backup of the original files if you need that information.

    • Always test a cleaned LoRA in your favorite UI (Forge,Automatic1111, ComfyUI, etc.) to ensure it still works.

    Description

    Other
    Other

    Looks like we don't have an active mirror for this file right now.

    CivArchive is a community-maintained index — we catalog mirrors that volunteers upload to HuggingFace, torrents, and other public hosts. Looks like no one has uploaded a copy of this file yet.

    Some files do get recovered over time through contributions. If you're looking for this one, feel free to ask in Discord, or help preserve it if you have a copy.

    Details

    Downloads
    2
    Platform
    CivitAI
    Platform Status
    Deleted
    Created
    6/17/2026
    Updated
    6/23/2026
    Deleted
    6/22/2026

    Files

    loraAndCheckpoint_metadataRemover.zip

    Mirrors