Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Apply LoRA during model conversion#709

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Green-Sky wants to merge1 commit intoleejet:master
base:master
Choose a base branch
Loading
fromGreen-Sky:lora_mergeing

Conversation

@Green-Sky
Copy link
Contributor

@Green-SkyGreen-Sky commentedJun 29, 2025
edited
Loading

Very rough code, but works.
Useful for avoiding the lora overhead during inference, or just mixing your own model from loras.

Patch based on (outdated)@stduhpf / bleedingedge :Green-Sky@69028c7

Keep in mind that the weights are first quantized, and then it tries to apply the loras. (which is very not ideal)

Example

merging lcm lora into a sd1.5 finetune:

$ result/bin/sd -M convert -m models/CyberRealistic_V9_FP16.safetensors --lora-model-dir models/loras/sd1/ -p "<lora:lcm-lora-sdv1-5:1>" -o models/CyberRealistic_V9-lcm-q8_0.gguf[INFO ] model.cpp:910  - load models/CyberRealistic_V9_FP16.safetensors using safetensors format[INFO ] model.cpp:2106 - lora lcm-lora-sdv1-5:1.00[INFO ] model.cpp:2121 - found at 'models/loras/sd1/lcm-lora-sdv1-5.safetensors'[INFO ] model.cpp:1987 - model tensors mem size: 2035.18MB  |==================================================| 1131/1131 - 500.00it/s[INFO ] model.cpp:2032 - load tensors done[INFO ] model.cpp:910  - load models/loras/sd1/lcm-lora-sdv1-5.safetensors using safetensors format[INFO ] lora.hpp:117  - loading LoRA from 'models/loras/sd1/lcm-lora-sdv1-5.safetensors'  |==================================================| 834/834 - 0.00it/s[INFO ] model.cpp:2047 - applied 'models/loras/sd1/lcm-lora-sdv1-5.safetensors':1.000000[INFO ] model.cpp:2052 - trying to save tensors to models/CyberRealistic_V9-lcm-q8_0.ggufconvert 'models/CyberRealistic_V9_FP16.safetensors'/'' to 'models/CyberRealistic_V9-lcm-q8_0.gguf' success

stduhpf, rmatif, and vmobilis reacted with thumbs up emoji
@Green-Sky
Copy link
ContributorAuthor

ggml switched to c++17, sd.cpp should too.

@Green-SkyGreen-Sky changed the titlemerge in loras during model conversionApply LoRA during model conversionJun 29, 2025
@Green-SkyGreen-Sky mentioned this pull requestOct 1, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@Green-Sky

[8]ページ先頭

©2009-2025 Movatter.jp