mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
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:
committed by
GitHub
parent
3b5c9762a4
commit
25696ffe03
@@ -85,7 +85,6 @@ const whiteListedUrls = new Set([
|
|||||||
interface ModelInfo {
|
interface ModelInfo {
|
||||||
name: string
|
name: string
|
||||||
directory: string
|
directory: string
|
||||||
directory_invalid?: boolean
|
|
||||||
url: string
|
url: string
|
||||||
downloading?: boolean
|
downloading?: boolean
|
||||||
completed?: boolean
|
completed?: boolean
|
||||||
@@ -112,7 +111,7 @@ const modelDownloads = ref<Record<string, ModelInfo>>({})
|
|||||||
const missingModels = computed(() => {
|
const missingModels = computed(() => {
|
||||||
return props.missingModels.map((model) => {
|
return props.missingModels.map((model) => {
|
||||||
const paths = props.paths[model.directory]
|
const paths = props.paths[model.directory]
|
||||||
if (model.directory_invalid || !paths) {
|
if (!paths) {
|
||||||
return {
|
return {
|
||||||
label: `${model.directory} / ${model.name}`,
|
label: `${model.directory} / ${model.name}`,
|
||||||
url: model.url,
|
url: model.url,
|
||||||
|
|||||||
@@ -1215,10 +1215,6 @@ export class ComfyApp {
|
|||||||
await modelStore.loadModelFolders()
|
await modelStore.loadModelFolders()
|
||||||
for (const m of uniqueModels) {
|
for (const m of uniqueModels) {
|
||||||
const modelFolder = await modelStore.getLoadedModelFolder(m.directory)
|
const modelFolder = await modelStore.getLoadedModelFolder(m.directory)
|
||||||
if (!modelFolder)
|
|
||||||
(m as ModelFile & { directory_invalid?: boolean }).directory_invalid =
|
|
||||||
true
|
|
||||||
|
|
||||||
const modelsAvailable = modelFolder?.models
|
const modelsAvailable = modelFolder?.models
|
||||||
const modelExists =
|
const modelExists =
|
||||||
modelsAvailable &&
|
modelsAvailable &&
|
||||||
|
|||||||
Reference in New Issue
Block a user