
ตรวจสอบไฟล์ LORA สำหรับข้อมูลเมตาและการวิเคราะห์เชิงปริมาณของน้ำหนัก LORA
safetensors เท่านั้น (ต้องการรองรับไฟล์ LORA ทั้งหมด)โปรดทราบว่า นี่เป็นงานที่อยู่ระหว่างดำเนินการและไม่ได้มีไว้สำหรับการใช้งานการผลิต บันทึก
พิจารณาใช้ Web Interface Lora Inspector ใหม่สำหรับการเป็นตัวแทน GUI
โคลน repo นี้หรือดาวน์โหลดไฟล์สคริปต์ Python
ต้องมีการพึ่งพา:
torch
safetensors
tqdm
สามารถติดตั้งได้อย่างใดอย่างหนึ่งต่อไปนี้:
venv ) ที่แนะนำ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
----------------------ค้นหาขนาดเฉลี่ยและความแข็งแรงเฉลี่ยของน้ำหนักของคุณ เปรียบเทียบสิ่งเหล่านี้กับ Loras อื่น ๆ เพื่อดูว่าน้ำหนักของคุณทรงพลังหรือไม่ทรงพลังเพียงใด น้ำหนัก หมายเหตุ ที่แสดงไม่ได้ข้อสรุปที่คุ้มค่า พวกเขาเป็นตัวอย่างเริ่มต้น
$ 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 กำลังเห็นชุดข้อมูลทั้งหมดหนึ่งครั้ง
แบทช์ต่อยุค: จำนวนแบทช์ต่อแต่ละยุค (ไม่รวมถึงขั้นตอนการสะสมการไล่ระดับสี)
ขั้นตอนการสะสมการไล่ระดับสี: ขั้นตอนการสะสมไล่ระดับสี
ภาพรถไฟ: จำนวนภาพการฝึกอบรมที่คุณมี
ภาพการทำให้เป็นมาตรฐาน: จำนวนภาพการทำให้เป็นมาตรฐาน
Scheduler: ตัวกำหนดตารางเวลาการเรียนรู้ (โคไซน์, COSINE_WITH_RESTART, เชิงเส้น, ค่าคงที่, …)
Optimizer: The Optimizer (Adam, Prodigy, Dadaptation, Lion, …)
เครือข่ายสลัว/อันดับ: อันดับของเครือข่าย LORA
อัลฟ่า: อัลฟ่าถึงอันดับของเครือข่าย Lora
โมดูล: โมดูล Python ที่สร้างเครือข่าย
ออฟเซ็ตเสียงรบกวน: ตัวเลือกออฟเซ็ตเสียงรบกวน
มาตราส่วนเสียงรบกวนแบบปรับตัว: สเกลสัญญาณรบกวนแบบปรับตัวได้
IP Noise Gamma: อินพุตการก่อกวนแกมม่าการก่อกวนการรบกวนช่วยลดอคติการเปิดรับแสงในแบบจำลองการแพร่กระจาย
…เราเสนอการฝึกอบรมที่ง่าย แต่มีประสิทธิภาพซึ่งประกอบด้วยการรบกวนตัวอย่างความจริงพื้นฐานเพื่อจำลองข้อผิดพลาดในการทำนายเวลาอนุมาน
ส่วนลดเสียงหลายเสียง: ส่วนลดเสียงรบกวนหลายเสียง (ดูเสียงรบกวนแบบหลายความละเอียดสำหรับการฝึกอบรมการแพร่กระจาย)
มาตราส่วนเสียงรบกวนหลายเสียง: หลายระดับเสียงรบกวน
ขนาดเฉลี่ย: สี่เหลี่ยมแต่ละน้ำหนักเพิ่มขึ้นรับสแควร์รูท
ความแข็งแรงเฉลี่ย: ABS แต่ละน้ำหนักเพิ่มขึ้นรับค่าเฉลี่ย
การสูญเสียการประมาณค่า debiased: 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 ซึ่งช่วยให้คุณเห็นขนาดและความแข็งแรงเฉลี่ยของน้ำหนัก Lora Unet และน้ำหนักตัวเข้ารหัสข้อความ จัดรูปแบบโดยใช้ black
คุณอยากเห็นอะไรอีก? สร้างปัญหาหรือการประชาสัมพันธ์
ใช้กรณี/แนวคิดที่สามารถขยายไปสู่: