Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://github.com/kohya-ss/sd-scripts
- # merge loras with ratios -> resize
- # output files will appear next to input file
- # Config Start
- $inputs = @(
- @( "X:\SD\voldy\models\Lora\Wagashi928-v4.safetensors", 0.5),
- @( "X:\SD\voldy\models\Lora\EnvyCuteMix03.safetensors", 0.5),
- @( "X:\SD\voldy\models\Lora\santasunflower-000003.safetensors", 0.5)
- );
- $new_rank = 32
- # Config End
- Clear-Host
- $models = @($inputs | ForEach-Object {$_[0]})
- $ratios = @($inputs | ForEach-Object {[Math]::Pow($_[1],0.5)})
- Write-Host $models
- Write-Host $ratios
- $output_name = ($inputs | ForEach-Object { (Get-Item $_[0]).Basename + "_" + $_[1] }) -join "__"
- .\venv\Scripts\activate
- $model_saved = Join-Path -Path (Split-Path ($inputs[0][0])) -ChildPath "$($output_name).safetensors"
- Write-Host $model_saved
- python .\networks\svd_merge_lora.py `
- --save_to=$model_saved `
- --new_rank=$new_rank `
- --models $models `
- --ratios $ratios
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement