Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use **kwargs and change svd() calling convention to make svd() reusable #936

Merged
merged 2 commits into from
Nov 25, 2023

Conversation

wkpark
Copy link
Contributor

@wkpark wkpark commented Nov 8, 2023

use **kwargs and change svd() calling convention to make svd() reusable

(venv) F:\webui\webui\sd-scripts>python networks\extract_lora_from_models.py --model_org ..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors --model_tuned ..\stable-diffusion-webui\models\Stable-diffusion\py0fp16.safetensors --save_to xx.safetensors --device cuda --min_diff 0.0001
loading original SD model : ..\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
UNet2DConditionModel: 64, 8, 768, False, False
loading u-net: <All keys matched successfully>
loading vae: <All keys matched successfully>
loading text encoder: <All keys matched successfully>
loading tuned SD model : ..\stable-diffusion-webui\models\Stable-diffusion\py0fp16.safetensors
UNet2DConditionModel: 64, 8, 768, False, False
loading u-net: <All keys matched successfully>
loading vae: <All keys matched successfully>
loading text encoder: <All keys matched successfully>
create LoRA network. base dim (rank): 4, alpha: 4
neuron dropout: p=None, rank dropout: p=None, module dropout: p=None
create LoRA for Text Encoder:
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
create LoRA network. base dim (rank): 4, alpha: 4
neuron dropout: p=None, rank dropout: p=None, module dropout: p=None
create LoRA for Text Encoder:
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
Text encoder is different. 0.0001220703125 > 0.0001
calculating by svd
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 264/264 [00:28<00:00,  9.12it/s]
create LoRA network from weights
create LoRA for Text Encoder:
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
enable LoRA for text encoder
enable LoRA for U-Net
Loading extracted LoRA weights: <All keys matched successfully>
LoRA weights are saved to: xx.safetensors

@wkpark wkpark changed the base branch from main to dev November 8, 2023 10:19
 * add required attributes to model_org, model_tuned, save_to
 * set "*_alpha" using str(float(foo))
@kohya-ss kohya-ss merged commit 9795840 into kohya-ss:dev Nov 25, 2023
1 check passed
@kohya-ss
Copy link
Owner

Thank you for this! Sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants