Skip to content

Commit 32c639e

Browse files
committedFeb 6, 2025
Lora: better clip lora support for Flux
1 parent 0065fa6 commit 32c639e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎lora.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ struct LoraModel : public GGMLRunner {
197197
blk_name.replace(blk_name.find(".joint_blocks"), sizeof(".joint_blocks") - 1, ".transformer_blocks");
198198
}
199199

200+
if (blk_name.find("text_encoders.clip_l") != std::string::npos) {
201+
blk_name.replace(blk_name.find("text_encoders.clip_l"), sizeof("text_encoders.clip_l") - 1, "cond_stage_model");
202+
}
203+
200204
for (const auto& item : alt_names) {
201205
size_t match = blk_name.find(item.first);
202206
if (match != std::string::npos) {
@@ -217,8 +221,8 @@ struct LoraModel : public GGMLRunner {
217221
keys.push_back(split_blk);
218222
}
219223
}
224+
keys.push_back(blk_name);
220225
}
221-
keys.push_back(blk_name);
222226

223227
std::vector<std::string> ret;
224228
for (std::string& key : keys) {

0 commit comments

Comments
 (0)
Failed to load comments.