Description
This line:
ComfyUI-Custom-Scripts/web/js/modelInfo.js
Line 371 in aac13aa
Is incorrect. It assumes that the "." represents a nested object and doesn't work correctly with the text in the default setting:
["CheckpointLoader.ckpt_name", "CheckpointLoaderSimple", "CheckpointLoader|pysssss", "Efficient Loader", "Eff. Loader SDXL"].join(",")
When parsed it results in an array like so:
{"CheckpointLoader":{"ckpt_name":true},"CheckpointLoaderSimple":{"":true},"CheckpointLoader|pysssss":{"":true},"Efficient Loader":{"":true},"Eff":{" Loader SDXL":true}}
Which fails matching the "Eff. Loader SDXL" and the menu is not created. Example of a suggested fix is to check if there a space immediately after the dot, and if there is, assume it is not a nested object.
lookups[type] = value.split(",").reduce((p, n) => {
n = n.trim();
const pos = n.indexOf(".");
// Determine if the string should be split based on the dot.
// Split only if a dot exists AND the part after the dot contains no spaces.
// This is a heuristic based on the observed data like "Eff. Loader SDXL".
const shouldSplit = pos !== -1 && n.substring(pos + 1).indexOf(" ") === -1;
let mainKey;
let nestedKey;
if (shouldSplit) {
mainKey = n.substring(0, pos);
nestedKey = n.substring(pos + 1);
} else {
// If not splitting, the entire string is the main key
mainKey = n;
// Use an empty string as the nested key for items without a clear nested part
nestedKey = "";
}
// Ensure the main key exists as an object
p[mainKey] ??= {};
// Set the nested key within the main key's object
p[mainKey][nestedKey] = true;
return p;
}, {}); // Added initial value for reduce as an empty object