Commit 56d95bf for stable-diffusion.cpp
commit 56d95bfa12a5ee6ef707ae56a9ae2ff09fca92af
Author: linzch3 <linzch3@outlook.com>
Date: Sun Nov 22 08:51:19 2026 -0500
fix: default asym_w4a8_int8 group_size to 16 like ComfyUI (#2388)
diff --git a/src/model_io/safetensors_io.cpp b/src/model_io/safetensors_io.cpp
index 0586062..29b94eb 100644
--- a/src/model_io/safetensors_io.cpp
+++ b/src/model_io/safetensors_io.cpp
@@ -147,6 +147,10 @@ static bool read_comfy_quant_config(std::ifstream& file,
config.convrot = true;
config.group_size = json.value("convrot_groupsize", 256);
}
+ if (config.format == "asym_w4a8_int8") {
+ // ComfyUI defaults the W4A8 weight group size to 16 when the key is missing.
+ config.weight_group_size = json.value("group_size", 16);
+ }
} catch (const std::exception&) {
set_error(error, "parsing ComfyUI quantization metadata tensor failed: '" + tensor_name + "'");
return false;