CivArchive
    ← All articles
    Published March 18, 2026by firemanbrakeneck

    Tool: Lora rescaling.

    121 views0 reactions1 comments on CivitAI2 collected
    scaleutilitytool guidetool

    Here is a small utility script for increasing or decreasing strength (or flipping positive and negative sides) of existing loras permanently whilst preserving metadata, because apparently existing tools don't make it very easy or possible. This should take less than a minute on a decent processor. Especially useful for customising sliders.

    Shoutout to @ghostpaint for informing me of this issue. See v1 vs v2 here for an example: https://civitai.com/models/2465845?modelVersionId=2778175

    import safetensors.torch
    from safetensors import safe_open
    # ===== CONFIGURATION =====
    INPUT_FILE = "your-input-file.safetensors"
    OUTPUT_FILE = "name-to-save.safetensors"
    FACTOR = 2.0
    # =========================
    print(f"Loading {INPUT_FILE}...")
    tensors = safetensors.torch.load_file(INPUT_FILE)
    with safe_open(INPUT_FILE, framework="pt") as f:
        metadata = f.metadata()
    print(f"Loaded {len(tensors)} tensors")
    print(f"Multiplying all weights by {FACTOR}...")
    multiplied = {k: v * FACTOR for k, v in tensors.items()}
    print(f"Saving to {OUTPUT_FILE}...")
    safetensors.torch.save_file(multiplied, OUTPUT_FILE, metadata=metadata)
    print("Done!")