mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-09 18:36:33 +00:00
fix: preserve Krea2 text-fusion names in Kohya LoRAs (#2301)
This commit is contained in:
1 parent
cd5594e9f9
commit
b43ce4badd
1 file changed
+8
-3
@@ -1403,8 +1403,8 @@ std::string convert_pmid_v2_name(const std::string& name) {
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string convert_sep_to_dot(std::string name) {
|
||||
const std::vector<std::string> protected_tokens = {
|
||||
std::string convert_sep_to_dot(std::string name, SDVersion version) {
|
||||
std::vector<std::string> protected_tokens = {
|
||||
"self_attn",
|
||||
"out_proj",
|
||||
"q_proj",
|
||||
@@ -1480,6 +1480,11 @@ std::string convert_sep_to_dot(std::string name) {
|
||||
"output_proj",
|
||||
"token_refiner",
|
||||
};
|
||||
if (sd_version_is_krea2(version)) {
|
||||
protected_tokens.push_back("text_fusion");
|
||||
protected_tokens.push_back("layerwise_blocks");
|
||||
protected_tokens.push_back("refiner_blocks");
|
||||
}
|
||||
|
||||
// record the positions of underscores that should NOT be replaced
|
||||
std::unordered_set<size_t> protected_positions;
|
||||
@@ -1729,7 +1734,7 @@ std::string convert_tensor_name(std::string name, SDVersion version) {
|
||||
// LOG_VERBOSE("name %s %d", name.c_str(), version);
|
||||
|
||||
if (sd_version_is_unet(version) || is_underline || is_lycoris_underline) {
|
||||
name = convert_sep_to_dot(name);
|
||||
name = convert_sep_to_dot(name, version);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user