mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 12:42:01 +00:00
## Summary When a workflow is loaded with missing models, users currently have no way to identify or resolve them from within the UI. This PR adds a full missing-model detection and resolution pipeline that surfaces missing models in the Errors tab, allowing users to install or import them without leaving the editor. ## Changes ### Missing Model Detection - Scan all COMBO widgets across root graph and subgraphs for model-like filenames during workflow load - Enrich candidates with embedded workflow metadata (url, hash, directory) when available - Verify asset-supported candidates against the asset store asynchronously to confirm installation status - Propagate missing model state to `executionErrorStore` alongside existing node/prompt errors ### Errors Tab UI — Model Resolution - Group missing models by directory (e.g. `checkpoints`, `loras`, `vae`) with collapsible category cards - Each model row displays: - Model name with copy-to-clipboard button - Expandable list of referencing nodes with locate-on-canvas button - **Library selector**: Pick an alternative from the user's existing models to substitute the missing model with one click - **URL import**: Paste a Civitai or HuggingFace URL to import a model directly; debounced metadata fetch shows filename and file size before confirming; type-mismatch warnings (e.g. importing a LoRA into checkpoints directory) are surfaced with an "Import Anyway" option - **Upgrade prompt**: In cloud environment, free-tier subscribers are shown an upgrade modal when attempting URL import - Separate "Import Not Supported" section for custom-node models that cannot be auto-resolved - Status card with live download progress, completion, failure, and category-mismatch states ### Canvas Integration - Highlight nodes and widgets that reference missing models with error indicators - Propagate missing-model badges through subgraph containers so issues are visible at every graph level ### Code Cleanup - Simplify `surfacePendingWarnings` in workflowService, remove stale widget-detected model merging logic - Add `flattenWorkflowNodes` utility to workflowSchema for traversing nested subgraph structures - Extract `MissingModelUrlInput`, `MissingModelLibrarySelect`, `MissingModelStatusCard` as focused single-responsibility components ## Testing - Unit tests for scan pipeline (`missingModelScan.test.ts`): enrichment, skip-installed, subgraph flattening - Unit tests for store (`missingModelStore.test.ts`): state management, removal helpers - Unit tests for interactions (`useMissingModelInteractions.test.ts`): combo select, URL input, import flow, library confirm - Component tests for `MissingModelCard` and error grouping (`useErrorGroups.test.ts`) - Updated `workflowService.test.ts` and `workflowSchema.test.ts` for new logic ## Review Focus - Missing model scan + enrichment pipeline in `missingModelScan.ts` - Interaction composable `useMissingModelInteractions.ts` — URL metadata fetch, library install, upload fallback - Store integration and canvas-level error propagation ## Screenshots https://github.com/user-attachments/assets/339a6d5b-93a3-43cd-98dd-0fb00681b66f ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-9743-feat-Surface-missing-models-in-Errors-tab-Cloud-3206d73d365081678326d3a16c2165d8) by [Unito](https://www.unito.io)
109 lines
3.4 KiB
Vue
109 lines
3.4 KiB
Vue
<template>
|
|
<div
|
|
aria-live="polite"
|
|
class="bg-foreground/5 relative mt-1 overflow-hidden rounded-lg border border-interface-stroke p-2"
|
|
>
|
|
<!-- Progress bar fill -->
|
|
<div
|
|
v-if="isDownloadActive"
|
|
class="absolute inset-y-0 left-0 bg-primary/10 transition-all duration-200 ease-linear"
|
|
:style="{ width: (downloadStatus?.progress ?? 0) * 100 + '%' }"
|
|
/>
|
|
|
|
<div class="relative z-10 flex items-center gap-2">
|
|
<div class="flex size-8 shrink-0 items-center justify-center">
|
|
<i
|
|
v-if="categoryMismatch"
|
|
aria-hidden="true"
|
|
class="mt-0.5 icon-[lucide--triangle-alert] size-5 text-warning-background"
|
|
/>
|
|
<i
|
|
v-else-if="downloadStatus?.status === 'failed'"
|
|
aria-hidden="true"
|
|
class="icon-[lucide--circle-alert] size-5 text-destructive-background"
|
|
/>
|
|
<i
|
|
v-else-if="downloadStatus?.status === 'completed'"
|
|
aria-hidden="true"
|
|
class="icon-[lucide--check-circle] size-5 text-success-background"
|
|
/>
|
|
<i
|
|
v-else-if="isDownloadActive"
|
|
aria-hidden="true"
|
|
class="icon-[lucide--loader-circle] size-5 animate-spin text-muted-foreground"
|
|
/>
|
|
<i
|
|
v-else
|
|
aria-hidden="true"
|
|
class="icon-[lucide--file-check] size-5 text-muted-foreground"
|
|
/>
|
|
</div>
|
|
|
|
<div class="flex min-w-0 flex-1 flex-col justify-center">
|
|
<span class="text-foreground truncate text-xs/tight font-medium">
|
|
{{ modelName }}
|
|
</span>
|
|
<span class="mt-0.5 text-xs/tight text-muted-foreground">
|
|
<template v-if="categoryMismatch">
|
|
{{
|
|
t('rightSidePanel.missingModels.alreadyExistsInCategory', {
|
|
category: categoryMismatch
|
|
})
|
|
}}
|
|
</template>
|
|
<template v-else-if="isDownloadActive">
|
|
{{ t('rightSidePanel.missingModels.importing') }}
|
|
{{ Math.round((downloadStatus?.progress ?? 0) * 100) }}%
|
|
</template>
|
|
<template v-else-if="downloadStatus?.status === 'completed'">
|
|
{{ t('rightSidePanel.missingModels.imported') }}
|
|
</template>
|
|
<template v-else-if="downloadStatus?.status === 'failed'">
|
|
{{
|
|
downloadStatus?.error ||
|
|
t('rightSidePanel.missingModels.importFailed')
|
|
}}
|
|
</template>
|
|
<template v-else>
|
|
{{ t('rightSidePanel.missingModels.usingFromLibrary') }}
|
|
</template>
|
|
</span>
|
|
</div>
|
|
|
|
<Button
|
|
variant="textonly"
|
|
size="icon-sm"
|
|
:aria-label="t('rightSidePanel.missingModels.cancelSelection')"
|
|
class="relative z-10 size-6 shrink-0 text-muted-foreground hover:text-base-foreground"
|
|
@click="emit('cancel')"
|
|
>
|
|
<i aria-hidden="true" class="icon-[lucide--circle-x] size-4" />
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useI18n } from 'vue-i18n'
|
|
import Button from '@/components/ui/button/Button.vue'
|
|
import type { AssetDownload } from '@/stores/assetDownloadStore'
|
|
|
|
const {
|
|
modelName,
|
|
isDownloadActive,
|
|
downloadStatus = null,
|
|
categoryMismatch = null
|
|
} = defineProps<{
|
|
modelName: string
|
|
isDownloadActive: boolean
|
|
downloadStatus?: AssetDownload | null
|
|
categoryMismatch?: string | null
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
cancel: []
|
|
}>()
|
|
|
|
const { t } = useI18n()
|
|
</script>
|