diff --git a/otherarch/sdcpp/name_conversion.cpp b/otherarch/sdcpp/name_conversion.cpp index 6a8ae72c0..359a0a6a0 100644 --- a/otherarch/sdcpp/name_conversion.cpp +++ b/otherarch/sdcpp/name_conversion.cpp @@ -1037,6 +1037,16 @@ std::string convert_tensor_name(std::string name, SDVersion version) { if (sd_version_is_unet(version) || sd_version_is_flux(version) || is_lycoris_underline) { name = convert_sep_to_dot(name); } + + //kcpp hack: name surgery for qwen image, https://github.com/leejet/stable-diffusion.cpp/issues/1131 + const std::string badprefix = "unet_transformer_blocks_"; + const std::string goodprefix = "lora.model.diffusion_model.transformer_blocks."; + if(is_lora && sd_version_is_qwen_image(version) && starts_with(name,badprefix)) + { + name = goodprefix + name.substr(badprefix.size()); + name = convert_sep_to_dot(name); + } + return name; } std::unordered_map prefix_map = {