mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat(autocomplete): standardize path separators and expand embedding detection
- Change path separators from backslashes to forward slashes in embedding autocomplete - Extend embedding detection to also trigger when searchType is 'embeddings' - Improves cross-platform compatibility and makes embedding autocomplete more reliable
This commit is contained in:
@@ -185,7 +185,7 @@ const MODEL_BEHAVIORS = {
|
||||
async getInsertText(_instance, relativePath) {
|
||||
const { directories, fileName } = splitRelativePath(relativePath);
|
||||
const trimmedName = removeGeneralExtension(fileName);
|
||||
const folder = directories.length ? `${directories.join('\\')}\\` : '';
|
||||
const folder = directories.length ? `${directories.join('/')}/` : '';
|
||||
return `embedding:${folder}${trimmedName}, `;
|
||||
},
|
||||
},
|
||||
@@ -225,10 +225,10 @@ const MODEL_BEHAVIORS = {
|
||||
const rawSearchTerm = instance.getSearchTerm(instance.inputElement.value);
|
||||
const match = rawSearchTerm.match(/^emb:(.*)$/i);
|
||||
|
||||
if (match) {
|
||||
if (match || instance.searchType === 'embeddings') {
|
||||
const { directories, fileName } = splitRelativePath(relativePath);
|
||||
const trimmedName = removeGeneralExtension(fileName);
|
||||
const folder = directories.length ? `${directories.join('\\')}\\` : '';
|
||||
const folder = directories.length ? `${directories.join('/')}/` : '';
|
||||
return `embedding:${folder}${trimmedName}, `;
|
||||
} else {
|
||||
return `${relativePath}, `;
|
||||
|
||||
Reference in New Issue
Block a user