From a50ceaad31d74c3298408088cc604c16cfbf31c7 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 29 Nov 2026 06:15:02 -0800 Subject: [PATCH] FLUX.3 LoRA: keep underscores in FLUX.3 module names when converting underscore-style tensor names convert_sep_to_dot turned content_mode_blocks, txt_mode_blocks, image_cond, attn_out, mlp_in and mlp_out into dotted paths, so kohya-style FLUX.3 LoRAs (lora_unet_*) only matched the single_blocks q/k/v projections (252 of 774 tensors). Protect these tokens for FLUX.3 only. Port of upstream leejet/stable-diffusion.cpp#2462. --- src/name_conversion.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/name_conversion.cpp b/src/name_conversion.cpp index 79179f64a9..c18f324b84 100644 --- a/src/name_conversion.cpp +++ b/src/name_conversion.cpp @@ -1485,6 +1485,12 @@ std::string convert_sep_to_dot(std::string name, SDVersion version) { protected_tokens.push_back("layerwise_blocks"); protected_tokens.push_back("refiner_blocks"); } + if (sd_version_is_flux3(version)) { + for (const char* token : {"content_mode_blocks", "txt_mode_blocks", "image_cond", + "attn_out", "mlp_in", "mlp_out"}) { + protected_tokens.push_back(token); + } + } // record the positions of underscores that should NOT be replaced std::unordered_set protected_positions;