Skip to content

Commit 19d40d0

Browse files
committed
fix tensors name
1 parent 10c6501 commit 19d40d0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

model.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ std::unordered_map<std::string, std::string> pmid_v2_name_map = {
175175
};
176176

177177
std::string convert_open_clip_to_hf_clip(const std::string& name) {
178+
// Specific fix for ComfyUI-style SDXL CLIP-G text projection name
179+
// Check this *before* any other modifications
180+
if (name == "conditioner.embedders.1.model.text_projection.weight") {
181+
return "cond_stage_model.1.transformer.text_model.text_projection";
182+
}
183+
178184
std::string new_name = name;
179185
std::string prefix;
180186
if (starts_with(new_name, "conditioner.embedders.0.open_clip.")) {
@@ -185,7 +191,7 @@ std::string convert_open_clip_to_hf_clip(const std::string& name) {
185191
new_name = new_name.substr(strlen("conditioner.embedders.0."));
186192
} else if (starts_with(new_name, "conditioner.embedders.1.")) {
187193
prefix = "cond_stage_model.1.";
188-
new_name = new_name.substr(strlen("conditioner.embedders.0."));
194+
new_name = new_name.substr(strlen("conditioner.embedders.1.")); // Fix bug: use correct length for prefix 1
189195
} else if (starts_with(new_name, "cond_stage_model.")) {
190196
prefix = "cond_stage_model.";
191197
new_name = new_name.substr(strlen("cond_stage_model."));

0 commit comments

Comments
 (0)