From 2af46613adfecc562abef76cac3206b68d276852 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 23:39:17 +0000 Subject: [PATCH 01/11] feat(website): design preview for a Hub workflow that can't run on its page Workflows that are node graphs only (custom nodes, local models) keep the runnable workflow layout, and the Run button gives way to Try on Comfy Cloud and Download workflow. A sample page at /hub-preview/node-graph-workflow/ is built everywhere except production, so the design can be shared from the pull request preview. --- apps/website/astro.config.ts | 4 +- .../workshop/WorkflowNodeGraphPage.vue | 322 ++++++++++++++++++ apps/website/src/config/indexing.test.ts | 4 +- apps/website/src/config/indexing.ts | 1 + .../src/integrations/design-previews.ts | 37 ++ .../src/lib/hub/node-graph-workflow.ts | 85 +++++ apps/website/src/locales/en/main.json | 16 + apps/website/src/locales/zh-CN/main.json | 16 + .../design-previews/node-graph-workflow.astro | 23 ++ knip.config.ts | 6 +- 10 files changed, 511 insertions(+), 3 deletions(-) create mode 100644 apps/website/src/components/workshop/WorkflowNodeGraphPage.vue create mode 100644 apps/website/src/integrations/design-previews.ts create mode 100644 apps/website/src/lib/hub/node-graph-workflow.ts create mode 100644 apps/website/src/routes/design-previews/node-graph-workflow.astro diff --git a/apps/website/astro.config.ts b/apps/website/astro.config.ts index 5fe99b77468..d9d5bfb39d2 100644 --- a/apps/website/astro.config.ts +++ b/apps/website/astro.config.ts @@ -6,6 +6,7 @@ import tailwindcss from '@tailwindcss/vite' import { isExcludedFromSitemap, isIndexableBuild } from './src/config/indexing' import { DEFAULT_LOCALE, LOCALE_CODES } from './src/config/locales' import { astroRedirects } from './src/config/redirects' +import { designPreviews } from './src/integrations/design-previews' import { indexNowManifest } from './src/integrations/indexnow-manifest' import { markdownTwins } from './src/integrations/markdown-twins' import { workshopReleaseGate } from './src/integrations/workshop-release-gate' @@ -38,7 +39,8 @@ export default defineConfig({ }), markdownTwins(), indexNowManifest(), - workshopReleaseGate() + workshopReleaseGate(), + designPreviews() ], vite: { plugins: [tailwindcss()], diff --git a/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue b/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue new file mode 100644 index 00000000000..dc2ca450e79 --- /dev/null +++ b/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue @@ -0,0 +1,322 @@ + + + diff --git a/apps/website/src/config/indexing.test.ts b/apps/website/src/config/indexing.test.ts index 9efb3e379a8..abb65af298e 100644 --- a/apps/website/src/config/indexing.test.ts +++ b/apps/website/src/config/indexing.test.ts @@ -3,6 +3,7 @@ import { join, relative, sep } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { websiteRoot } from '@website/paths' +import { DESIGN_PREVIEW_ROUTES } from '@/integrations/design-previews' import { modelsBuildRoutes } from '@/integrations/workshop-release-gate' import { routeOf } from '@/utils/hreflangRoutes' import { @@ -330,7 +331,8 @@ describe('NOINDEX_ROUTES', () => { const builtRoutes = [ ...astroFiles(pagesDir).map(pageRoute), - ...modelsBuildRoutes(true).map(({ pattern }) => pattern) + ...modelsBuildRoutes(true).map(({ pattern }) => pattern), + ...DESIGN_PREVIEW_ROUTES.map(({ pattern }) => pattern) ].map(toMatcher) it.for(NOINDEX_ROUTES)('%s is a route this site builds', (route) => { diff --git a/apps/website/src/config/indexing.ts b/apps/website/src/config/indexing.ts index 6c02c555515..91c7eff3aa6 100644 --- a/apps/website/src/config/indexing.ts +++ b/apps/website/src/config/indexing.ts @@ -16,6 +16,7 @@ export const NOINDEX_ROUTES = [ '/changelog', ...PAYMENT_STATUSES.map((status) => `/payment/${status}`), '/individual-submission', + '/hub-preview/node-graph-workflow', '/booking-confirmation', '/login', '/signup', diff --git a/apps/website/src/integrations/design-previews.ts b/apps/website/src/integrations/design-previews.ts new file mode 100644 index 00000000000..fd4f17e408f --- /dev/null +++ b/apps/website/src/integrations/design-previews.ts @@ -0,0 +1,37 @@ +import type { AstroIntegration } from 'astro' +import { join } from 'node:path' + +import { websiteRoot } from '@website/paths' + +/** Mock pages a designer shares from a pull request preview. */ +export const DESIGN_PREVIEW_ROUTES = [ + { + pattern: '/hub-preview/node-graph-workflow', + entrypoint: join( + websiteRoot, + 'src/routes/design-previews/node-graph-workflow.astro' + ) + } +] as const + +function isDesignPreviewBuild( + vercelEnv: string | undefined = process.env.VERCEL_ENV +): boolean { + return vercelEnv !== 'production' +} + +/** + * Builds the design preview pages everywhere except production, so a preview + * link works and comfy.org never carries a page made of sample data. + */ +export function designPreviews(): AstroIntegration { + return { + name: 'design-previews', + hooks: { + 'astro:config:setup': ({ injectRoute }) => { + if (!isDesignPreviewBuild()) return + for (const route of DESIGN_PREVIEW_ROUTES) injectRoute(route) + } + } + } +} diff --git a/apps/website/src/lib/hub/node-graph-workflow.ts b/apps/website/src/lib/hub/node-graph-workflow.ts new file mode 100644 index 00000000000..b8e2e025115 --- /dev/null +++ b/apps/website/src/lib/hub/node-graph-workflow.ts @@ -0,0 +1,85 @@ +import type { PlaygroundExample } from '@/config/workshop-playground' + +/** + * A Hub workflow that cannot run on its own page: a node graph that needs + * ComfyUI (custom nodes, local models). It keeps the layout of a runnable + * workflow page, and the Run button gives way to Try on Comfy Cloud and + * Download. + */ +export interface NodeGraphWorkflow { + readonly slug: string + readonly name: string + readonly summary: string + readonly description: readonly string[] + readonly useCase?: { readonly label: string; readonly href: string } + readonly graph: { readonly source: string; readonly previewUrl?: string } + readonly downloadUrl: string + /** The Cloud template that Try on Comfy Cloud opens. */ + readonly templateId: string + readonly inputs: readonly string[] + readonly models: readonly string[] + readonly customNodes: readonly string[] + readonly author?: string + readonly examples: readonly PlaygroundExample[] +} + +const MEDIA = + 'https://media.comfy.org/website/workshop/workflows/character-turnaround' + +/** + * Sample data for the design preview. It borrows a published workflow's graph + * and media so the page reads as real; nothing here reaches a live Hub page. + */ +export const nodeGraphWorkflowSample: NodeGraphWorkflow = { + slug: 'node-graph-preview', + name: 'Create a character turnaround', + summary: + 'Create multiple character views and close-ups from one reference image.', + description: [ + 'This workflow takes one picture of a character and builds a full turnaround sheet from it: front, half turn, side profile and back, plus a row of close-ups of the face. Each view keeps the outfit, colours and proportions of the reference, so the sheet is ready to hand to an animator or a 3D artist.', + 'It loads the reference with LoadImage, generates the full-body and close-up views in two branches, and stitches them into one sheet with ImageStitch. The graph uses custom nodes and models that are not available on this page, so it runs in ComfyUI: open it in Comfy Cloud, or download the JSON and drop it onto the canvas.' + ], + useCase: { + label: 'Edit images', + href: '/hub/workflows/?category=edit-images' + }, + graph: { + source: '/workflow-graphs/character-turnaround.json', + previewUrl: '/workflow-graphs/character-turnaround.svg' + }, + downloadUrl: '/workflow-graphs/character-turnaround.json', + templateId: 'templates-character_sheet', + inputs: ['Character image', 'Seed'], + models: ['Nano Banana Pro'], + customNodes: ['ComfyUI-KJNodes', 'ComfyUI-Impact-Pack'], + author: 'ComfyUI', + examples: [ + { + id: 'pink-silver', + title: 'Pink and silver character sheet', + specs: [], + values: {}, + outputUrl: `${MEDIA}/pink-silver-character-sheet.webp`, + mediaKind: 'image', + sampleOnly: true + }, + { + id: 'deep-sea-diver', + title: 'Deep-sea diver character sheet', + specs: [], + values: {}, + outputUrl: `${MEDIA}/deep-sea-diver-sheet.webp`, + mediaKind: 'image', + sampleOnly: true + }, + { + id: 'space-courier', + title: 'Animated space courier sheet', + specs: [], + values: {}, + outputUrl: `${MEDIA}/space-courier-sheet.webp`, + mediaKind: 'image', + sampleOnly: true + } + ] +} diff --git a/apps/website/src/locales/en/main.json b/apps/website/src/locales/en/main.json index 4ec775e07f0..489af7c63de 100644 --- a/apps/website/src/locales/en/main.json +++ b/apps/website/src/locales/en/main.json @@ -13,6 +13,22 @@ } }, "workshop": { + "nodeGraph": { + "badge": "Node graph", + "runTitle": "Run it in ComfyUI", + "runBody": "This workflow uses nodes and models that can't run on this page. Open it in Comfy Cloud with nothing to install, or download it and run it in ComfyUI on your machine.", + "models": "Models", + "tryCloud": "Try on Comfy Cloud", + "download": "Download workflow", + "downloadHint": "A JSON file. Drag it onto the ComfyUI canvas to open it.", + "about": "About this workflow", + "graphHint": "A read-only preview of the node graph. Open it in Comfy Cloud or download it to edit the nodes.", + "previewNotice": "Design preview with sample data. This page is not on the Hub.", + "tabs": { + "overview": "Overview", + "workflow": "Workflow" + } + }, "meta": { "title": "Browse Models - Comfy", "description": "Browse and run the latest AI image, video and audio models on Comfy." diff --git a/apps/website/src/locales/zh-CN/main.json b/apps/website/src/locales/zh-CN/main.json index 686dfd0c740..f67cda8f0af 100644 --- a/apps/website/src/locales/zh-CN/main.json +++ b/apps/website/src/locales/zh-CN/main.json @@ -4499,6 +4499,22 @@ } }, "workshop": { + "nodeGraph": { + "badge": "节点图", + "runTitle": "在 ComfyUI 中运行", + "runBody": "此工作流使用的节点和模型无法在本页运行。你可以在 Comfy Cloud 中打开,无需安装;也可以下载后在本地的 ComfyUI 中运行。", + "models": "模型", + "tryCloud": "在 Comfy Cloud 中试用", + "download": "下载工作流", + "downloadHint": "JSON 文件。将其拖到 ComfyUI 画布上即可打开。", + "about": "关于此工作流", + "graphHint": "节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。", + "previewNotice": "使用示例数据的设计预览。此页面不在 Hub 上。", + "tabs": { + "overview": "概览", + "workflow": "工作流" + } + }, "api": { "body": "使用试用区的输入调用 Comfy Router。运行前请设置 COMFY_API_KEY,并检查本地文件路径。", "copied": "已复制", diff --git a/apps/website/src/routes/design-previews/node-graph-workflow.astro b/apps/website/src/routes/design-previews/node-graph-workflow.astro new file mode 100644 index 00000000000..ad70cc63379 --- /dev/null +++ b/apps/website/src/routes/design-previews/node-graph-workflow.astro @@ -0,0 +1,23 @@ +--- +import WorkflowNodeGraphPage from '@/components/workshop/WorkflowNodeGraphPage.vue' +import BaseLayout from '@/layouts/BaseLayout.astro' +import { nodeGraphWorkflowSample } from '@/lib/hub/node-graph-workflow' +--- + + +

+ {Astro.locals.t('workshop.nodeGraph.previewNotice')} +

+ +
diff --git a/knip.config.ts b/knip.config.ts index 0258bd889d7..84501f26f46 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -54,7 +54,11 @@ const config: KnipConfig = { }, 'apps/website': { // Models pages are registered by the release-gate integration. - entry: ['src/scripts/**/*.ts', 'src/routes/models/*.{astro,ts}'], + entry: [ + 'src/scripts/**/*.ts', + 'src/routes/models/*.{astro,ts}', + 'src/routes/design-previews/*.astro' + ], // Executed by models-snippets.test.ts inside the generated Node examples. ignoreDependencies: ['mime-types'] }, From 08d6378f7e3c16cf1bc7a4073e1f61296f316f1b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 23:51:22 +0000 Subject: [PATCH 02/11] refactor(website): move the node graph run panel into its own component --- .../workshop/WorkflowNodeGraphPage.vue | 134 +---------------- .../workshop/WorkflowNodeGraphRunPanel.vue | 135 ++++++++++++++++++ 2 files changed, 142 insertions(+), 127 deletions(-) create mode 100644 apps/website/src/components/workshop/WorkflowNodeGraphRunPanel.vue diff --git a/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue b/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue index dc2ca450e79..1f0d92fe4cf 100644 --- a/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue +++ b/apps/website/src/components/workshop/WorkflowNodeGraphPage.vue @@ -1,17 +1,8 @@