Skip to content

Commit aa44e06

Browse files
authored
fix: avoid crash with LoRAs and type override (leejet#974)
1 parent 6448430 commit aa44e06

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

stable-diffusion.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,14 @@ class StableDiffusionGGML {
336336

337337
if (sd_ctx_params->lora_apply_mode == LORA_APPLY_AUTO) {
338338
bool have_quantized_weight = false;
339-
for (const auto& [type, _] : wtype_stat) {
340-
if (ggml_is_quantized(type)) {
341-
have_quantized_weight = true;
342-
break;
339+
if (wtype != GGML_TYPE_COUNT && ggml_is_quantized(wtype)) {
340+
have_quantized_weight = true;
341+
} else {
342+
for (const auto& [type, _] : wtype_stat) {
343+
if (ggml_is_quantized(type)) {
344+
have_quantized_weight = true;
345+
break;
346+
}
343347
}
344348
}
345349
if (have_quantized_weight) {

0 commit comments

Comments
 (0)