[bugfix] Filter model metadata by current widget selection (#4021)

Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
This commit is contained in:
Christian Byrne
2025-05-31 19:43:00 -07:00
committed by GitHub
parent 6289ac9182
commit b81c2f7cd2
5 changed files with 377 additions and 4 deletions

View File

@@ -62,6 +62,7 @@ import {
findLegacyRerouteNodes,
noNativeReroutes
} from '@/utils/migration/migrateReroute'
import { getSelectedModelsMetadata } from '@/utils/modelMetadataUtil'
import { deserialiseAndCreate } from '@/utils/vintageClipboard'
import { type ComfyApi, PromptExecutionError, api } from './api'
@@ -1026,8 +1027,10 @@ export class ComfyApp {
}
// Collect models metadata from node
if (n.properties?.models?.length)
embeddedModels.push(...n.properties.models)
const selectedModels = getSelectedModelsMetadata(n)
if (selectedModels?.length) {
embeddedModels.push(...selectedModels)
}
}
// Merge models from the workflow's root-level 'models' field