fix: remove false 'invalid directory' errors when asset API is enabled (#8961)

## Summary
- When `Comfy.Assets.UseAssetAPI` is enabled, `getAssetModelFolders()`
only discovers folders containing assets. Empty folders (e.g.
`text_encoders`, `vae`) were falsely flagged as invalid, showing
"Invalid directory specified" on every missing model dialog.
- Removes the `directory_invalid` concept entirely — the existing
`!paths` check via `getFolderPaths()` already correctly validates all
registered directories including empty ones, making `directory_invalid`
redundant.

## Before
<img width="1841" height="954" alt="Screenshot 2026-02-18 at 21 09 55"
src="https://github.com/user-attachments/assets/09cf4f28-5175-4ff6-aa9d-916568c6d9b3"
/>


## After
<img width="1134" height="738" alt="Screenshot 2026-02-18 at 21 23 29"
src="https://github.com/user-attachments/assets/578d2fa5-3fb8-401a-beee-0fd74667f08b"
/>

## Test plan
- [ ] Enable `Comfy.Assets.UseAssetAPI` setting
- [ ] Open a template referencing models in empty folders (e.g. "Image
Editing (New)")
- [ ] Verify the missing models dialog shows download buttons instead of
"Invalid directory specified" error
- [ ] Disable `Comfy.Assets.UseAssetAPI` and verify behavior is
unchanged

Fixes #8583
This commit is contained in:
Johnpaul Chiwetelu
2026-02-20 05:51:21 +01:00
committed by GitHub
parent 3b5c9762a4
commit 25696ffe03
2 changed files with 1 additions and 6 deletions

View File

@@ -85,7 +85,6 @@ const whiteListedUrls = new Set([
interface ModelInfo {
name: string
directory: string
directory_invalid?: boolean
url: string
downloading?: boolean
completed?: boolean
@@ -112,7 +111,7 @@ const modelDownloads = ref<Record<string, ModelInfo>>({})
const missingModels = computed(() => {
return props.missingModels.map((model) => {
const paths = props.paths[model.directory]
if (model.directory_invalid || !paths) {
if (!paths) {
return {
label: `${model.directory} / ${model.name}`,
url: model.url,

View File

@@ -1215,10 +1215,6 @@ export class ComfyApp {
await modelStore.loadModelFolders()
for (const m of uniqueModels) {
const modelFolder = await modelStore.getLoadedModelFolder(m.directory)
if (!modelFolder)
(m as ModelFile & { directory_invalid?: boolean }).directory_invalid =
true
const modelsAvailable = modelFolder?.models
const modelExists =
modelsAvailable &&