
LORA 파일에 메타 정보 및 LORA 가중치의 정량 분석을 검사하십시오.
safetensors 만 지원됩니다 (모든 LORA 파일을 지원하려면)이것은 진행중인 작업이며 생산 사용을위한 것이 아닙니다. 메모
GUI 표현을 위해 새로운 웹 인터페이스 LORA 검사관을 사용하는 것을 고려하십시오.
이 저장소를 복제하거나 Python 스크립트 파일을 다운로드하십시오.
의존성이 필요합니다.
torch
safetensors
tqdm
다음 중 하나를 설치할 수 있습니다.
venv (Virtual Environment)를 사용하십시오. 추천pip install safetensors tqdm (Pytorch 설치 방법에 대한 지침은 시작 참조) $ python lora-inspector.py --help
usage: lora-inspector.py [-h] [-s] [-w] [-t] [-d] lora_file_or_dir
positional arguments:
lora_file_or_dir Directory containing the lora files
options:
-h, --help show this help message and exit
-s, --save_meta Should we save the metadata to a file ?
-w, --weights Show the average magnitude and strength of the weights
-t, --tags Show the most common tags in the training set
-d, --dataset Show the dataset metadata including directory names and number of images디렉토리 나 파일을 추가 할 수 있습니다.
$ python lora-inspector.py /mnt/900/training/sets/landscape-2023-11-06-200718-e4d7120b -w
/mnt/900/training/sets/landscape-2023-11-06-200718-e4d7120b/landscape-2023-11-06-200718-e4d7120b-000015.safetensors
Date: 2023-11-06T20:16:34 Title: landscape
License: CreativeML Open RAIL-M Author: rockerBOO
Description: High quality landscape photos
Resolution: 512x512 Architecture: stable-diffusion-v1/lora
Network Dim/Rank: 16.0 Alpha: 8.0 Dropout: 0.3 dtype: torch.float32
Module: networks.lora : { ' block_dims ' : ' 4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 ' , ' block_alphas ' : ' 16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 ' , ' block_dropout ' : ' 0.01, 0.010620912260804992, 0.01248099020159499, 0.015572268683063176, 0.01988151037617019, 0.02539026244641935, 0.032074935571726845, 0.03990690495552037, 0.04885263290251277, 0.058873812432261884, 0.0699275313155418, 0.08196645583109653, 0.09493903345590124, 0.10878971362098, 0.12345918558747097, 0.13888463242431537, 0.155, 0.17173627983648962, 0.18902180461412393, 0.20678255506208312, 0.22494247692026895, 0.2434238066153228, 0.26214740425618505, 0.2810330925232585 ' , ' dropout ' : 0.3}
Learning Rate (LR): 2e-06 UNet LR: 1.0 TE LR: 1.0
Optimizer: prodigyopt.prodigy.Prodigy(weight_decay=0.1,betas=(0.9, 0.9999),d_coef=1.5,use_bias_correction=True)
Scheduler: cosine Warmup steps: 0
Epoch: 15 Batches per epoch: 57 Gradient accumulation steps: 24
Train images: 57 Regularization images: 0
Noise offset: 0.05 Adaptive noise scale: 0.01 IP noise gamma: 0.1 Multires noise discount: 0.3
Min SNR gamma: 5.0 Zero terminal SNR: True Debiased Estimation: True
UNet weight average magnitude: 0.7865518983141094
UNet weight average strength: 0.00995593195090544
No Text Encoder found in this LoRA
----------------------
/mnt/900/training/sets/landscape-2023-11-06-200718-e4d7120b/landscape-2023-11-06-200718-e4d7120b.safetensors
Date: 2023-11-06T20:27:12 Title: landscape
License: CreativeML Open RAIL-M Author: rockerBOO
Description: High quality landscape photos
Resolution: 512x512 Architecture: stable-diffusion-v1/lora
Network Dim/Rank: 16.0 Alpha: 8.0 Dropout: 0.3 dtype: torch.float32
Module: networks.lora : { ' block_dims ' : ' 4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 ' , ' block_alphas ' : ' 16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 ' , ' block_dropout ' : ' 0.01, 0.010620912260804992, 0.01248099020159499, 0.015572268683063176, 0.01988151037617019, 0.02539026244641935, 0.032074935571726845, 0.03990690495552037, 0.04885263290251277, 0.058873812432261884, 0.0699275313155418, 0.08196645583109653, 0.09493903345590124, 0.10878971362098, 0.12345918558747097, 0.13888463242431537, 0.155, 0.17173627983648962, 0.18902180461412393, 0.20678255506208312, 0.22494247692026895, 0.2434238066153228, 0.26214740425618505, 0.2810330925232585 ' , ' dropout ' : 0.3}
Learning Rate (LR): 2e-06 UNet LR: 1.0 TE LR: 1.0
Optimizer: prodigyopt.prodigy.Prodigy(weight_decay=0.1,betas=(0.9, 0.9999),d_coef=1.5,use_bias_correction=True)
Scheduler: cosine Warmup steps: 0
Epoch: 30 Batches per epoch: 57 Gradient accumulation steps: 24
Train images: 57 Regularization images: 0
Noise offset: 0.05 Adaptive noise scale: 0.01 IP noise gamma: 0.1 Multires noise discount: 0.3
Min SNR gamma: 5.0 Zero terminal SNR: True Debiased Estimation: True
UNet weight average magnitude: 0.8033398082829257
UNet weight average strength: 0.010114916750103732
No Text Encoder found in this LoRA
----------------------$ python lora-inspector.py /mnt/900/lora/testing/landscape-2023-11-06-200718-e4d7120b.safetensors
/mnt/900/lora/testing/landscape-2023-11-06-200718-e4d7120b.safetensors
Date: 2023-11-06T20:27:12 Title: landscape
License: CreativeML Open RAIL-M Author: rockerBOO
Description: High quality landscape photos
Resolution: 512x512 Architecture: stable-diffusion-v1/lora
Network Dim/Rank: 16.0 Alpha: 8.0 Dropout: 0.3 dtype: torch.float32
Module: networks.lora : { ' block_dims ' : ' 4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 ' , ' block_alphas ' : ' 16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32 ' , ' block_dropout ' : ' 0.01, 0.010620912260804992, 0.01248099020159499, 0.015572268683063176, 0.01988151037617019, 0.02539026244641935, 0.032074935571726845, 0.03990690495552037, 0.04885263290251277, 0.058873812432261884, 0.0699275313155418, 0.08196645583109653, 0.09493903345590124, 0.10878971362098, 0.12345918558747097, 0.13888463242431537, 0.155, 0.17173627983648962, 0.18902180461412393, 0.20678255506208312, 0.22494247692026895, 0.2434238066153228, 0.26214740425618505, 0.2810330925232585 ' , ' dropout ' : 0.3}
Learning Rate (LR): 2e-06 UNet LR: 1.0 TE LR: 1.0
Optimizer: prodigyopt.prodigy.Prodigy(weight_decay=0.1,betas=(0.9, 0.9999),d_coef=1.5,use_bias_correction=True)
Scheduler: cosine Warmup steps: 0
Epoch: 30 Batches per epoch: 57 Gradient accumulation steps: 24
Train images: 57 Regularization images: 0
Noise offset: 0.05 Adaptive noise scale: 0.01 IP noise gamma: 0.1 Multires noise discount: 0.3
Min SNR gamma: 5.0 Zero terminal SNR: True Debiased Estimation: True
UNet weight average magnitude: 0.8033398082829257
UNet weight average strength: 0.010114916750103732
No Text Encoder found in this LoRA
---------------------- 또한 문자열에서 추출되고 변환되는 메타 저장을 지원합니다. 그런 다음이를 JSON 파일로 저장할 수 있습니다. 여기에는 메타 데이터를 현재 작업 디렉토리의 meta/alorafile.safetensors-{session_id}.json 으로 저장합니다.
$ python lora-inspector.py ~ /loras/alorafile.safetensors --save_meta$ python lora-inspector.py /mnt/900/training/cyberpunk-anime-21-min-snr/unet-1.15-te-1.15-noise-0.1-steps--linear-DAdaptation-networks.lora/last.safetensors --save_meta
/mnt/900/training/cyberpunk-anime-21-min-snr/unet-1.15-te-1.15-noise-0.1-steps--linear-DAdaptation-networks.lora/last.safetensors
train images: 1005 regularization images: 32000
learning rate: 1.15 unet: 1.15 text encoder: 1.15
epoch: 1 batches: 2025
optimizer: dadaptation.dadapt_adam.DAdaptAdam lr scheduler: linear
network dim/rank: 8.0 alpha: 4.0 module: networks.lora
----------------------무게의 평균 크기와 평균 강도를 찾으십시오. 이것을 다른 로라와 비교하여 무게가 얼마나 강력하거나 강력하지 않은지 확인하십시오. 참고 가중치는 좋은 가치에 대해 결정적이지 않습니다. 그들은 초기 예입니다.
$ python lora-inspector.py /mnt/900/lora/studioGhibliStyle_offset.safetensors -w
UNet weight average magnitude: 4.299801171795097
UNet weight average strength: 0.01127891692482733
Text Encoder weight average magnitude: 3.128134997225176
Text Encoder weight average strength: 0.00769676965767913태그의 주파수 (쉼표로 분리 된 단어)를 보여줍니다. 트리거 단어는 일반적으로 전체 교육 데이터 세트에서 해당 단어를 사용하므로 가장 빈번합니다.
$ python lora-inspector.py -t /mnt/900/lora/booscapes.safetensors
...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Tags
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
4k photo” 23
spectacular mountains 17
award winning nature photo 16
ryan dyar 14
image credit nasa nat geo 11
sunset in a valley 11
garden 10
british columbia 10
dramatic autumn landscape 10
autumn mountains 10
an amazing landscape image 10
austria 9
nature scenery 9
pristine water 9
boreal forest 9
scenic view of river 9
alpes 9
mythical floral hills 8
misty environment 8
a photo of a lake on a sunny day 8
majestic beautiful world 8
breathtaking stars 8
lush valley 7
dramatic scenery 7
solar storm 7
siberia 7
cosmic skies 7
dolomites 7
oregon 6
landscape photography 4k 6
very long spires 6
beautiful forests and trees 6
wildscapes 6
mountain behind meadow 6
colorful wildflowers 6
photo of green river 6
beautiful night sky 6
switzerland 6
natural dynamic range color 6
middle earth 6
jessica rossier color scheme 6
arizona 6
enchanting and otherworldly 6
디렉토리 및 이미지 수와 함께 데이터 세트의 기본적인보기.
$ python lora-inspector.py -d /mnt/900/lora/booscapes.safetensors
Dataset dirs: 2
[source] 50 images
[p7] 4 images
Epoch : Epoch는 전체 데이터 세트를 한 번보고 있습니다
에포크 당 배치 : 각 에포크 당 배치 수 (그라디언트 축적 단계는 포함되지 않음)
그라디언트 축적 단계 : 구배 축적 단계
기차 이미지 : 당신이 가진 훈련 이미지 수
정규화 이미지 : 정규화 이미지 수
스케줄러 : 학습 속도 스케줄러 (Cosine, Cosine_with_restart, 선형, 상수,…)
Optimizer : The Optimizer (Adam, Prodigy, Dadaptation, Lion,…)
네트워크 Dim/Rank : LORA 네트워크의 순위
알파 : 로라 네트워크의 순위에 대한 알파
모듈 : 네트워크를 만든 파이썬 모듈
노이즈 오프셋 : 노이즈 오프셋 옵션
적응 소음 척도 : 적응 소음 척도
IP 노이즈 감마 : 입력 섭동 노이즈 감마 입력 섭동은 확산 모델의 노출 편향을 줄입니다.
… 우리는 추론 시간 예측 오류를 시뮬레이션하기 위해 지상 진실 샘플을 교란시키는 것으로 구성된 매우 간단하지만 효과적인 훈련 정규화를 제안합니다.
다중 노이즈 할인 : 다중 노이즈 소음 할인 (확산 모델 교육을위한 다중 해소 노이즈 참조)
다중 노이즈 스케일 : 다중 노이즈 스케일
평균 크기 : 각 무게를 제곱하고, 추가하고, 제곱근을 얻으십시오.
평균 강도 : 각 무게마다 ABS, 추가하고 평균을 얻으십시오.
토론 된 추정 손실 : Debias 확산 모델의 훈련
메타 데이터 값을 업데이트하는 간단한 스크립트. 이 값을 사용하여 좋은 이름을 설정하는 응용 프로그램의 ss_output_name 변경에 도움이됩니다.
현재 메타 데이터 값을 보려면 lora-inspector.py --save_meta ... 사용하여 메타 데이터를 저장하고 JSON 파일을 검사하십시오.
$ python update_metadata.py --help
usage: update_metadata.py [-h] [--key KEY] [--value VALUE] safetensors_file
positional arguments:
safetensors_file
options:
-h, --help show this help message and exit
--key KEY Key to change in the metadata
--value VALUE Value to set to the metadata
$ python update_metadata.py /mnt/900/lora/testing/armored-core-2023-08-02-173642-ddb4785e.safetensors --key ss_output_name --value mechBOO_v2
Updated ss_output_name with mechBOO_v2
Saved to /mnt/900/lora/testing/armored-core-2023-08-02-173642-ddb4785e.safetensors
--weights 추가하십시오. black 사용하여 포맷되었습니다.
또 무엇을보고 싶습니까? 문제 또는 PR을 만드십시오.
확장 할 수있는 사용 사례/아이디어 :