ACCC1380 commited on
Commit
4e39436
1 Parent(s): 645de99

Upload lora-scripts/interrogate.ps1 with huggingface_hub

Browse files
Files changed (1) hide show
  1. lora-scripts/interrogate.ps1 +29 -0
lora-scripts/interrogate.ps1 ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LoRA interrogate script by @bdsqlsz
2
+
3
+ $v2 = 0 # load Stable Diffusion v2.x model / Stable Diffusion 2.x模型读取
4
+ $sd_model = "./sd-models/sd_model.safetensors" # Stable Diffusion model to load: ckpt or safetensors file | 读取的基础SD模型, 保存格式 cpkt 或 safetensors
5
+ $model = "./output/LoRA.safetensors" # LoRA model to interrogate: ckpt or safetensors file | 需要调查关键字的LORA模型, 保存格式 cpkt 或 safetensors
6
+ $batch_size = 64 # batch size for processing with Text Encoder | 使用 Text Encoder 处理时的批量大小,默认16,推荐64/128
7
+ $clip_skip = 1 # use output of nth layer from back of text encoder (n>=1) | 使用文本编码器倒数第 n 层的输出,n 可以是大于等于 1 的整数
8
+
9
+
10
+ # Activate python venv
11
+ .\venv\Scripts\activate
12
+
13
+ $Env:HF_HOME = "huggingface"
14
+ $ext_args = [System.Collections.ArrayList]::new()
15
+
16
+ if ($v2) {
17
+ [void]$ext_args.Add("--v2")
18
+ }
19
+
20
+ # run interrogate
21
+ accelerate launch --num_cpu_threads_per_process=8 "./sd-scripts/networks/lora_interrogator.py" `
22
+ --sd_model=$sd_model `
23
+ --model=$model `
24
+ --batch_size=$batch_size `
25
+ --clip_skip=$clip_skip `
26
+ $ext_args
27
+
28
+ Write-Output "Interrogate finished"
29
+ Read-Host | Out-Null ;