Compare commits

...

1 Commits

Author SHA1 Message Date
Deep Mehta
2c8af73448 fix: prevent asset browser from hijacking HF-download node dropdowns
Two fixes for CogVideoXWrapper model selection:

1. Use empty key for HF-download node registrations
   (DownloadAndLoadCogVideoControlNet, DownloadAndLoadCogVideoModel)
   so shouldUseAssetBrowser returns false. These nodes use HuggingFace
   repo names, not file-based assets — the asset browser finds nothing
   and shows an empty dropdown.

2. Fix findProvidersWithFallback to try all intermediate path levels
   (a/b/c → a/b → a) instead of jumping to top-level only. This
   ensures clicking "Use" on a CogVideo/ControlNet/* model creates
   DownloadAndLoadCogVideoControlNet (not DownloadAndLoadCogVideoModel).
2026-03-17 21:02:46 -07:00

View File

@@ -75,8 +75,8 @@ export const useModelToNodeStore = defineStore('modelToNode', () => {
/**
* Find providers for modelType with hierarchical fallback.
* Tries exact match first, then falls back to top-level segment (e.g., "parent/child" → "parent").
* Note: Only falls back one level; "a/b/c" tries "a/b/c" then "a", not "a/b".
* Tries exact match first, then progressively shorter parent paths.
* e.g., "a/b/c" tries "a/b/c" → "a/b" → "a".
*/
function findProvidersWithFallback(
modelType: string
@@ -88,12 +88,13 @@ export const useModelToNodeStore = defineStore('modelToNode', () => {
const exactMatch = modelToNodeMap.value[modelType]
if (exactMatch && exactMatch.length > 0) return exactMatch
const topLevel = modelType.split('/')[0]
if (topLevel === modelType) return undefined
const fallback = modelToNodeMap.value[topLevel]
if (fallback && fallback.length > 0) return fallback
// Try progressively shorter parent paths
const segments = modelType.split('/')
for (let i = segments.length - 1; i >= 1; i--) {
const parentPath = segments.slice(0, i).join('/')
const fallback = modelToNodeMap.value[parentPath]
if (fallback && fallback.length > 0) return fallback
}
return undefined
}
@@ -361,10 +362,11 @@ export const useModelToNodeStore = defineStore('modelToNode', () => {
// CogVideoX models (comfyui-cogvideoxwrapper)
quickRegister('CogVideo/GGUF', 'DownloadAndLoadCogVideoGGUFModel', 'model')
// Empty key: HF-download node — don't activate asset browser for the combo widget
quickRegister(
'CogVideo/ControlNet',
'DownloadAndLoadCogVideoControlNet',
'model'
''
)
// DynamiCrafter models (ComfyUI-DynamiCrafterWrapper)
@@ -386,7 +388,8 @@ export const useModelToNodeStore = defineStore('modelToNode', () => {
quickRegister('lama', 'LaMa', 'lama_model')
// CogVideoX video generation models (comfyui-cogvideoxwrapper)
quickRegister('CogVideo', 'DownloadAndLoadCogVideoModel', 'model')
// Empty key: HF-download node — don't activate asset browser for the combo widget
quickRegister('CogVideo', 'DownloadAndLoadCogVideoModel', '')
// Inpaint models (comfyui-inpaint-nodes)
quickRegister('inpaint', 'INPAINT_LoadInpaintModel', 'model_name')