Compare commits

...

6 Commits

Author SHA1 Message Date
Yourz
4afa9c9537 fix: update for coderabbitai 2026-04-15 21:21:13 +08:00
Yourz
e941556d4a feat: extract productCardsSection: 2026-04-15 21:14:49 +08:00
Yourz
639b598613 fix: update for coderabbitai, and make FAQ component props as translate key 2026-04-15 21:14:49 +08:00
Yourz
e019a0754a feat(website): implement download/local page
- Add HeroSection, CloudBannerSection, ReasonSection, EcoSystemSection,
  ProductCardsSection, FAQSection components
- Add ProductHeroBadge with two-size node badge variant
- Extend NodeBadge with per-segment class and configurable union icon
- Add useDownloadUrl composable for OS-aware download links
- Add all en/zh-CN translations for the download page
- Replace zh-CN hardcoded download page with shared components
- Add icon-mask utility for CSS mask-based icons
- Add Playwright e2e tests (smoke, interaction, mobile)
- FAQ uses independent expand/collapse (all open by default)
- Sticky headings in ReasonSection and FAQSection on all viewports
2026-04-15 21:14:49 +08:00
pythongosssss
06686a1f50 test: App mode - additional app mode coverage (#11194)
## Summary

Adds additional test coverage for empty state/welcome screen/connect
outputs/vue nodes auto switch

## Changes

- **What**: 
- add tests

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11194-test-App-mode-additional-app-mode-coverage-3416d73d365081ca91d0ed61de19f840)
by [Unito](https://www.unito.io)
2026-04-15 11:42:22 +00:00
jaeone94
693b8383d6 fix: missing-asset correctness follow-ups from #10856 (#11233)
Follow-up to #10856. Four correctness issues and their regression tests.

## Bugs fixed

### 1. ErrorOverlay model count reflected node selection

`useErrorGroups` exposed `filteredMissingModelGroups` under the public
name `missingModelGroups`. `ErrorOverlay.vue` read that alias to compute
its model count label, so selecting a node shrank the overlay total. The
overlay must always show the whole workflow's errors.

Exposed both shapes explicitly: `missingModelGroups` /
`missingMediaGroups` (unfiltered totals) and
`filteredMissingModelGroups` / `filteredMissingMediaGroups`
(selection-scoped). `TabErrors.vue` destructures the filtered variant
with an alias.


Before 


https://github.com/user-attachments/assets/eb848c5f-d092-4a4f-b86f-d22bb4408003

After 


https://github.com/user-attachments/assets/75e67819-c9f2-45ec-9241-74023eca6120



### 2. Bypass → un-bypass dropped url/hash metadata

Realtime `scanNodeModelCandidates` only reads widget values, so
un-bypass produced a fresh candidate without the url that
`enrichWithEmbeddedMetadata` had previously attached from
`graphData.models`. `MissingModelRow`'s download/copy-url buttons
disappeared after a bypass/un-bypass cycle.

Added `enrichCandidateFromNodeProperties` that copies
`url`/`hash`/`directory` from the node's own `properties.models` — which
persists across mode toggles — into each scanned candidate. Applied to
every call site of the per-node scan. A later fix in the same branch
also enforces directory agreement to prevent a same-name /
different-directory collision from stamping the wrong metadata.

Before 


https://github.com/user-attachments/assets/39039d83-4d55-41a9-9d01-dec40843741b

After 


https://github.com/user-attachments/assets/047a603b-fb52-4320-886d-dfeed457d833



### 3. Initial full scan surfaced interior errors of a muted/bypassed
subgraph container

`scanAllModelCandidates`, `scanAllMediaCandidates`, and the JSON-based
missing-node scan only check each node's own mode. Interior nodes whose
parent container was bypassed passed the filter.

Added `isAncestorPathActive(rootGraph, executionId)` to
`graphTraversalUtil` and post-filter the three pipelines in `app.ts`
after the live rootGraph is configured. The filter uses the execution-ID
path (`"65:63"` → check node 65's mode) so it handles both
live-scan-produced and JSON-enrichment-produced candidates.

Before


https://github.com/user-attachments/assets/3032d46b-81cd-420e-ab8e-f58392267602

After 


https://github.com/user-attachments/assets/02a01931-951d-4a48-986c-06424044fbf8




### 4. Bypassed subgraph entry re-surfaced interior errors

`useGraphNodeManager` replays `graph.onNodeAdded` for each existing
interior node when the Vue node manager initializes on subgraph entry.
That chain reached `scanSingleNodeErrors` via
`installErrorClearingHooks`' `onNodeAdded` override. Each interior
node's own mode was active, so the caller guards passed and the scan
re-introduced the error that the initial pipeline had correctly
suppressed.

Added an ancestor-activity gate at the top of `scanSingleNodeErrors`,
the single entry point shared by paste, un-bypass, subgraph entry, and
subgraph container activation. A later commit also hardens this guard
against detached nodes (null execution ID → skip) and applies the same
ancestor check to `isCandidateStillActive` in the realtime verification
callback.

Before


https://github.com/user-attachments/assets/fe44862d-f1d6-41ed-982d-614a7e83d441

After


https://github.com/user-attachments/assets/497a76ce-3caa-479f-9024-4cd0f7bd20a4



## Tests

- 6 unit tests for `isAncestorPathActive` (root, active,
immediate-bypass, deep-nested mute, unresolvable ancestor, null
rootGraph)
- 4 unit tests for `enrichCandidateFromNodeProperties` (enrichment,
no-overwrite, name mismatch, directory mismatch)
- 1 unit test for `scanSingleNodeErrors` ancestor guard (subgraph entry
replaying onNodeAdded)
- 2 unit tests for `useErrorGroups` dual export + ErrorOverlay contract
- 4 E2E tests:
- ErrorOverlay model count stays constant when a node is selected (new
fixture `missing_models_distinct.json`)
- Bypass/un-bypass cycle preserves Copy URL button (uses
`missing_models_from_node_properties`)
- Loading a workflow with bypassed subgraph suppresses interior missing
model error (new fixture `missing_models_in_bypassed_subgraph.json`)
- Entering a bypassed subgraph does not resurface interior missing model
error (shares the above fixture)

`pnpm typecheck`, `pnpm lint`, 206 related unit tests passing.

## Follow-up

Several items raised by code review are deferred as pre-existing tech
debt or scope-avoided refactors. Tracked via comments on #11215 and
#11216.

---
Follows up on #10856.
2026-04-15 10:58:24 +00:00
50 changed files with 2579 additions and 163 deletions

View File

@@ -0,0 +1,167 @@
import { expect, test } from '@playwright/test'
test.describe('Download page @smoke', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/download')
})
test('has correct title', async ({ page }) => {
await expect(page).toHaveTitle('Download Comfy — Run AI Locally')
})
test('CloudBannerSection is visible with cloud link', async ({ page }) => {
const link = page.getByRole('link', { name: /TRY COMFY CLOUD/i })
await expect(link).toBeVisible()
await expect(link).toHaveAttribute('href', 'https://app.comfy.org')
})
test('HeroSection heading and subtitle are visible', async ({ page }) => {
await expect(
page.getByRole('heading', { name: /Run on your hardware/i, level: 1 })
).toBeVisible()
await expect(page.getByText(/The full ComfyUI engine/)).toBeVisible()
})
test('HeroSection has download and GitHub buttons', async ({ page }) => {
const hero = page.locator('section', {
has: page.getByRole('heading', {
name: /Run on your hardware/i,
level: 1
})
})
const downloadBtn = hero.getByRole('link', { name: /DOWNLOAD LOCAL/i })
await expect(downloadBtn).toBeVisible()
await expect(downloadBtn).toHaveAttribute('target', '_blank')
const githubBtn = hero.getByRole('link', { name: /INSTALL FROM GITHUB/i })
await expect(githubBtn).toBeVisible()
await expect(githubBtn).toHaveAttribute(
'href',
'https://github.com/Comfy-Org/ComfyUI'
)
})
test('ReasonSection heading and reasons are visible', async ({ page }) => {
await expect(
page.getByRole('heading', { name: /Why.*professionals.*choose/i })
).toBeVisible()
for (const title of [
'Unlimited',
'Any model',
'Your machine',
'Free. Open Source'
]) {
await expect(page.getByText(title).first()).toBeVisible()
}
})
test('EcoSystemSection heading is visible', async ({ page }) => {
await expect(page.getByText(/An ecosystem that moves faster/)).toBeVisible()
})
test('ProductCardsSection has 3 product cards', async ({ page }) => {
const section = page.locator('section', {
has: page.getByRole('heading', { name: /The AI creation/ })
})
const cards = section.locator('a[href]')
await expect(cards).toHaveCount(3)
})
test('ProductCardsSection links to cloud, api, enterprise', async ({
page
}) => {
const section = page.locator('section', {
has: page.getByRole('heading', { name: /The AI creation/ })
})
for (const href of ['/cloud', '/api', '/cloud/enterprise']) {
await expect(section.locator(`a[href="${href}"]`)).toBeVisible()
}
})
test('FAQSection heading is visible with 8 items', async ({ page }) => {
await expect(page.getByRole('heading', { name: /FAQ/i })).toBeVisible()
const faqButtons = page.locator('button[aria-controls^="faq-panel-"]')
await expect(faqButtons).toHaveCount(8)
})
})
test.describe('FAQ accordion @interaction', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/download')
})
test('all FAQs are expanded by default', async ({ page }) => {
await expect(
page.getByText(/A dedicated GPU is strongly recommended/i)
).toBeVisible()
await expect(page.getByText(/ComfyUI is lightweight/i)).toBeVisible()
})
test('clicking an expanded FAQ collapses it', async ({ page }) => {
const firstQuestion = page.getByRole('button', {
name: /Do I need a GPU/i
})
await firstQuestion.scrollIntoViewIfNeeded()
await firstQuestion.click()
await expect(
page.getByText(/A dedicated GPU is strongly recommended/i)
).toBeHidden()
})
test('clicking a collapsed FAQ expands it again', async ({ page }) => {
const firstQuestion = page.getByRole('button', {
name: /Do I need a GPU/i
})
await firstQuestion.scrollIntoViewIfNeeded()
await firstQuestion.click()
await expect(
page.getByText(/A dedicated GPU is strongly recommended/i)
).toBeHidden()
await firstQuestion.click()
await expect(
page.getByText(/A dedicated GPU is strongly recommended/i)
).toBeVisible()
})
})
test.describe('Download page mobile @mobile', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/download')
})
test('CloudBannerSection is visible', async ({ page }) => {
await expect(page.getByText(/Need more power/)).toBeVisible()
})
test('HeroSection heading is visible', async ({ page }) => {
await expect(
page.getByRole('heading', { name: /Run on your hardware/i, level: 1 })
).toBeVisible()
})
test('download buttons are stacked vertically', async ({ page }) => {
const hero = page.locator('section', {
has: page.getByRole('heading', {
name: /Run on your hardware/i,
level: 1
})
})
const downloadBtn = hero.getByRole('link', { name: /DOWNLOAD LOCAL/i })
const githubBtn = hero.getByRole('link', { name: /INSTALL FROM GITHUB/i })
await downloadBtn.scrollIntoViewIfNeeded()
const downloadBox = await downloadBtn.boundingBox()
const githubBox = await githubBtn.boundingBox()
expect(downloadBox, 'download button bounding box').not.toBeNull()
expect(githubBox, 'github button bounding box').not.toBeNull()
expect(githubBox!.y).toBeGreaterThan(downloadBox!.y)
})
})

View File

@@ -0,0 +1,3 @@
<svg width="62" height="94.14" viewBox="0 0 62 80" preserveAspectRatio="none" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22.9346 0C33.456 0.000149153 39.6242 8.20368 36.7305 18.3115L33.9385 28.0635C32.7454 32.2159 35.8674 36.3555 40.1826 36.3555C42.9814 36.3555 45.4493 34.5653 46.3311 31.9268L47.7129 27.002C49.4225 20.9287 55.812 16 62 16V64H48.5342C42.3461 64 38.7182 59.0713 40.4199 52.998L40.8398 51.5L40.8301 51.4922C42.0104 47.3146 38.8756 43.1751 34.5352 43.1748C31.6287 43.1748 29.0515 45.1048 28.252 47.9111L24.3047 61.6885H24.2793C21.3855 71.7964 10.5089 80 0 80V0H22.9346Z" fill="#F2FF59"/>
</svg>

After

Width:  |  Height:  |  Size: 625 B

View File

@@ -0,0 +1,32 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import FAQSection from './FAQSection.vue'
const meta: Meta<typeof FAQSection> = {
title: 'Website/Common/FAQSection',
component: FAQSection,
tags: ['autodocs'],
decorators: [
() => ({
template: '<div class="bg-primary-comfy-ink p-8"><story /></div>'
})
],
args: {
headingKey: 'download.faq.heading',
faqPrefix: 'download.faq',
faqCount: 3
}
}
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {}
export const ManyItems: Story = {
args: {
headingKey: 'download.faq.heading',
faqPrefix: 'download.faq',
faqCount: 8
}
}

View File

@@ -0,0 +1,98 @@
<script setup lang="ts">
import { reactive } from 'vue'
import type { Locale, TranslationKey } from '../../i18n/translations'
import { t } from '../../i18n/translations'
const {
locale = 'en',
headingKey,
faqPrefix,
faqCount
} = defineProps<{
locale?: Locale
headingKey: TranslationKey
faqPrefix: string
faqCount: number
}>()
const faqKeys: Array<{ q: TranslationKey; a: TranslationKey }> = Array.from(
{ length: faqCount },
(_, i) => ({
q: `${faqPrefix}.${i + 1}.q` as TranslationKey,
a: `${faqPrefix}.${i + 1}.a` as TranslationKey
})
)
const faqs = faqKeys.map(({ q, a }) => ({
question: t(q, locale),
answer: t(a, locale)
}))
const expanded = reactive(faqs.map(() => true))
function toggle(index: number) {
expanded[index] = !expanded[index]
}
</script>
<template>
<section class="px-4 py-24 md:px-20 md:py-40">
<div class="flex flex-col gap-6 md:flex-row md:gap-16">
<!-- Left heading -->
<div
class="bg-primary-comfy-ink sticky top-20 z-10 w-full shrink-0 self-start py-4 md:top-28 md:w-80 md:py-0"
>
<h2 class="text-primary-comfy-canvas text-4xl font-light md:text-5xl">
{{ t(headingKey, locale) }}
</h2>
</div>
<!-- Right FAQ list -->
<div class="flex-1">
<div
v-for="(faq, index) in faqs"
:key="index"
class="border-primary-comfy-canvas/20 border-b"
>
<button
:id="`faq-trigger-${index}`"
:aria-expanded="expanded[index]"
:aria-controls="`faq-panel-${index}`"
class="flex w-full cursor-pointer items-center justify-between text-left"
:class="index === 0 ? 'pb-6' : 'py-6'"
@click="toggle(index)"
>
<span
class="text-lg font-light md:text-xl"
:class="
expanded[index]
? 'text-primary-comfy-yellow'
: 'text-primary-comfy-canvas'
"
>
{{ faq.question }}
</span>
<span
class="text-primary-comfy-yellow ml-4 shrink-0 text-2xl"
aria-hidden="true"
>
{{ expanded[index] ? '' : '+' }}
</span>
</button>
<section
v-if="expanded[index]"
:id="`faq-panel-${index}`"
:aria-labelledby="`faq-trigger-${index}`"
class="pb-6"
>
<p class="text-primary-comfy-canvas/70 text-sm whitespace-pre-line">
{{ faq.answer }}
</p>
</section>
</div>
</div>
</div>
</section>
</template>

View File

@@ -0,0 +1,74 @@
<script setup lang="ts">
import type { Locale, TranslationKey } from '../../i18n/translations'
import { getRoutes } from '../../config/routes'
import { t } from '../../i18n/translations'
import ProductCard from './ProductCard.vue'
type Product = 'local' | 'cloud' | 'api' | 'enterprise'
const {
locale = 'en',
excludeProduct,
labelKey = 'products.label'
} = defineProps<{
locale?: Locale
excludeProduct?: Product
labelKey?: TranslationKey
}>()
const routes = getRoutes(locale)
const allCards: (ReturnType<typeof cardDef> & { product: Product })[] = [
cardDef('local', routes.download, 'bg-primary-warm-gray'),
cardDef('cloud', routes.cloud, 'bg-secondary-mauve'),
cardDef('api', routes.api, 'bg-primary-comfy-plum'),
cardDef('enterprise', routes.cloudEnterprise, 'bg-illustration-forest')
]
function cardDef(product: Product, href: string, bg: string) {
return {
product,
title: t(`products.${product}.title`, locale),
description: t(`products.${product}.description`, locale),
cta: t(`products.${product}.cta`, locale),
href,
bg
}
}
const cards = excludeProduct
? allCards.filter((c) => c.product !== excludeProduct)
: allCards
</script>
<template>
<section class="bg-primary-comfy-ink px-4 py-20 lg:px-20 lg:py-24">
<!-- Header -->
<div class="flex flex-col items-center text-center">
<p
class="text-primary-comfy-yellow text-xs font-bold tracking-widest uppercase"
>
{{ t(labelKey, locale) }}
</p>
<h2
class="text-primary-comfy-canvas mt-4 text-4xl font-light whitespace-pre-line lg:text-5xl"
>
{{ t('products.heading', locale) }}
</h2>
<p class="text-primary-comfy-canvas/70 mt-4 text-sm">
{{ t('products.subheading', locale) }}
</p>
</div>
<!-- Cards -->
<div
:class="[
'mt-16 grid grid-cols-1 gap-4',
cards.length === 4 ? 'lg:grid-cols-4' : 'lg:grid-cols-3'
]"
>
<ProductCard v-for="card in cards" :key="card.product" v-bind="card" />
</div>
</section>
</template>

View File

@@ -0,0 +1,56 @@
<script setup lang="ts">
const {
logoSrc = '/icons/logo.svg',
logoAlt = 'Comfy',
text = 'LOCAL'
} = defineProps<{
logoSrc?: string
logoAlt?: string
text?: string
}>()
</script>
<template>
<div class="font-formula-condensed flex items-stretch font-semibold">
<img
src="/icons/node-left.svg"
alt=""
class="-mx-px my-auto h-12 self-center lg:my-0 lg:h-auto lg:self-stretch"
aria-hidden="true"
/>
<span
class="bg-primary-comfy-yellow text-primary-comfy-ink my-auto flex h-12 items-center justify-center lg:my-0 lg:h-auto lg:p-8"
>
<img
:src="logoSrc"
:alt="logoAlt"
class="inline-block h-6 brightness-0 lg:h-10"
/>
</span>
<img
src="/icons/node-union-2size.svg"
alt=""
class="-mx-px my-auto h-12 self-center lg:my-0 lg:h-auto lg:self-stretch"
aria-hidden="true"
/>
<span
class="bg-primary-comfy-yellow text-primary-comfy-ink my-auto flex h-7.25 items-center justify-center lg:h-15.5 lg:px-6"
>
<span
class="inline-block translate-y-0.5 text-2xl leading-none font-bold lg:text-3xl"
>
{{ text }}
</span>
</span>
<img
src="/icons/node-right.svg"
alt=""
class="-mx-px my-auto h-7.25 self-center lg:h-15.5"
aria-hidden="true"
/>
</div>
</template>

View File

@@ -1,67 +1,11 @@
<script setup lang="ts">
import type { Locale } from '../../i18n/translations'
import { getRoutes } from '../../config/routes'
import { t } from '../../i18n/translations'
import ProductCard from '../common/ProductCard.vue'
import ProductCardsSection from '../common/ProductCardsSection.vue'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
const routes = getRoutes(locale)
const cards = [
{
title: t('products.local.title', locale),
description: t('products.local.description', locale),
cta: t('products.local.cta', locale),
href: routes.download,
bg: 'bg-primary-warm-gray'
},
{
title: t('products.cloud.title', locale),
description: t('products.cloud.description', locale),
cta: t('products.cloud.cta', locale),
href: routes.cloud,
bg: 'bg-secondary-mauve'
},
{
title: t('products.api.title', locale),
description: t('products.api.description', locale),
cta: t('products.api.cta', locale),
href: routes.api,
bg: 'bg-primary-comfy-plum'
},
{
title: t('products.enterprise.title', locale),
description: t('products.enterprise.description', locale),
cta: t('products.enterprise.cta', locale),
href: routes.cloudEnterprise,
bg: 'bg-illustration-forest'
}
]
</script>
<template>
<section class="bg-primary-comfy-ink px-4 py-20 lg:px-20 lg:py-24">
<!-- Header -->
<div class="flex flex-col items-center text-center">
<p
class="text-primary-comfy-yellow text-xs font-bold tracking-widest uppercase"
>
{{ t('products.label', locale) }}
</p>
<h2
class="text-primary-comfy-canvas mt-4 text-4xl font-light whitespace-pre-line lg:text-5xl"
>
{{ t('products.heading', locale) }}
</h2>
<p class="text-primary-warm-gray mt-4 text-sm">
{{ t('products.subheading', locale) }}
</p>
</div>
<!-- Cards -->
<div class="mt-16 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
<ProductCard v-for="card in cards" :key="card.title" v-bind="card" />
</div>
</section>
<ProductCardsSection :locale="locale" />
</template>

View File

@@ -0,0 +1,29 @@
<script setup lang="ts">
import type { Locale } from '../../../i18n/translations'
import { externalLinks } from '../../../config/routes'
import { t } from '../../../i18n/translations'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
</script>
<template>
<section
class="bg-transparency-white-t4 px-4 pt-28 pb-4 text-center lg:px-20 lg:pt-36 lg:pb-8"
>
<p
class="text-primary-comfy-canvas text-lg font-semibold lg:text-sm lg:font-normal"
>
{{ t('download.cloud.prefix', locale) }}
<a
:href="externalLinks.app"
class="text-primary-comfy-yellow mx-1 font-bold tracking-widest uppercase hover:underline"
>
{{ t('download.cloud.cta', locale) }}
</a>
<span class="mt-1 block lg:mt-0 lg:inline">
{{ t('download.cloud.suffix', locale) }}
</span>
</p>
</section>
</template>

View File

@@ -0,0 +1,69 @@
<script setup lang="ts">
import type { Locale } from '../../../i18n/translations'
import { useDownloadUrl } from '../../../composables/useDownloadUrl'
import { externalLinks } from '../../../config/routes'
import { t } from '../../../i18n/translations'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
const { downloadUrl } = useDownloadUrl()
</script>
<template>
<section class="px-4 py-24 lg:px-20 lg:py-40">
<div
class="flex flex-col-reverse items-stretch gap-10 lg:flex-row lg:gap-16"
>
<!-- Text content -->
<div class="flex flex-1 flex-col justify-between">
<div>
<h2 class="text-primary-comfy-canvas text-3xl font-light lg:text-4xl">
{{ t('download.ecosystem.heading', locale) }}
</h2>
<p class="text-primary-comfy-canvas/70 mt-6 text-sm">
{{ t('download.ecosystem.description', locale) }}
</p>
</div>
<!-- CTA buttons -->
<div class="mt-10 flex flex-col gap-4 lg:flex-row">
<a
:href="downloadUrl"
target="_blank"
rel="noopener"
class="bg-primary-comfy-yellow text-primary-comfy-ink rounded-full px-8 py-4 text-center text-sm font-bold tracking-wider transition-opacity hover:opacity-90"
>
{{ t('download.hero.downloadLocal', locale) }}
</a>
<a
:href="externalLinks.github"
target="_blank"
rel="noopener"
class="border-primary-comfy-yellow text-primary-comfy-yellow hover:bg-primary-comfy-yellow hover:text-primary-comfy-ink flex items-center justify-center gap-2 rounded-full border px-8 py-4 text-sm font-bold tracking-wider transition-colors"
>
<span
class="icon-mask size-5 mask-[url('/icons/social/github.svg')]"
aria-hidden="true"
/>
{{ t('download.hero.installGithub', locale) }}
</a>
</div>
</div>
<!-- TODO: Replace with final ecosystem illustration -->
<div class="flex-1">
<div
class="aspect-4/3 w-full overflow-hidden rounded-3xl bg-linear-to-b from-emerald-300 to-amber-200"
>
<div class="flex h-full items-center justify-center">
<span
class="bg-primary-comfy-ink text-primary-comfy-yellow rounded-full px-4 py-2 text-sm font-bold"
>
4x
</span>
</div>
</div>
</div>
</div>
</section>
</template>

View File

@@ -0,0 +1,16 @@
<script setup lang="ts">
import type { Locale } from '../../../i18n/translations'
import FAQSection from '../../common/FAQSection.vue'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
</script>
<template>
<FAQSection
:locale="locale"
heading-key="download.faq.heading"
faq-prefix="download.faq"
:faq-count="8"
/>
</template>

View File

@@ -0,0 +1,85 @@
<script setup lang="ts">
import type { Locale } from '../../../i18n/translations'
import { useDownloadUrl } from '../../../composables/useDownloadUrl'
import { externalLinks } from '../../../config/routes'
import { t } from '../../../i18n/translations'
import ProductHeroBadge from '../../common/ProductHeroBadge.vue'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
const { downloadUrl } = useDownloadUrl()
</script>
<template>
<section class="overflow-hidden px-4 pt-20 pb-16 lg:px-20 lg:py-24">
<div class="mx-auto flex max-w-5xl flex-col items-center">
<div class="flex w-full max-w-2xl flex-col items-center text-center">
<ProductHeroBadge />
<h1
class="text-primary-comfy-canvas mt-8 max-w-[10ch] text-5xl/tight font-light whitespace-pre-line lg:max-w-none lg:text-5xl"
>
{{ t('download.hero.heading', locale) }}
</h1>
<p
class="text-primary-comfy-canvas mt-8 max-w-xs text-sm lg:mt-20 lg:max-w-xl lg:text-base"
>
{{ t('download.hero.subtitle', locale) }}
</p>
<div
class="mt-10 flex w-full max-w-md flex-col gap-4 lg:w-auto lg:max-w-none lg:flex-row"
>
<a
:href="downloadUrl"
target="_blank"
rel="noopener"
class="bg-primary-comfy-yellow text-primary-comfy-ink rounded-full px-8 py-4 text-center text-sm font-bold tracking-wider transition-opacity hover:opacity-90 lg:min-w-60"
>
{{ t('download.hero.downloadLocal', locale) }}
</a>
<a
:href="externalLinks.github"
target="_blank"
rel="noopener"
class="border-primary-comfy-yellow text-primary-comfy-yellow hover:bg-primary-comfy-yellow hover:text-primary-comfy-ink flex items-center justify-center gap-2 rounded-full border px-8 py-4 text-sm font-bold tracking-wider transition-colors lg:min-w-60"
>
<span
class="icon-mask size-5 mask-[url('/icons/social/github.svg')]"
aria-hidden="true"
/>
{{ t('download.hero.installGithub', locale) }}
</a>
</div>
</div>
<!-- Placeholder for future animation; clipped within hero section -->
<div
class="relative mt-4 flex h-104 w-full max-w-4xl items-start justify-center overflow-hidden lg:mt-12 lg:h-136 lg:items-center"
>
<div
class="border-secondary-mauve/35 bg-primary-comfy-ink/35 absolute top-20 left-2 h-64 w-44 rotate-30 rounded-4xl border"
/>
<div
class="border-secondary-mauve/35 bg-primary-comfy-ink/35 absolute top-28 left-20 h-56 w-40 rotate-30 rounded-4xl border"
/>
<div
class="border-secondary-mauve/35 bg-primary-comfy-ink/35 absolute top-52 right-4 h-56 w-40 rotate-30 rounded-4xl border"
/>
<div class="relative z-10 mt-28 grid grid-cols-3 gap-0.5 lg:mt-0">
<span class="bg-secondary-mauve block size-9 rounded-lg" />
<span class="bg-primary-comfy-plum block size-9 rounded-lg" />
<span class="bg-secondary-mauve block size-9 rounded-lg" />
<span class="bg-primary-comfy-plum block size-9 rounded-lg" />
<span class="bg-primary-comfy-yellow block size-9 rounded-lg" />
<span class="bg-secondary-mauve block size-9 rounded-lg" />
<span class="bg-secondary-mauve block size-9 rounded-lg" />
<span class="bg-primary-comfy-plum block size-9 rounded-lg" />
<span class="bg-secondary-mauve block size-9 rounded-lg" />
</div>
</div>
</div>
</section>
</template>

View File

@@ -0,0 +1,15 @@
<script setup lang="ts">
import type { Locale } from '../../../i18n/translations'
import ProductCardsSection from '../../common/ProductCardsSection.vue'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
</script>
<template>
<ProductCardsSection
:locale="locale"
exclude-product="local"
label-key="products.labelProducts"
/>
</template>

View File

@@ -0,0 +1,35 @@
<script setup lang="ts">
import type { Locale } from '../../../i18n/translations'
import { t } from '../../../i18n/translations'
import SharedReasonSection from '../shared/ReasonSection.vue'
const { locale = 'en' } = defineProps<{ locale?: Locale }>()
const reasons = [
{
title: t('download.reason.1.title', locale),
description: t('download.reason.1.description', locale)
},
{
title: t('download.reason.2.title', locale),
description: t('download.reason.2.description', locale)
},
{
title: t('download.reason.3.title', locale),
description: t('download.reason.3.description', locale)
},
{
title: t('download.reason.4.title', locale),
description: t('download.reason.4.description', locale)
}
]
</script>
<template>
<SharedReasonSection
:heading="t('download.reason.heading', locale)"
:heading-highlight="t('download.reason.headingHighlight', locale)"
:reasons="reasons"
/>
</template>

View File

@@ -0,0 +1,62 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import ReasonSection from './ReasonSection.vue'
const meta: Meta<typeof ReasonSection> = {
title: 'Website/Product/ReasonSection',
component: ReasonSection,
tags: ['autodocs'],
decorators: [
() => ({
template: '<div class="bg-primary-comfy-ink p-8"><story /></div>'
})
],
args: {
heading: 'Why professionals\nchoose ',
headingHighlight: 'Comfy Local',
reasons: [
{
title: 'Unlimited\ncreative power',
description:
'Run any workflow without limits. No queues, no credits, no restrictions on what you can create.'
},
{
title: 'Any model,\nany time',
description:
'Use any open-source model instantly. Switch between Stable Diffusion, Flux, and more with a single click.'
},
{
title: 'Your machine,\nyour rules',
description:
'Your data never leaves your computer. Full privacy and complete control over your creative environment.'
},
{
title: 'Free.\nOpen Source.',
description:
'No subscriptions, no hidden fees. ComfyUI is and always will be free and open source.'
}
]
}
}
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {}
export const WithoutHighlight: Story = {
args: {
heading: 'Why choose Comfy',
headingHighlight: '',
reasons: [
{
title: 'Fast',
description: 'Optimized for speed and efficiency.'
},
{
title: 'Flexible',
description: 'Adapt to any workflow with ease.'
}
]
}
}

View File

@@ -0,0 +1,54 @@
<script setup lang="ts">
interface Reason {
title: string
description: string
}
const {
heading,
headingHighlight = '',
reasons
} = defineProps<{
heading: string
headingHighlight?: string
reasons: Reason[]
}>()
</script>
<template>
<section
class="flex flex-col gap-4 px-4 py-24 md:flex-row md:gap-16 md:px-20 md:py-40"
>
<!-- Left heading -->
<div
class="bg-primary-comfy-ink sticky top-20 z-10 w-full shrink-0 self-start py-4 md:top-28 md:w-115 md:py-0"
>
<h2
class="text-primary-comfy-canvas text-4xl font-light whitespace-pre-line md:text-5xl"
>
{{ heading
}}<span v-if="headingHighlight" class="text-primary-warm-white">{{
headingHighlight
}}</span>
</h2>
</div>
<!-- Right reasons list -->
<div class="flex-1">
<div
v-for="(reason, i) in reasons"
:key="i"
class="border-primary-comfy-canvas/20 flex flex-col gap-4 border-b py-10 first:pt-0 md:flex-row md:gap-12"
>
<h3
class="text-primary-comfy-canvas shrink-0 text-2xl font-light whitespace-pre-line md:w-52"
>
{{ reason.title }}
</h3>
<p class="text-primary-comfy-canvas/70 flex-1 text-sm">
{{ reason.description }}
</p>
</div>
</div>
</section>
</template>

View File

@@ -0,0 +1,28 @@
import { externalLinks } from '@/config/routes'
const downloadUrls = {
windows: 'https://download.comfy.org/windows/nsis/x64',
macArm: 'https://download.comfy.org/mac/dmg/arm64'
} as const
function isMobile(ua: string): boolean {
return /iphone|ipad|ipod|android/.test(ua)
}
// TODO: Only Windows x64 and macOS arm64 are available today.
// When Linux and/or macIntel builds are added, extend detection and URLs here.
function getDownloadUrl(): string {
if (typeof navigator === 'undefined') return externalLinks.github
const ua = navigator.userAgent.toLowerCase()
if (isMobile(ua)) return externalLinks.github
if (ua.includes('win')) return downloadUrls.windows
if (ua.includes('macintosh') || ua.includes('mac os x'))
return downloadUrls.macArm
return externalLinks.github
}
export function useDownloadUrl() {
return { downloadUrl: getDownloadUrl() }
}

View File

@@ -134,6 +134,10 @@ const translations = {
en: 'Comfy UI',
'zh-CN': 'Comfy UI'
},
'products.labelProducts': {
en: 'Products',
'zh-CN': '产品'
},
'products.heading': {
en: 'The AI creation\nengine for complete control',
'zh-CN': '完全掌控的\nAI 创作引擎'
@@ -218,6 +222,171 @@ const translations = {
en: "Comfy gives you the building blocks to create workflows nobody's imagined yet — and share them with everyone.",
'zh-CN': 'Comfy 为您提供构建模块,创造出前所未有的工作流——并与所有人分享。'
},
// Download FAQSection
'download.faq.heading': {
en: "FAQ's",
'zh-CN': '常见问题'
},
'download.faq.1.q': {
en: 'Do I need a GPU to run ComfyUI locally?',
'zh-CN': '本地运行 ComfyUI 需要 GPU 吗?'
},
'download.faq.1.a': {
en: 'A dedicated GPU is strongly recommended — more VRAM means bigger models and batches. No GPU? Run the same workflow on Comfy Cloud.',
'zh-CN':
'强烈建议使用独立 GPU——更大的显存意味着更大的模型和批量。没有 GPU在 Comfy Cloud 上运行相同的工作流。'
},
'download.faq.2.q': {
en: 'How much disk space do I need?',
'zh-CN': '需要多少磁盘空间?'
},
'download.faq.2.a': {
en: 'ComfyUI is lightweight, models are the heavy part. Plan for a dedicated drive as your library grows.',
'zh-CN':
'ComfyUI 本身很轻量,模型才是大头。随着库的增长,建议准备专用硬盘。'
},
'download.faq.3.q': {
en: "Is it really free? What's the catch?",
'zh-CN': '真的免费吗?有什么附加条件?'
},
'download.faq.3.a': {
en: 'Yes. Free and open source under GPL-3.0. No feature gates, no trials, no catch.',
'zh-CN':
'是的。基于 GPL-3.0 免费开源。没有功能限制、没有试用期、没有附加条件。'
},
'download.faq.4.q': {
en: 'Why would I pay for Comfy Cloud if Local is free?',
'zh-CN': '既然本地版免费,为什么还要付费使用 Comfy Cloud'
},
'download.faq.4.a': {
en: 'Your machine or ours. Cloud gives you powerful GPUs on demand, pre-loaded models, end-to-end security and infrastructure out of the box and partner models cleared for commercial use.',
'zh-CN':
'你的机器或我们的。Cloud 按需提供强大 GPU、预加载模型、端到端安全性和开箱即用的基础设施以及经过商业许可的合作伙伴模型。'
},
'download.faq.5.q': {
en: "What's the difference between Desktop, Portable, and CLI install?",
'zh-CN': 'Desktop、Portable 和 CLI 安装有什么区别?'
},
'download.faq.5.a': {
en: 'Desktop: one-click installer with auto-updates. Portable: self-contained build you can run from any folder. CLI: clone from GitHub for full developer control, for developers who want to customize the environment or contribute upstream.',
'zh-CN':
'Desktop一键安装自动更新。Portable独立构建可从任意文件夹运行。CLI从 GitHub 克隆,完全开发者控制,适合想自定义环境或参与上游贡献的开发者。'
},
'download.faq.6.q': {
en: 'Can I use my local workflows in Comfy Cloud?',
'zh-CN': '我可以在 Comfy Cloud 中使用本地工作流吗?'
},
'download.faq.6.a': {
en: 'Yes — same file, same results. No conversion, no rework.',
'zh-CN': '可以——同样的文件,同样的结果。无需转换,无需返工。'
},
'download.faq.7.q': {
en: 'How do I install custom nodes and extensions?',
'zh-CN': '如何安装自定义节点和扩展?'
},
'download.faq.7.a': {
en: 'ComfyUI Manager lets you browse, install, update, and manage 5,000+ extensions from inside the app.',
'zh-CN': 'ComfyUI Manager 让你在应用内浏览、安装、更新和管理 5,000+ 扩展。'
},
'download.faq.8.q': {
en: 'My workflow is running slowly. Should I switch to Cloud?',
'zh-CN': '我的工作流运行缓慢。应该切换到 Cloud 吗?'
},
'download.faq.8.a': {
en: 'No need to switch. Push heavy jobs to Comfy Cloud when you need more compute, keep building locally the rest of the time.',
'zh-CN':
'无需切换。需要更多算力时将繁重任务推送到 Comfy Cloud其余时间继续在本地构建。'
},
// Download EcoSystemSection
'download.ecosystem.heading': {
en: 'An ecosystem that moves faster than any company could.',
'zh-CN': '一个比任何公司都迭代更快的生态系统。'
},
'download.ecosystem.description': {
en: 'Over 5,000 community-built extensions — totaling 60,000+ nodes — plug into ComfyUI and extend what it can do. When a new open model launches, ComfyUI implements it, and the community customizes and builds it into their workflows immediately. When a research paper drops a new technique, an extension appears within days.',
'zh-CN':
'超过 5,000 个社区构建的扩展——共计 60,000+ 节点——接入 ComfyUI 并扩展其能力。当新的开源模型发布时ComfyUI 会实现它,社区会立即将其定制并构建到工作流中。当研究论文发布新技术时,几天内就会出现相应扩展。'
},
// Download ReasonSection
'download.reason.heading': {
en: 'Why\nprofessionals\nchoose ',
'zh-CN': '专业人士为何\n选择'
},
'download.reason.headingHighlight': {
en: 'Local',
'zh-CN': '本地版'
},
'download.reason.1.title': {
en: 'Unlimited\nCustomization',
'zh-CN': '无限\n自定义'
},
'download.reason.1.description': {
en: 'Install any of 5,000+ community extensions, totaling 60,000+ nodes. Build your own custom nodes. Integrate with Photoshop, Nuke, Blender, Houdini, and any tool in your existing pipeline.',
'zh-CN':
'安装 5,000+ 社区扩展中的任何一个,共计 60,000+ 节点。构建自定义节点。与 Photoshop、Nuke、Blender、Houdini 及现有管线中的任何工具集成。'
},
'download.reason.2.title': {
en: 'Any model.\nNo exceptions.',
'zh-CN': '任何模型。\n无一例外。'
},
'download.reason.2.description': {
en: 'Run every open-source model — Wan 2.1, Flux, LTX and more. Finetune, customize, control the full inference process. Or use partner models like Nano Banana and Grok.',
'zh-CN':
'运行每个开源模型——Wan 2.1、Flux、LTX 等。微调、自定义、控制完整推理过程。或使用 Nano Banana 和 Grok 等合作伙伴模型。'
},
'download.reason.3.title': {
en: 'Your machine.\nYour data.\nYour terms.',
'zh-CN': '你的机器。\n你的数据。\n你的规则。'
},
'download.reason.3.description': {
en: 'Run entirely offline. No internet connection required after setup. Your workflows, your models, your data.',
'zh-CN':
'完全离线运行。安装后无需网络连接。你的工作流、你的模型、你的数据。'
},
'download.reason.4.title': {
en: 'Free. Open Source.\nNo ceiling.',
'zh-CN': '免费。开源。\n没有上限。'
},
'download.reason.4.description': {
en: 'No feature gates, no trial periods, no "pro" tier for core functionality. No vendor can lock you in or force you off the platform. Build your own nodes and modify ComfyUI as your own.',
'zh-CN':
'没有功能限制、没有试用期、核心功能没有"专业"层级。没有供应商可以锁定你或强迫你离开平台。构建自己的节点,随心修改 ComfyUI。'
},
// Download HeroSection
'download.hero.heading': {
en: 'Run on your hardware.\nFree forever.',
'zh-CN': '在你的硬件上运行。\n永久免费。'
},
'download.hero.subtitle': {
en: 'The full ComfyUI engine — open source, fast, extensible, and yours to run however you want.',
'zh-CN': '完整的 ComfyUI 引擎——开源、快速、可扩展,随你运行。'
},
'download.hero.downloadLocal': {
en: 'DOWNLOAD LOCAL',
'zh-CN': '下载本地版'
},
'download.hero.installGithub': {
en: 'INSTALL FROM GITHUB',
'zh-CN': '从 GITHUB 安装'
},
// Download CloudBannerSection
'download.cloud.prefix': {
en: 'Need more power?',
'zh-CN': '需要更强算力?'
},
'download.cloud.cta': {
en: 'TRY COMFY CLOUD',
'zh-CN': '试试 COMFY CLOUD'
},
'download.cloud.suffix': {
en: 'Powerful GPUs, same workflow, same results, from anywhere.',
'zh-CN': '强大 GPU同样的工作流同样的结果随时随地。'
},
'buildWhat.row1': { en: 'BUILD WHAT', 'zh-CN': '构建' },
'buildWhat.row2a': { en: "DOESN'T EXIST", 'zh-CN': '尚不存在的' },
'buildWhat.row2b': { en: 'YET', 'zh-CN': '事物' },
@@ -278,4 +447,4 @@ export function t(key: TranslationKey, locale: Locale = 'en'): string {
return translations[key][locale] ?? translations[key].en
}
export type { Locale }
export type { Locale, TranslationKey }

View File

@@ -1,8 +1,18 @@
---
import BaseLayout from '../layouts/BaseLayout.astro'
import ComingSoon from '../components/common/ComingSoon.astro'
import HeroSection from '../components/product/local/HeroSection.vue'
import CloudBannerSection from '../components/product/local/CloudBannerSection.vue'
import ReasonSection from '../components/product/local/ReasonSection.vue'
import EcoSystemSection from '../components/product/local/EcoSystemSection.vue'
import ProductCardsSection from '../components/product/local/ProductCardsSection.vue'
import FAQSection from '../components/product/local/FAQSection.vue'
---
<BaseLayout title="Download Comfy — Run AI Locally">
<ComingSoon />
<CloudBannerSection />
<HeroSection client:load />
<ReasonSection />
<EcoSystemSection client:visible />
<ProductCardsSection />
<FAQSection client:visible />
</BaseLayout>

View File

@@ -1,76 +1,18 @@
---
import BaseLayout from '../../layouts/BaseLayout.astro'
const cards = [
{
icon: '🪟',
title: 'Windows',
description: '需要 NVIDIA 或 AMD 显卡',
cta: '下载 Windows 版',
href: 'https://download.comfy.org/windows/nsis/x64',
outlined: false,
},
{
icon: '🍎',
title: 'Mac',
description: '需要 Apple Silicon (M 系列)',
cta: '下载 Mac 版',
href: 'https://download.comfy.org/mac/dmg/arm64',
outlined: false,
},
{
icon: '🐙',
title: 'GitHub',
description: '在任何平台上从源码构建',
cta: '从 GitHub 安装',
href: 'https://github.com/comfyanonymous/ComfyUI',
outlined: true,
},
]
import CloudBannerSection from '../../components/product/local/CloudBannerSection.vue'
import HeroSection from '../../components/product/local/HeroSection.vue'
import ReasonSection from '../../components/product/local/ReasonSection.vue'
import EcoSystemSection from '../../components/product/local/EcoSystemSection.vue'
import ProductCardsSection from '../../components/product/local/ProductCardsSection.vue'
import FAQSection from '../../components/product/local/FAQSection.vue'
---
<BaseLayout title="下载 — Comfy">
<div class="mx-auto max-w-5xl px-6 py-32 text-center">
<h1 class="text-4xl font-bold text-white md:text-5xl">
下载 ComfyUI
</h1>
<p class="mt-4 text-lg text-smoke-700">
在本地体验 AI 创作
</p>
<div class="mt-16 grid grid-cols-1 gap-6 md:grid-cols-3">
{cards.map((card) => (
<a
href={card.href}
class="flex flex-col items-center rounded-xl border border-white/10 bg-charcoal-600 p-8 text-center transition-colors hover:border-brand-yellow"
>
<span class="text-4xl" aria-hidden="true">{card.icon}</span>
<h2 class="mt-4 text-xl font-semibold text-white">{card.title}</h2>
<p class="mt-2 text-sm text-smoke-700">{card.description}</p>
<span
class:list={[
'mt-6 inline-block rounded-full px-6 py-2 text-sm font-semibold transition-opacity hover:opacity-90',
card.outlined
? 'border border-brand-yellow text-brand-yellow'
: 'bg-brand-yellow text-black',
]}
>
{card.cta}
</span>
</a>
))}
</div>
<div class="mt-20 rounded-xl border border-white/10 bg-charcoal-800 p-8">
<p class="text-lg text-smoke-700">
没有 GPU{' '}
<a
href="https://app.comfy.org"
class="font-semibold text-brand-yellow hover:underline"
>
试试 Comfy Cloud →
</a>
</p>
</div>
</div>
<CloudBannerSection locale="zh-CN" />
<HeroSection locale="zh-CN" client:load />
<ReasonSection locale="zh-CN" />
<EcoSystemSection locale="zh-CN" client:visible />
<ProductCardsSection locale="zh-CN" />
<FAQSection locale="zh-CN" client:visible />
</BaseLayout>

View File

@@ -113,3 +113,16 @@
scroll-behavior: auto !important;
}
}
@utility icon-mask {
background-color: currentColor;
mask-size: contain;
mask-repeat: no-repeat;
mask-position: center;
}
:root {
--site-bg: #211927;
--site-bg-soft: color-mix(in srgb, var(--site-bg) 88%, black 12%);
--site-border-subtle: rgb(255 255 255 / 0.1);
}

View File

@@ -6,5 +6,6 @@
}
},
"include": ["src/**/*", "e2e/**/*", "astro.config.ts"],
"exclude": ["src/**/*.stories.ts"]
"exclude": ["src/**/*.stories.ts"],
"references": [{ "path": "./tsconfig.stories.json" }]
}

View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "ES2023",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"skipLibCheck": true,
"composite": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src/**/*.stories.ts"]
}

View File

@@ -0,0 +1,66 @@
{
"last_node_id": 2,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "CheckpointLoaderSimple",
"pos": [100, 100],
"size": [400, 200],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{ "name": "MODEL", "type": "MODEL", "links": null },
{ "name": "CLIP", "type": "CLIP", "links": null },
{ "name": "VAE", "type": "VAE", "links": null }
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": ["fake_model_a.safetensors"]
},
{
"id": 2,
"type": "CheckpointLoaderSimple",
"pos": [500, 100],
"size": [400, 200],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{ "name": "MODEL", "type": "MODEL", "links": null },
{ "name": "CLIP", "type": "CLIP", "links": null },
{ "name": "VAE", "type": "VAE", "links": null }
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": ["fake_model_b.safetensors"]
}
],
"links": [],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1,
"offset": [0, 0]
}
},
"models": [
{
"name": "fake_model_a.safetensors",
"url": "http://localhost:8188/api/devtools/fake_model.safetensors",
"directory": "checkpoints"
},
{
"name": "fake_model_b.safetensors",
"url": "http://localhost:8188/api/devtools/fake_model.safetensors",
"directory": "checkpoints"
}
],
"version": 0.4
}

View File

@@ -34,7 +34,7 @@
{
"name": "fake_model.safetensors",
"url": "http://localhost:8188/api/devtools/fake_model.safetensors",
"directory": "text_encoders"
"directory": "checkpoints"
}
]
},

View File

@@ -0,0 +1,141 @@
{
"id": "test-missing-models-in-bypassed-subgraph",
"revision": 0,
"last_node_id": 2,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "KSampler",
"pos": [100, 100],
"size": [400, 262],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{ "name": "model", "type": "MODEL", "link": null },
{ "name": "positive", "type": "CONDITIONING", "link": null },
{ "name": "negative", "type": "CONDITIONING", "link": null },
{ "name": "latent_image", "type": "LATENT", "link": null }
],
"outputs": [{ "name": "LATENT", "type": "LATENT", "links": [] }],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [0, "randomize", 20, 8, "euler", "simple", 1]
},
{
"id": 2,
"type": "subgraph-with-missing-model",
"pos": [450, 100],
"size": [400, 200],
"flags": {},
"order": 0,
"mode": 4,
"inputs": [{ "name": "model", "type": "MODEL", "link": null }],
"outputs": [{ "name": "MODEL", "type": "MODEL", "links": null }],
"properties": {},
"widgets_values": []
}
],
"links": [],
"groups": [],
"definitions": {
"subgraphs": [
{
"id": "subgraph-with-missing-model",
"version": 1,
"state": {
"lastGroupId": 0,
"lastNodeId": 1,
"lastLinkId": 2,
"lastRerouteId": 0
},
"revision": 0,
"config": {},
"name": "Subgraph with Missing Model",
"inputNode": {
"id": -10,
"bounding": [100, 200, 120, 60]
},
"outputNode": {
"id": -20,
"bounding": [500, 200, 120, 60]
},
"inputs": [
{
"id": "input1-id",
"name": "model",
"type": "MODEL",
"linkIds": [1],
"pos": { "0": 150, "1": 220 }
}
],
"outputs": [
{
"id": "output1-id",
"name": "MODEL",
"type": "MODEL",
"linkIds": [2],
"pos": { "0": 520, "1": 220 }
}
],
"widgets": [],
"nodes": [
{
"id": 1,
"type": "CheckpointLoaderSimple",
"pos": [250, 180],
"size": [400, 200],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{ "name": "MODEL", "type": "MODEL", "links": [2] },
{ "name": "CLIP", "type": "CLIP", "links": null },
{ "name": "VAE", "type": "VAE", "links": null }
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": ["fake_model.safetensors"]
}
],
"links": [
{
"id": 1,
"origin_id": -10,
"origin_slot": 0,
"target_id": 1,
"target_slot": 0,
"type": "MODEL"
},
{
"id": 2,
"origin_id": 1,
"origin_slot": 0,
"target_id": -20,
"target_slot": 0,
"type": "MODEL"
}
]
}
]
},
"config": {},
"extra": {
"ds": {
"scale": 1,
"offset": [0, 0]
}
},
"models": [
{
"name": "fake_model.safetensors",
"url": "http://localhost:8188/api/devtools/fake_model.safetensors",
"directory": "checkpoints"
}
],
"version": 0.4
}

View File

@@ -139,6 +139,27 @@ export class Topbar {
await this.menuLocator.waitFor({ state: 'hidden' })
}
/**
* Set Nodes 2.0 on or off via the Comfy logo menu switch (no-op if already
* in the requested state).
*/
async setVueNodesEnabled(enabled: boolean) {
await this.openTopbarMenu()
const nodes2Switch = this.page.getByRole('switch', { name: 'Nodes 2.0' })
await nodes2Switch.waitFor({ state: 'visible' })
if ((await nodes2Switch.isChecked()) !== enabled) {
await nodes2Switch.click()
await this.page.waitForFunction(
(wantEnabled) =>
window.app!.ui.settings.getSettingValue('Comfy.VueNodes.Enabled') ===
wantEnabled,
enabled,
{ timeout: 5000 }
)
}
await this.closeTopbarMenu()
}
/**
* Navigate to a submenu by hovering over a menu item
*/

View File

@@ -17,8 +17,17 @@ export class AppModeHelper {
readonly select: BuilderSelectHelper
readonly outputHistory: OutputHistoryComponent
readonly widgets: AppModeWidgetHelper
/** The "Connect an output" popover shown when saving without outputs. */
public readonly connectOutputPopover: Locator
/** The "Switch to Outputs" button inside the connect-output popover. */
public readonly connectOutputSwitchButton: Locator
/** The empty-workflow dialog shown when entering builder on an empty graph. */
public readonly emptyWorkflowDialog: Locator
/** "Back to workflow" button on the empty-workflow dialog. */
public readonly emptyWorkflowBackButton: Locator
/** "Load template" button on the empty-workflow dialog. */
public readonly emptyWorkflowLoadTemplateButton: Locator
/** The empty-state placeholder shown when no outputs are selected. */
public readonly outputPlaceholder: Locator
/** The linear-mode widget list container (visible in app mode). */
@@ -39,6 +48,18 @@ export class AppModeHelper {
public readonly loadTemplateButton: Locator
/** The cancel button for an in-progress run in the output history. */
public readonly cancelRunButton: Locator
/** Arrange-step placeholder shown when outputs are configured but no run has happened. */
public readonly arrangePreview: Locator
/** Arrange-step state shown when no outputs have been configured. */
public readonly arrangeNoOutputs: Locator
/** "Switch to Outputs" button inside the arrange no-outputs state. */
public readonly arrangeSwitchToOutputsButton: Locator
/** The Vue Node switch notification popup shown on entering builder. */
public readonly vueNodeSwitchPopup: Locator
/** The "Dismiss" button inside the Vue Node switch popup. */
public readonly vueNodeSwitchDismissButton: Locator
/** The "Don't show again" checkbox inside the Vue Node switch popup. */
public readonly vueNodeSwitchDontShowAgainCheckbox: Locator
constructor(private readonly comfyPage: ComfyPage) {
this.steps = new BuilderStepsHelper(comfyPage)
@@ -47,9 +68,22 @@ export class AppModeHelper {
this.select = new BuilderSelectHelper(comfyPage)
this.outputHistory = new OutputHistoryComponent(comfyPage.page)
this.widgets = new AppModeWidgetHelper(comfyPage)
this.connectOutputPopover = this.page.getByTestId(
TestIds.builder.connectOutputPopover
)
this.connectOutputSwitchButton = this.page.getByTestId(
TestIds.builder.connectOutputSwitch
)
this.emptyWorkflowDialog = this.page.getByTestId(
TestIds.builder.emptyWorkflowDialog
)
this.emptyWorkflowBackButton = this.page.getByTestId(
TestIds.builder.emptyWorkflowBack
)
this.emptyWorkflowLoadTemplateButton = this.page.getByTestId(
TestIds.builder.emptyWorkflowLoadTemplate
)
this.outputPlaceholder = this.page.getByTestId(
TestIds.builder.outputPlaceholder
)
@@ -75,6 +109,22 @@ export class AppModeHelper {
this.cancelRunButton = this.page.getByTestId(
TestIds.outputHistory.cancelRun
)
this.arrangePreview = this.page.getByTestId(TestIds.appMode.arrangePreview)
this.arrangeNoOutputs = this.page.getByTestId(
TestIds.appMode.arrangeNoOutputs
)
this.arrangeSwitchToOutputsButton = this.page.getByTestId(
TestIds.appMode.arrangeSwitchToOutputs
)
this.vueNodeSwitchPopup = this.page.getByTestId(
TestIds.appMode.vueNodeSwitchPopup
)
this.vueNodeSwitchDismissButton = this.page.getByTestId(
TestIds.appMode.vueNodeSwitchDismiss
)
this.vueNodeSwitchDontShowAgainCheckbox = this.page.getByTestId(
TestIds.appMode.vueNodeSwitchDontShowAgain
)
}
private get page(): Page {
@@ -92,6 +142,22 @@ export class AppModeHelper {
await this.comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Top')
}
/** Set preference so the Vue node switch popup does not appear in builder. */
async suppressVueNodeSwitchPopup() {
await this.comfyPage.settings.setSetting(
'Comfy.AppBuilder.VueNodeSwitchDismissed',
true
)
}
/** Allow the Vue node switch popup so tests can assert its behavior. */
async allowVueNodeSwitchPopup() {
await this.comfyPage.settings.setSetting(
'Comfy.AppBuilder.VueNodeSwitchDismissed',
false
)
}
/** Enter builder mode via the "Workflow actions" dropdown. */
async enterBuilder() {
await this.page

View File

@@ -13,18 +13,30 @@ export class BuilderStepsHelper {
return this.comfyPage.page
}
get inputsButton(): Locator {
return this.toolbar.getByRole('button', { name: 'Inputs' })
}
get outputsButton(): Locator {
return this.toolbar.getByRole('button', { name: 'Outputs' })
}
get previewButton(): Locator {
return this.toolbar.getByRole('button', { name: 'Preview' })
}
async goToInputs() {
await this.toolbar.getByRole('button', { name: 'Inputs' }).click()
await this.inputsButton.click()
await this.comfyPage.nextFrame()
}
async goToOutputs() {
await this.toolbar.getByRole('button', { name: 'Outputs' }).click()
await this.outputsButton.click()
await this.comfyPage.nextFrame()
}
async goToPreview() {
await this.toolbar.getByRole('button', { name: 'Preview' }).click()
await this.previewButton.click()
await this.comfyPage.nextFrame()
}
}

View File

@@ -137,7 +137,11 @@ export const TestIds = {
widgetItem: 'builder-widget-item',
widgetLabel: 'builder-widget-label',
outputPlaceholder: 'builder-output-placeholder',
connectOutputPopover: 'builder-connect-output-popover'
connectOutputPopover: 'builder-connect-output-popover',
connectOutputSwitch: 'builder-connect-output-switch',
emptyWorkflowDialog: 'builder-empty-workflow-dialog',
emptyWorkflowBack: 'builder-empty-workflow-back',
emptyWorkflowLoadTemplate: 'builder-empty-workflow-load-template'
},
outputHistory: {
outputs: 'linear-outputs',
@@ -163,7 +167,13 @@ export const TestIds = {
emptyWorkflow: 'linear-welcome-empty-workflow',
buildApp: 'linear-welcome-build-app',
backToWorkflow: 'linear-welcome-back-to-workflow',
loadTemplate: 'linear-welcome-load-template'
loadTemplate: 'linear-welcome-load-template',
arrangePreview: 'linear-arrange-preview',
arrangeNoOutputs: 'linear-arrange-no-outputs',
arrangeSwitchToOutputs: 'linear-arrange-switch-to-outputs',
vueNodeSwitchPopup: 'linear-vue-node-switch-popup',
vueNodeSwitchDismiss: 'linear-vue-node-switch-dismiss',
vueNodeSwitchDontShowAgain: 'linear-vue-node-switch-dont-show-again'
},
breadcrumb: {
subgraph: 'subgraph-breadcrumb'

View File

@@ -0,0 +1,70 @@
import {
comfyPageFixture as test,
comfyExpect as expect
} from '@e2e/fixtures/ComfyPage'
import { setupBuilder } from '@e2e/helpers/builderTestUtils'
test.describe('App mode arrange step', { tag: '@ui' }, () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.appMode.enableLinearMode()
await comfyPage.appMode.suppressVueNodeSwitchPopup()
})
test('Placeholder is shown when outputs are configured but no run has happened', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await setupBuilder(comfyPage)
await appMode.steps.goToPreview()
await expect(appMode.steps.previewButton).toHaveAttribute(
'aria-current',
'step'
)
await expect(appMode.arrangePreview).toBeVisible()
await expect(appMode.arrangeNoOutputs).toBeHidden()
})
test('No-outputs state navigates to the Outputs step via "Switch to Outputs"', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await appMode.enterBuilder()
await appMode.steps.goToPreview()
await expect(appMode.arrangeNoOutputs).toBeVisible()
await expect(appMode.arrangePreview).toBeHidden()
await appMode.arrangeSwitchToOutputsButton.click()
await expect(appMode.steps.outputsButton).toHaveAttribute(
'aria-current',
'step'
)
await expect(appMode.arrangeNoOutputs).toBeHidden()
})
test('Connect-output popover from preview step navigates to the Outputs step', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await appMode.enterBuilder()
// From a non-select step (preview/arrange), the popover surfaces a
// "Switch to Outputs" shortcut alongside cancel.
await appMode.steps.goToPreview()
await appMode.footer.saveAsButton.click()
await expect(appMode.connectOutputPopover).toBeVisible()
await expect(appMode.connectOutputSwitchButton).toBeVisible()
await appMode.connectOutputSwitchButton.click()
await expect(appMode.connectOutputPopover).toBeHidden()
await expect(appMode.steps.outputsButton).toHaveAttribute(
'aria-current',
'step'
)
})
})

View File

@@ -0,0 +1,84 @@
import type { ComfyPage } from '@e2e/fixtures/ComfyPage'
import {
comfyPageFixture as test,
comfyExpect as expect
} from '@e2e/fixtures/ComfyPage'
async function enterBuilderExpectVueNodeSwitchPopup(comfyPage: ComfyPage) {
const { appMode } = comfyPage
await appMode.enterBuilder()
await expect(appMode.vueNodeSwitchPopup).toBeVisible()
}
async function expectVueNodesEnabled(comfyPage: ComfyPage) {
await expect
.poll(() =>
comfyPage.settings.getSetting<boolean>('Comfy.VueNodes.Enabled')
)
.toBe(true)
}
test.describe('Vue node switch notification popup', { tag: '@ui' }, () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.appMode.enableLinearMode()
await comfyPage.appMode.allowVueNodeSwitchPopup()
})
test('Popup appears when entering builder; dismiss closes without persisting and shows again on a later entry', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await enterBuilderExpectVueNodeSwitchPopup(comfyPage)
await appMode.vueNodeSwitchDismissButton.click()
await expect(appMode.vueNodeSwitchPopup).toBeHidden()
// "Don't show again" was not checked → preference remains false
await expect
.poll(() =>
comfyPage.settings.getSetting<boolean>(
'Comfy.AppBuilder.VueNodeSwitchDismissed'
)
)
.toBe(false)
// Disable vue nodes and re-enter builder
await appMode.footer.exitBuilder()
await comfyPage.menu.topbar.setVueNodesEnabled(false)
await appMode.enterBuilder()
await expectVueNodesEnabled(comfyPage)
await expect(appMode.vueNodeSwitchPopup).toBeVisible()
})
test('"Don\'t show again" persists the dismissal and suppresses future popups', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await enterBuilderExpectVueNodeSwitchPopup(comfyPage)
await expectVueNodesEnabled(comfyPage)
// Dismiss with dont show again checked
await appMode.vueNodeSwitchDontShowAgainCheckbox.check()
await appMode.vueNodeSwitchDismissButton.click()
await expect(appMode.vueNodeSwitchPopup).toBeHidden()
await expect
.poll(() =>
comfyPage.settings.getSetting<boolean>(
'Comfy.AppBuilder.VueNodeSwitchDismissed'
)
)
.toBe(true)
// Disable vue nodes and re-enter builder
await appMode.footer.exitBuilder()
await comfyPage.menu.topbar.setVueNodesEnabled(false)
await appMode.enterBuilder()
await expectVueNodesEnabled(comfyPage)
await expect(appMode.vueNodeSwitchPopup).toBeHidden()
})
})

View File

@@ -6,6 +6,7 @@ import {
test.describe('App mode welcome states', { tag: '@ui' }, () => {
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.appMode.enableLinearMode()
await comfyPage.appMode.suppressVueNodeSwitchPopup()
})
test('Empty workflow text is visible when no nodes', async ({
@@ -58,4 +59,37 @@ test.describe('App mode welcome states', { tag: '@ui' }, () => {
await expect(comfyPage.templates.content).toBeVisible()
})
test('Empty workflow dialog blocks entering builder on an empty graph', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await comfyPage.nodeOps.clearGraph()
await appMode.enterBuilder()
await expect(appMode.emptyWorkflowDialog).toBeVisible()
await expect(appMode.emptyWorkflowBackButton).toBeVisible()
await expect(appMode.emptyWorkflowLoadTemplateButton).toBeVisible()
// Back to workflow dismisses the dialog and returns to graph mode
await appMode.emptyWorkflowBackButton.click()
await expect(appMode.emptyWorkflowDialog).toBeHidden()
await expect(comfyPage.canvas).toBeVisible()
})
test('Empty workflow dialog "Load template" opens the template selector', async ({
comfyPage
}) => {
const { appMode } = comfyPage
await comfyPage.nodeOps.clearGraph()
await appMode.enterBuilder()
await expect(appMode.emptyWorkflowDialog).toBeVisible()
await appMode.emptyWorkflowLoadTemplateButton.click()
await expect(appMode.emptyWorkflowDialog).toBeHidden()
await expect(comfyPage.templates.content).toBeVisible()
})
})

View File

@@ -214,4 +214,34 @@ test.describe('Error overlay', { tag: '@ui' }, () => {
await expect(overlay).toBeHidden()
})
})
test.describe('Count independence from node selection', () => {
test.beforeEach(async ({ comfyPage }) => {
await cleanupFakeModel(comfyPage)
})
test.afterEach(async ({ comfyPage }) => {
await cleanupFakeModel(comfyPage)
})
test('missing model count stays constant when a node is selected', async ({
comfyPage
}) => {
// Regression: ErrorOverlay previously read the selection-filtered
// missingModelGroups from useErrorGroups, so selecting one of two
// missing-model nodes would shrink the overlay label from
// "2 required models are missing" to "1". The overlay must show
// the workflow total regardless of canvas selection.
await comfyPage.workflow.loadWorkflow('missing/missing_models_distinct')
const overlay = getOverlay(comfyPage.page)
await expect(overlay).toBeVisible()
await expect(overlay).toContainText(/2 required models are missing/i)
const node = await comfyPage.nodeOps.getNodeRefById('1')
await node.click('title')
await expect(overlay).toContainText(/2 required models are missing/i)
})
})
})

View File

@@ -113,6 +113,40 @@ test.describe('Errors tab - Mode-aware errors', { tag: '@ui' }, () => {
await expect(missingModelGroup).toBeVisible()
})
test('Bypass/un-bypass cycle preserves Copy URL button on the restored row', async ({
comfyPage
}) => {
// Regression: on un-bypass, the realtime scan produced a fresh
// candidate without url/hash/directory — those fields were only
// attached by the full pipeline's enrichWithEmbeddedMetadata. The
// row's Copy URL button (v-if gated on representative.url) then
// disappeared. Per-node scan now enriches from node.properties.models
// which persists across mode toggles. Uses the `_from_node_properties`
// fixture because the enrichment source is per-node metadata, not
// the workflow-level `models[]` array (which the realtime scan
// path does not see).
await loadWorkflowAndOpenErrorsTab(
comfyPage,
'missing/missing_models_from_node_properties'
)
const copyUrlButton = comfyPage.page.getByTestId(
TestIds.dialogs.missingModelCopyUrl
)
await expect(copyUrlButton.first()).toBeVisible()
const node = await comfyPage.nodeOps.getNodeRefById('1')
await node.click('title')
await comfyPage.keyboard.bypass()
await expect.poll(() => node.isBypassed()).toBeTruthy()
await node.click('title')
await comfyPage.keyboard.bypass()
await expect.poll(() => node.isBypassed()).toBeFalsy()
await openErrorsTab(comfyPage)
await expect(copyUrlButton.first()).toBeVisible()
})
test('Pasting a node with missing model increases referencing node count', async ({
comfyPage
}) => {
@@ -476,6 +510,52 @@ test.describe('Errors tab - Mode-aware errors', { tag: '@ui' }, () => {
await openErrorsTab(comfyPage)
await expect(missingModelGroup).toBeVisible()
})
test('Loading a workflow with bypassed subgraph suppresses interior missing model error', async ({
comfyPage
}) => {
// Regression: the initial scan pipeline only checked each node's
// own mode, so interior nodes of a bypassed subgraph container
// surfaced errors even though the container was excluded from
// execution. The pipeline now post-filters candidates whose
// ancestor path is not fully active.
await comfyPage.workflow.loadWorkflow(
'missing/missing_models_in_bypassed_subgraph'
)
const errorOverlay = comfyPage.page.getByTestId(
TestIds.dialogs.errorOverlay
)
await expect(errorOverlay).toBeHidden()
await comfyPage.actionbar.propertiesButton.click()
await expect(
comfyPage.page.getByTestId(TestIds.propertiesPanel.errorsTab)
).toBeHidden()
})
test('Entering a bypassed subgraph does not resurface interior missing model error', async ({
comfyPage
}) => {
// Regression: useGraphNodeManager replays graph.onNodeAdded for
// each interior node on subgraph entry; without an ancestor-aware
// guard in scanSingleNodeErrors, that re-scan reintroduced the
// error that the initial pipeline had correctly suppressed.
await comfyPage.workflow.loadWorkflow(
'missing/missing_models_in_bypassed_subgraph'
)
const errorsTab = comfyPage.page.getByTestId(
TestIds.propertiesPanel.errorsTab
)
await comfyPage.actionbar.propertiesButton.click()
await expect(errorsTab).toBeHidden()
const subgraphNode = await comfyPage.nodeOps.getNodeRefById('2')
await subgraphNode.navigateIntoSubgraph()
await expect(errorsTab).toBeHidden()
})
})
test.describe('Workflow switching', () => {

View File

@@ -47,7 +47,12 @@
</Button>
</PopoverClose>
<PopoverClose as-child>
<Button variant="secondary" size="md" @click="emit('switch')">
<Button
variant="secondary"
size="md"
data-testid="builder-connect-output-switch"
@click="emit('switch')"
>
{{ t('builderToolbar.switchToOutputs') }}
</Button>
</PopoverClose>

View File

@@ -1,5 +1,8 @@
<template>
<BuilderDialog :show-close="false">
<BuilderDialog
data-testid="builder-empty-workflow-dialog"
:show-close="false"
>
<template #title>
{{ $t('builderToolbar.emptyWorkflowTitle') }}
</template>
@@ -17,11 +20,17 @@
<Button
variant="muted-textonly"
size="lg"
data-testid="builder-empty-workflow-back"
@click="$emit('backToWorkflow')"
>
{{ $t('linearMode.backToWorkflow') }}
</Button>
<Button variant="secondary" size="lg" @click="$emit('loadTemplate')">
<Button
variant="secondary"
size="lg"
data-testid="builder-empty-workflow-load-template"
@click="$emit('loadTemplate')"
>
{{ $t('linearMode.loadTemplate') }}
</Button>
</template>

View File

@@ -1,6 +1,7 @@
<template>
<NotificationPopup
v-if="appModeStore.showVueNodeSwitchPopup"
data-testid="linear-vue-node-switch-popup"
:title="$t('appBuilder.vueNodeSwitch.title')"
show-close
position="bottom-left"
@@ -15,6 +16,7 @@
<input
v-model="dontShowAgain"
type="checkbox"
data-testid="linear-vue-node-switch-dont-show-again"
class="accent-primary-background"
/>
{{ $t('appBuilder.vueNodeSwitch.dontShowAgain') }}
@@ -25,6 +27,7 @@
<Button
variant="secondary"
size="lg"
data-testid="linear-vue-node-switch-dismiss"
class="font-normal"
@click="dismiss"
>

View File

@@ -293,8 +293,8 @@ const {
errorNodeCache,
missingNodeCache,
missingPackGroups,
missingModelGroups,
missingMediaGroups,
filteredMissingModelGroups: missingModelGroups,
filteredMissingMediaGroups: missingMediaGroups,
swapNodeGroups
} = useErrorGroups(searchQuery, t)

View File

@@ -58,8 +58,10 @@ vi.mock(
})
)
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import { useExecutionErrorStore } from '@/stores/executionErrorStore'
import { useMissingNodesErrorStore } from '@/platform/nodeReplacement/missingNodesErrorStore'
import { isLGraphNode } from '@/utils/litegraphUtil'
import { useErrorGroups } from './useErrorGroups'
function makeMissingNodeType(
@@ -754,4 +756,48 @@ describe('useErrorGroups', () => {
).toBe(true)
})
})
describe('unfiltered vs selection-filtered model/media groups', () => {
it('exposes both unfiltered (missingModelGroups) and filtered (filteredMissingModelGroups)', () => {
const { groups } = createErrorGroups()
expect(groups.missingModelGroups).toBeDefined()
expect(groups.filteredMissingModelGroups).toBeDefined()
expect(groups.missingMediaGroups).toBeDefined()
expect(groups.filteredMissingMediaGroups).toBeDefined()
})
it('missingModelGroups returns total candidates regardless of selection (ErrorOverlay contract)', async () => {
const { store, groups } = createErrorGroups()
store.surfaceMissingModels([
makeModel('a.safetensors', { nodeId: '1', directory: 'checkpoints' }),
makeModel('b.safetensors', { nodeId: '2', directory: 'checkpoints' })
])
// Simulate canvas selection of a single node so the filtered
// variant actually narrows. Without this, both sides return the
// same value trivially and the test can't prove the contract.
vi.mocked(isLGraphNode).mockReturnValue(true)
const canvasStore = useCanvasStore()
canvasStore.selectedItems = fromAny<
typeof canvasStore.selectedItems,
unknown
>([{ id: '1' }])
await nextTick()
// Unfiltered total stays at one group of two models regardless of
// the selection — ErrorOverlay reads this for the overlay label
// and must not shrink with canvas selection.
expect(groups.missingModelGroups.value).toHaveLength(1)
expect(groups.missingModelGroups.value[0].models).toHaveLength(2)
// Filtered variant does narrow under the same selection state —
// this is how the errors tab scopes cards to the selected node.
// Exact filtered output depends on the app.rootGraph lookup
// (mocked to return undefined here); what matters is that the
// filtered shape is a different reference and does not blindly
// mirror the unfiltered one.
expect(groups.filteredMissingModelGroups.value).not.toBe(
groups.missingModelGroups.value
)
})
})
})

View File

@@ -833,8 +833,10 @@ export function useErrorGroups(
missingNodeCache,
groupedErrorMessages,
missingPackGroups,
missingModelGroups: filteredMissingModelGroups,
missingMediaGroups: filteredMissingMediaGroups,
missingModelGroups,
missingMediaGroups,
filteredMissingModelGroups,
filteredMissingMediaGroups,
swapNodeGroups
}
}

View File

@@ -728,6 +728,109 @@ describe('realtime verification staleness guards', () => {
expect(useMissingMediaStore().missingMediaCandidates).toBeNull()
})
it('skips adding verified model when rootGraph switched before verification resolved', async () => {
// Workflow A has a pending candidate on node id=1. A is replaced
// by workflow B (fresh LGraph, potentially has a node with the
// same id). Late verification from A must not leak into B.
const graphA = new LGraph()
const nodeA = new LGraphNode('CheckpointLoaderSimple')
graphA.add(nodeA)
const rootSpy = vi.spyOn(app, 'rootGraph', 'get').mockReturnValue(graphA)
vi.spyOn(missingModelScan, 'scanNodeModelCandidates').mockReturnValue([
{
nodeId: String(nodeA.id),
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
isAssetSupported: true,
name: 'stale_from_A.safetensors',
isMissing: undefined
}
])
let resolveVerify: (() => void) | undefined
const verifyPromise = new Promise<void>((r) => (resolveVerify = r))
const verifySpy = vi
.spyOn(missingModelScan, 'verifyAssetSupportedCandidates')
.mockImplementation(async (candidates) => {
await verifyPromise
for (const c of candidates) c.isMissing = true
})
vi.spyOn(missingMediaScan, 'scanNodeMediaCandidates').mockReturnValue([])
installErrorClearingHooks(graphA)
nodeA.mode = LGraphEventMode.ALWAYS
graphA.onTrigger?.({
type: 'node:property:changed',
nodeId: nodeA.id,
property: 'mode',
oldValue: LGraphEventMode.BYPASS,
newValue: LGraphEventMode.ALWAYS
})
await vi.waitFor(() => expect(verifySpy).toHaveBeenCalledOnce())
// Workflow swap: app.rootGraph now points at graphB.
const graphB = new LGraph()
const nodeB = new LGraphNode('CheckpointLoaderSimple')
graphB.add(nodeB)
rootSpy.mockReturnValue(graphB)
resolveVerify!()
await new Promise((r) => setTimeout(r, 0))
// A's verification finished but rootGraph is now B — the late
// result must not be added to the store.
expect(useMissingModelStore().missingModelCandidates).toBeNull()
})
})
describe('scan skips interior of bypassed subgraph containers', () => {
beforeEach(() => {
vi.restoreAllMocks()
setActivePinia(createTestingPinia({ stubActions: false }))
vi.spyOn(app, 'isGraphReady', 'get').mockReturnValue(false)
})
it('does not surface interior missing model when entering a bypassed subgraph', async () => {
// Repro: root has a bypassed subgraph container, interior node is
// itself active. useGraphNodeManager replays `onNodeAdded` for each
// interior node on subgraph entry, which previously reached
// scanSingleNodeErrors without an ancestor check and resurfaced the
// error that the initial pipeline post-filter had correctly dropped.
const subgraph = createTestSubgraph()
const interiorNode = new LGraphNode('CheckpointLoaderSimple')
subgraph.add(interiorNode)
const subgraphNode = createTestSubgraphNode(subgraph, { id: 65 })
subgraphNode.mode = LGraphEventMode.BYPASS
const rootGraph = subgraphNode.graph as LGraph
rootGraph.add(subgraphNode)
vi.spyOn(app, 'rootGraph', 'get').mockReturnValue(rootGraph)
// Any scanner output would surface the error if the ancestor guard
// didn't short-circuit first — return a concrete missing candidate.
vi.spyOn(missingModelScan, 'scanNodeModelCandidates').mockReturnValue([
{
nodeId: `${subgraphNode.id}:${interiorNode.id}`,
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
isAssetSupported: false,
name: 'fake.safetensors',
isMissing: true
}
])
vi.spyOn(missingMediaScan, 'scanNodeMediaCandidates').mockReturnValue([])
installErrorClearingHooks(subgraph)
// Simulate useGraphNodeManager replaying onNodeAdded for existing
// interior nodes after Vue node manager init on subgraph entry.
subgraph.onNodeAdded?.(interiorNode)
await new Promise((r) => setTimeout(r, 0))
expect(useMissingModelStore().missingModelCandidates).toBeNull()
})
})
describe('clearWidgetRelatedErrors parameter routing', () => {

View File

@@ -41,7 +41,8 @@ import {
collectAllNodes,
getExecutionIdByNode,
getExecutionIdForNodeInGraph,
getNodeByExecutionId
getNodeByExecutionId,
isAncestorPathActive
} from '@/utils/graphTraversalUtil'
function resolvePromotedExecId(
@@ -172,6 +173,14 @@ function scanAndAddNodeErrors(node: LGraphNode): void {
function scanSingleNodeErrors(node: LGraphNode): void {
if (!app.rootGraph) return
// Skip when any enclosing subgraph is muted/bypassed. Callers only
// verify each node's own mode; entering a bypassed subgraph (via
// useGraphNodeManager replaying onNodeAdded for existing interior
// nodes) reaches this point without the ancestor check. A null
// execId means the node has no current graph (e.g. detached mid
// lifecycle) — also skip, since we cannot verify its scope.
const execId = getExecutionIdByNode(app.rootGraph, node)
if (!execId || !isAncestorPathActive(app.rootGraph, execId)) return
const modelCandidates = scanNodeModelCandidates(
app.rootGraph,
@@ -237,16 +246,27 @@ function scanSingleNodeErrors(node: LGraphNode): void {
*/
function isCandidateStillActive(nodeId: unknown): boolean {
if (!app.rootGraph || nodeId == null) return false
const node = getNodeByExecutionId(app.rootGraph, String(nodeId))
const execId = String(nodeId)
const node = getNodeByExecutionId(app.rootGraph, execId)
if (!node) return false
return !isNodeInactive(node.mode)
if (isNodeInactive(node.mode)) return false
// Also reject if any enclosing subgraph was bypassed between scan
// kick-off and verification resolving — mirrors the pipeline-level
// ancestor post-filter so realtime and initial-load paths stay
// symmetric.
return isAncestorPathActive(app.rootGraph, execId)
}
async function verifyAndAddPendingModels(
pending: MissingModelCandidate[]
): Promise<void> {
// Capture rootGraph at scan time so a late verification for workflow
// A cannot leak into workflow B after a switch — execution IDs (esp.
// root-level like "1") collide across workflows.
const rootGraphAtScan = app.rootGraph
try {
await verifyAssetSupportedCandidates(pending)
if (app.rootGraph !== rootGraphAtScan) return
const verified = pending.filter(
(c) => c.isMissing === true && isCandidateStillActive(c.nodeId)
)
@@ -259,8 +279,10 @@ async function verifyAndAddPendingModels(
async function verifyAndAddPendingMedia(
pending: MissingMediaCandidate[]
): Promise<void> {
const rootGraphAtScan = app.rootGraph
try {
await verifyCloudMediaCandidates(pending)
if (app.rootGraph !== rootGraphAtScan) return
const verified = pending.filter(
(c) => c.isMissing === true && isCandidateStillActive(c.nodeId)
)

View File

@@ -0,0 +1,83 @@
{
"last_node_id": 2,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "KSampler",
"pos": [0, 0],
"size": [100, 100],
"flags": {},
"order": 1,
"mode": 0,
"properties": {},
"widgets_values": [0, "randomize", 20]
},
{
"id": 2,
"type": "subgraph-x",
"pos": [300, 0],
"size": [100, 100],
"flags": {},
"order": 0,
"mode": 0,
"properties": {},
"widgets_values": []
}
],
"links": [],
"groups": [],
"config": {},
"extra": {},
"version": 0.4,
"definitions": {
"subgraphs": [
{
"id": "subgraph-x",
"version": 1,
"state": {
"lastGroupId": 0,
"lastNodeId": 1,
"lastLinkId": 0,
"lastRerouteId": 0
},
"revision": 0,
"config": {},
"name": "x",
"nodes": [
{
"id": 1,
"type": "CheckpointLoaderSimple",
"pos": [0, 0],
"size": [100, 100],
"flags": {},
"order": 0,
"mode": 0,
"properties": {
"models": [
{
"name": "rare_model.safetensors",
"directory": "checkpoints"
}
]
},
"widgets_values": ["some_other_model.safetensors"]
}
],
"links": [],
"inputNode": { "id": -10, "bounding": [0, 0, 0, 0] },
"outputNode": { "id": -20, "bounding": [0, 0, 0, 0] },
"inputs": [],
"outputs": [],
"widgets": []
}
]
},
"models": [
{
"name": "rare_model.safetensors",
"url": "https://example.com/rare",
"directory": "checkpoints"
}
]
}

View File

@@ -0,0 +1,83 @@
{
"last_node_id": 2,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "KSampler",
"pos": [0, 0],
"size": [100, 100],
"flags": {},
"order": 1,
"mode": 0,
"properties": {},
"widgets_values": [0, "randomize", 20]
},
{
"id": 2,
"type": "subgraph-x",
"pos": [300, 0],
"size": [100, 100],
"flags": {},
"order": 0,
"mode": 4,
"properties": {},
"widgets_values": []
}
],
"links": [],
"groups": [],
"config": {},
"extra": {},
"version": 0.4,
"definitions": {
"subgraphs": [
{
"id": "subgraph-x",
"version": 1,
"state": {
"lastGroupId": 0,
"lastNodeId": 1,
"lastLinkId": 0,
"lastRerouteId": 0
},
"revision": 0,
"config": {},
"name": "x",
"nodes": [
{
"id": 1,
"type": "CheckpointLoaderSimple",
"pos": [0, 0],
"size": [100, 100],
"flags": {},
"order": 0,
"mode": 0,
"properties": {
"models": [
{
"name": "rare_model.safetensors",
"directory": "checkpoints"
}
]
},
"widgets_values": ["some_other_model.safetensors"]
}
],
"links": [],
"inputNode": { "id": -10, "bounding": [0, 0, 0, 0] },
"outputNode": { "id": -20, "bounding": [0, 0, 0, 0] },
"inputs": [],
"outputs": [],
"widgets": []
}
]
},
"models": [
{
"name": "rare_model.safetensors",
"url": "https://example.com/rare",
"directory": "checkpoints"
}
]
}

View File

@@ -15,6 +15,8 @@ import {
verifyAssetSupportedCandidates,
MODEL_FILE_EXTENSIONS
} from '@/platform/missingModel/missingModelScan'
import activeSubgraphUnmatchedModel from '@/platform/missingModel/__fixtures__/activeSubgraphUnmatchedModel.json' with { type: 'json' }
import bypassedSubgraphUnmatchedModel from '@/platform/missingModel/__fixtures__/bypassedSubgraphUnmatchedModel.json' with { type: 'json' }
import type { MissingModelCandidate } from '@/platform/missingModel/types'
import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema'
@@ -156,6 +158,134 @@ describe('scanNodeModelCandidates', () => {
expect(result).toEqual([])
})
it('enriches candidates with url/hash/directory from node.properties.models', () => {
// Regression: bypass/un-bypass cycle previously lost url metadata
// because realtime scan only reads widget values. Per-node embedded
// metadata in `properties.models` persists across mode toggles, so
// the scan now enriches candidates from that source.
const graph = makeGraph([])
const node = fromAny<LGraphNode, unknown>({
id: 1,
type: 'CheckpointLoaderSimple',
widgets: [
makeComboWidget('ckpt_name', 'missing_model.safetensors', [
'other_model.safetensors'
])
],
properties: {
models: [
{
name: 'missing_model.safetensors',
url: 'https://example.com/missing_model',
directory: 'checkpoints',
hash: 'abc123',
hash_type: 'sha256'
}
]
}
})
const result = scanNodeModelCandidates(graph, node, noAssetSupport)
expect(result).toHaveLength(1)
expect(result[0].url).toBe('https://example.com/missing_model')
expect(result[0].directory).toBe('checkpoints')
expect(result[0].hash).toBe('abc123')
expect(result[0].hashType).toBe('sha256')
})
it('preserves existing candidate fields when enriching (no overwrite)', () => {
const graph = makeGraph([])
const node = fromAny<LGraphNode, unknown>({
id: 1,
type: 'CheckpointLoaderSimple',
widgets: [makeComboWidget('ckpt_name', 'missing_model.safetensors', [])],
properties: {
models: [
{
name: 'missing_model.safetensors',
url: 'https://example.com/new_url',
directory: 'checkpoints'
}
]
}
})
const result = scanNodeModelCandidates(
graph,
node,
noAssetSupport,
() => 'checkpoints'
)
expect(result).toHaveLength(1)
// scanComboWidget already sets directory via getDirectory; enrichment
// does not overwrite it.
expect(result[0].directory).toBe('checkpoints')
// url was not set by scan, so enrichment fills it in.
expect(result[0].url).toBe('https://example.com/new_url')
})
it('skips enrichment when candidate and embedded model directories differ', () => {
// A node can list the same model name under multiple directories
// (e.g. a LoRA present in both `loras` and `loras/subdir`). Name-only
// matching would stamp the wrong url/hash onto the candidate, so
// enrichment must agree on directory when the candidate already has
// one.
const graph = makeGraph([])
const node = fromAny<LGraphNode, unknown>({
id: 1,
type: 'CheckpointLoaderSimple',
widgets: [
makeComboWidget('ckpt_name', 'collision_model.safetensors', [])
],
properties: {
models: [
{
name: 'collision_model.safetensors',
url: 'https://example.com/wrong_dir_url',
directory: 'wrong_dir'
}
]
}
})
const result = scanNodeModelCandidates(
graph,
node,
noAssetSupport,
() => 'checkpoints'
)
expect(result).toHaveLength(1)
expect(result[0].directory).toBe('checkpoints')
// Directory mismatch — enrichment should not stamp the wrong url.
expect(result[0].url).toBeUndefined()
})
it('does not enrich candidates with mismatched model names', () => {
const graph = makeGraph([])
const node = fromAny<LGraphNode, unknown>({
id: 1,
type: 'CheckpointLoaderSimple',
widgets: [makeComboWidget('ckpt_name', 'missing_model.safetensors', [])],
properties: {
models: [
{
name: 'different_model.safetensors',
url: 'https://example.com/different',
directory: 'checkpoints'
}
]
}
})
const result = scanNodeModelCandidates(graph, node, noAssetSupport)
expect(result).toHaveLength(1)
expect(result[0].url).toBeUndefined()
})
})
describe('scanAllModelCandidates', () => {
@@ -925,6 +1055,86 @@ describe('enrichWithEmbeddedMetadata', () => {
expect(result).toHaveLength(0)
})
it('drops workflow-level entries when only reference is in a bypassed subgraph interior', async () => {
// Interior properties.models references the workflow-level model
// but its widget value does not — forcing the workflow-level entry
// down the unmatched path where isModelReferencedByActiveNode
// decides. Previously the helper ignored the bypassed container.
const result = await enrichWithEmbeddedMetadata(
[],
fromAny<ComfyWorkflowJSON, unknown>(bypassedSubgraphUnmatchedModel),
alwaysMissing
)
expect(result).toHaveLength(0)
})
it('keeps workflow-level entries when reference is in an active subgraph interior', async () => {
// Positive control for the bypassed case above: identical fixture
// with container mode=0 must still surface the unmatched workflow-
// level model. Guards against a regression where the ancestor gate
// drops every workflow-level entry regardless of context.
const result = await enrichWithEmbeddedMetadata(
[],
fromAny<ComfyWorkflowJSON, unknown>(activeSubgraphUnmatchedModel),
alwaysMissing
)
expect(result).toHaveLength(1)
expect(result[0].name).toBe('rare_model.safetensors')
})
it('drops workflow-level entries when interior reference is under a different directory', async () => {
// Same name, different directory: the interior's properties.models
// entry is not the same asset as the workflow-level entry, so the
// fallback helper must not treat it as a reference that keeps the
// workflow-level model alive.
const graphData = fromPartial<ComfyWorkflowJSON>({
last_node_id: 1,
last_link_id: 0,
nodes: [
{
id: 1,
type: 'CheckpointLoaderSimple',
pos: [0, 0],
size: [100, 100],
flags: {},
order: 0,
mode: 0,
properties: {
models: [
{
name: 'collide_model.safetensors',
directory: 'loras'
}
]
},
widgets_values: ['unrelated_widget.safetensors']
}
],
links: [],
groups: [],
config: {},
extra: {},
version: 0.4,
models: [
{
name: 'collide_model.safetensors',
url: 'https://example.com/collide',
directory: 'checkpoints'
}
]
})
const result = await enrichWithEmbeddedMetadata(
[],
graphData,
alwaysMissing
)
expect(result).toHaveLength(0)
})
})
describe('OSS missing model detection (non-Cloud path)', () => {

View File

@@ -1,5 +1,6 @@
import type {
ComfyWorkflowJSON,
ModelFile,
NodeId
} from '@/platform/workflow/validation/schemas/workflowSchema'
import { flattenWorkflowNodes } from '@/platform/workflow/validation/schemas/workflowSchema'
@@ -19,6 +20,7 @@ import type {
IBaseWidget,
IComboWidget
} from '@/lib/litegraph/src/types/widgets'
import { getParentExecutionIds } from '@/types/nodeIdentification'
import {
collectAllNodes,
getExecutionIdByNode
@@ -30,6 +32,39 @@ function isComboWidget(widget: IBaseWidget): widget is IComboWidget {
return widget.type === 'combo'
}
/**
* Fills url/hash/directory onto a candidate from the node's embedded
* `properties.models` metadata when the names match. The full pipeline
* does this via enrichWithEmbeddedMetadata + graphData.models, but the
* realtime single-node scan (paste, un-bypass) otherwise loses these
* fields — making the Missing Model row's download/copy-url buttons
* disappear after a bypass/un-bypass cycle.
*/
function enrichCandidateFromNodeProperties(
candidate: MissingModelCandidate,
embeddedModels: readonly ModelFile[] | undefined
): MissingModelCandidate {
if (!embeddedModels?.length) return candidate
// Require directory agreement when the candidate already has one —
// a single node can reference two models with the same name under
// different directories (e.g. a LoRA present in multiple folders);
// name-only matching would stamp the wrong url/hash onto the
// candidate. Mirrors the directory check in enrichWithEmbeddedMetadata.
const match = embeddedModels.find(
(m) =>
m.name === candidate.name &&
(!candidate.directory || candidate.directory === m.directory)
)
if (!match) return candidate
return {
...candidate,
directory: candidate.directory ?? match.directory,
url: candidate.url ?? match.url,
hash: candidate.hash ?? match.hash,
hashType: candidate.hashType ?? match.hash_type
}
}
function isAssetWidget(widget: IBaseWidget): widget is IAssetWidget {
return widget.type === 'asset'
}
@@ -107,6 +142,8 @@ export function scanNodeModelCandidates(
if (!executionId) return []
const candidates: MissingModelCandidate[] = []
const embeddedModels = (node as { properties?: { models?: ModelFile[] } })
.properties?.models
for (const widget of node.widgets) {
let candidate: MissingModelCandidate | null = null
@@ -122,7 +159,11 @@ export function scanNodeModelCandidates(
)
}
if (candidate) candidates.push(candidate)
if (candidate) {
candidates.push(
enrichCandidateFromNodeProperties(candidate, embeddedModels)
)
}
}
return candidates
@@ -231,9 +272,18 @@ export async function enrichWithEmbeddedMetadata(
// model — not merely because any unrelated active node exists. A
// reference is any widget value (or node.properties.models entry)
// that matches the model name on an active node.
// Hoist the id→node map once; isModelReferencedByActiveNode would
// otherwise rebuild it on every unmatched entry.
const flattenedNodeById = new Map(allNodes.map((n) => [String(n.id), n]))
const activeUnmatched = unmatched.filter(
(m) =>
m.sourceNodeType !== '' || isModelReferencedByActiveNode(m.name, allNodes)
m.sourceNodeType !== '' ||
isModelReferencedByActiveNode(
m.name,
m.directory,
allNodes,
flattenedNodeById
)
)
const settled = await Promise.allSettled(
@@ -276,7 +326,9 @@ export async function enrichWithEmbeddedMetadata(
function isModelReferencedByActiveNode(
modelName: string,
allNodes: ReturnType<typeof flattenWorkflowNodes>
modelDirectory: string | undefined,
allNodes: ReturnType<typeof flattenWorkflowNodes>,
nodeById: Map<string, ReturnType<typeof flattenWorkflowNodes>[number]>
): boolean {
for (const node of allNodes) {
if (
@@ -284,12 +336,30 @@ function isModelReferencedByActiveNode(
node.mode === LGraphEventMode.BYPASS
)
continue
if (!isAncestorPathActiveInFlattened(String(node.id), nodeById)) continue
// Require directory agreement when both sides specify one, so a
// same-name entry under a different folder does not keep an
// unrelated workflow-level model alive as missing.
const embeddedModels = (
node.properties as { models?: Array<{ name: string }> } | undefined
node.properties as
| { models?: Array<{ name: string; directory?: string }> }
| undefined
)?.models
if (embeddedModels?.some((m) => m.name === modelName)) return true
if (
embeddedModels?.some(
(m) =>
m.name === modelName &&
(modelDirectory === undefined ||
m.directory === undefined ||
m.directory === modelDirectory)
)
) {
return true
}
// widgets_values carries only the name, so directory cannot be
// checked here — fall back to filename matching.
const values = node.widgets_values
if (!values) continue
const valueArray = Array.isArray(values) ? values : Object.values(values)
@@ -300,6 +370,22 @@ function isModelReferencedByActiveNode(
return false
}
function isAncestorPathActiveInFlattened(
executionId: string,
nodeById: Map<string, ReturnType<typeof flattenWorkflowNodes>[number]>
): boolean {
for (const ancestorId of getParentExecutionIds(executionId)) {
const ancestor = nodeById.get(ancestorId)
if (!ancestor) continue
if (
ancestor.mode === LGraphEventMode.NEVER ||
ancestor.mode === LGraphEventMode.BYPASS
)
return false
}
return true
}
function collectEmbeddedModelsWithSource(
allNodes: ReturnType<typeof flattenWorkflowNodes>,
graphData: ComfyWorkflowJSON

View File

@@ -39,7 +39,7 @@ const existingOutput = computed(() => {
<div
v-else-if="hasOutputs"
role="article"
data-testid="arrange-preview"
data-testid="linear-arrange-preview"
class="mx-auto flex h-full w-3/4 flex-col items-center justify-center gap-6 p-8"
>
<div
@@ -54,7 +54,7 @@ const existingOutput = computed(() => {
<div
v-else
role="article"
data-testid="arrange-no-outputs"
data-testid="linear-arrange-no-outputs"
class="mx-auto flex h-full w-lg flex-col items-center justify-center gap-6 p-8 text-center"
>
<p class="m-0 text-base-foreground">
@@ -75,7 +75,12 @@ const existingOutput = computed(() => {
<p class="mt-0 p-0">{{ t('linearMode.arrange.outputExamples') }}</p>
</div>
<div class="flex flex-row gap-2">
<Button variant="primary" size="lg" @click="setMode('builder:outputs')">
<Button
variant="primary"
size="lg"
data-testid="linear-arrange-switch-to-outputs"
@click="setMode('builder:outputs')"
>
{{ t('linearMode.arrange.switchToOutputsButton') }}
</Button>
</div>

View File

@@ -108,6 +108,8 @@ import {
collectAllNodes,
forEachNode,
getNodeByExecutionId,
isAncestorPathActive,
isMissingCandidateActive,
triggerCallbackOnAllNodes
} from '@/utils/graphTraversalUtil'
import {
@@ -1436,10 +1438,21 @@ export class ComfyApp {
requestAnimationFrame(() => fitView())
}
// Drop missing-node entries whose enclosing subgraph is
// muted/bypassed. The initial JSON scan only checks each node's
// own mode; the cascade from an inactive container is applied here
// using the now-configured live graph.
const activeMissingNodeTypes = missingNodeTypes.filter(
(n) =>
typeof n === 'string' ||
n.nodeId == null ||
isAncestorPathActive(this.rootGraph, String(n.nodeId))
)
if (!skipAssetScans) {
await this.runMissingModelPipeline(
graphData,
missingNodeTypes,
activeMissingNodeTypes,
silentAssetErrors
)
@@ -1482,7 +1495,7 @@ export class ComfyApp {
const modelStore = useModelStore()
await modelStore.loadModelFolders()
const enrichedCandidates = await enrichWithEmbeddedMetadata(
const enrichedAll = await enrichWithEmbeddedMetadata(
candidates,
graphData,
async (name, directory) => {
@@ -1498,6 +1511,19 @@ export class ComfyApp {
: undefined
)
// Drop candidates whose enclosing subgraph is muted/bypassed. Per-node
// scans only checked each node's own mode; the cascade from an
// inactive container to its interior happens here.
// Asymmetric on purpose: a candidate dropped here is not resurrected if
// the user un-bypasses the container mid-verification. The realtime
// mode-change path (handleNodeModeChange → scanAndAddNodeErrors) is
// responsible for surfacing errors after an un-bypass.
const enrichedCandidates = enrichedAll.filter(
(c) =>
c.nodeId == null ||
isAncestorPathActive(this.rootGraph, String(c.nodeId))
)
const missingModels: ModelFile[] = enrichedCandidates
.filter((c) => c.isMissing === true && c.url)
.map((c) => ({
@@ -1535,8 +1561,10 @@ export class ComfyApp {
)
.then(() => {
if (controller.signal.aborted) return
const confirmed = enrichedCandidates.filter(
(c) => c.isMissing === true
// Re-check ancestor: user may have bypassed a container
// while verification was in flight.
const confirmed = enrichedCandidates.filter((c) =>
isMissingCandidateActive(this.rootGraph, c)
)
if (confirmed.length) {
useExecutionErrorStore().surfaceMissingModels(confirmed, {
@@ -1643,7 +1671,11 @@ export class ComfyApp {
): Promise<void> {
const missingMediaStore = useMissingMediaStore()
const activeWf = useWorkspaceStore().workflow.activeWorkflow
const candidates = scanAllMediaCandidates(this.rootGraph, isCloud)
const allCandidates = scanAllMediaCandidates(this.rootGraph, isCloud)
// Drop candidates whose enclosing subgraph is muted/bypassed.
const candidates = allCandidates.filter((c) =>
isAncestorPathActive(this.rootGraph, String(c.nodeId))
)
if (!candidates.length) {
this.cacheMediaCandidates(activeWf, [])
@@ -1655,7 +1687,10 @@ export class ComfyApp {
void verifyCloudMediaCandidates(candidates, controller.signal)
.then(() => {
if (controller.signal.aborted) return
const confirmed = candidates.filter((c) => c.isMissing === true)
// Re-check ancestor after async verification (see model pipeline).
const confirmed = candidates.filter((c) =>
isMissingCandidateActive(this.rootGraph, c)
)
if (confirmed.length) {
useExecutionErrorStore().surfaceMissingMedia(confirmed, { silent })
}

View File

@@ -29,8 +29,11 @@ import {
triggerCallbackOnAllNodes,
visitGraphNodes,
getExecutionIdByNode,
getExecutionIdForNodeInGraph
getExecutionIdForNodeInGraph,
isAncestorPathActive,
isMissingCandidateActive
} from '@/utils/graphTraversalUtil'
import { LGraphEventMode } from '@/lib/litegraph/src/types/globalEnums'
import { createMockLGraphNode } from './__tests__/litegraphTestUtils'
@@ -723,6 +726,141 @@ describe('graphTraversalUtil', () => {
})
})
describe('isAncestorPathActive', () => {
function makeActiveSubgraph(id: string, nodes: LGraphNode[]) {
return createMockSubgraph(id, nodes)
}
it('returns true for root-level nodes (no ancestors)', () => {
const node = createMockNode('42')
const rootGraph = createMockGraph([node])
expect(isAncestorPathActive(rootGraph, '42')).toBe(true)
})
it('returns true when all ancestor containers are active', () => {
const interior = createMockNode('63')
const subgraph = makeActiveSubgraph('sub', [interior])
const container = createMockNode('65', {
isSubgraph: true,
subgraph
})
// container mode defaults to ALWAYS (active)
const rootGraph = createMockGraph([container])
expect(isAncestorPathActive(rootGraph, '65:63')).toBe(true)
})
it('returns false when the immediate parent container is bypassed', () => {
const interior = createMockNode('63')
const subgraph = makeActiveSubgraph('sub', [interior])
const container = createMockLGraphNode({
id: 65,
isSubgraphNode: () => true,
subgraph,
mode: LGraphEventMode.BYPASS
}) satisfies Partial<LGraphNode> as LGraphNode
const rootGraph = createMockGraph([container])
expect(isAncestorPathActive(rootGraph, '65:63')).toBe(false)
})
it('returns false when an outer ancestor is muted (deeply nested)', () => {
const interior = createMockNode('999')
const deep = makeActiveSubgraph('deep', [interior])
const midNode = createMockNode('456', {
isSubgraph: true,
subgraph: deep
})
const mid = makeActiveSubgraph('mid', [midNode])
const topNode = createMockLGraphNode({
id: 123,
isSubgraphNode: () => true,
subgraph: mid,
mode: LGraphEventMode.NEVER
}) satisfies Partial<LGraphNode> as LGraphNode
const rootGraph = createMockGraph([topNode])
expect(isAncestorPathActive(rootGraph, '123:456:999')).toBe(false)
})
it('returns true when ancestor node cannot be resolved (defensive)', () => {
const rootGraph = createMockGraph([])
// Unknown ancestor ID "99" — not found, treated as active.
expect(isAncestorPathActive(rootGraph, '99:63')).toBe(true)
})
it('returns true when rootGraph is null/undefined', () => {
expect(isAncestorPathActive(null, '65:63')).toBe(true)
expect(isAncestorPathActive(undefined, '65:63')).toBe(true)
})
})
describe('isMissingCandidateActive', () => {
function makeBypassedContainer(interiorId: string) {
const interior = createMockNode(interiorId)
const subgraph = createMockSubgraph('sub', [interior])
const container = createMockLGraphNode({
id: 65,
isSubgraphNode: () => true,
subgraph,
mode: LGraphEventMode.BYPASS
}) satisfies Partial<LGraphNode> as LGraphNode
return createMockGraph([container])
}
it('surfaces confirmed missing candidates under active ancestors', () => {
const interior = createMockNode('63')
const subgraph = createMockSubgraph('sub', [interior])
const container = createMockNode('65', {
isSubgraph: true,
subgraph
})
const rootGraph = createMockGraph([container])
expect(
isMissingCandidateActive(rootGraph, {
nodeId: '65:63',
isMissing: true
})
).toBe(true)
})
it('drops confirmed missing candidates whose ancestor is bypassed (cloud .then race)', () => {
// Mirrors the reopen gap: pipeline-start filter passed, then
// the user bypassed the container during verification, and the
// async resolver must not resurface the candidate.
const rootGraph = makeBypassedContainer('63')
expect(
isMissingCandidateActive(rootGraph, {
nodeId: '65:63',
isMissing: true
})
).toBe(false)
})
it('drops unverified candidates (isMissing !== true)', () => {
const rootGraph = createMockGraph([])
expect(
isMissingCandidateActive(rootGraph, {
nodeId: '1',
isMissing: undefined
})
).toBe(false)
expect(
isMissingCandidateActive(rootGraph, { nodeId: '1', isMissing: false })
).toBe(false)
})
it('keeps workflow-level candidates (nodeId == null) when confirmed missing', () => {
const rootGraph = makeBypassedContainer('63')
expect(
isMissingCandidateActive(rootGraph, {
nodeId: undefined,
isMissing: true
})
).toBe(true)
})
})
describe('getExecutionIdFromNodeData', () => {
it('should return the correct execution ID for a normal node', () => {
const node = createMockNode('123')

View File

@@ -3,9 +3,11 @@ import type {
LGraphNode,
Subgraph
} from '@/lib/litegraph/src/litegraph'
import { LGraphEventMode } from '@/lib/litegraph/src/types/globalEnums'
import type { NodeExecutionId, NodeLocatorId } from '@/types/nodeIdentification'
import {
createNodeLocatorId,
getParentExecutionIds,
parseNodeLocatorId
} from '@/types/nodeIdentification'
@@ -362,6 +364,58 @@ export function getExecutionIdByNode(
return `${parentPath}:${node.id}`
}
/**
* True when every ancestor container in the execution path is active
* (not muted, not bypassed). Self is not checked — caller is expected to
* have already verified the target node's own mode.
*
* For root-level nodes (single-segment execution ID) there are no
* ancestors and the result is always true.
*
* Use after an initial full-graph scan to suppress missing-asset entries
* whose enclosing subgraph is muted/bypassed. At scan time only each
* node's own mode is checked; ancestor context is applied here so the
* effect cascades to interior nodes without requiring every scanner to
* carry the ancestor flag.
*/
export function isAncestorPathActive(
rootGraph: LGraph | null | undefined,
executionId: string
): boolean {
if (!rootGraph) return true
for (const ancestorId of getParentExecutionIds(executionId)) {
const ancestor = getNodeByExecutionId(rootGraph, ancestorId)
if (!ancestor) continue
if (
ancestor.mode === LGraphEventMode.NEVER ||
ancestor.mode === LGraphEventMode.BYPASS
) {
return false
}
}
return true
}
/**
* Predicate used after async verification resolves: a missing-asset
* candidate is surfaceable when it is confirmed missing and its
* enclosing subgraph is still active. Null `nodeId` (workflow-level
* models) bypasses the ancestor check since it has no scope to
* validate. Unified helper so the initial pipeline post-filter and the
* three async-resolution call sites cannot drift.
*/
export function isMissingCandidateActive(
rootGraph: LGraph | null | undefined,
candidate: {
nodeId?: string | number | null | undefined
isMissing?: boolean | undefined
}
): boolean {
if (candidate.isMissing !== true) return false
if (candidate.nodeId == null) return true
return isAncestorPathActive(rootGraph, String(candidate.nodeId))
}
/**
* Returns the execution ID for a node identified by its (graph, nodeId) pair.
*