Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bf701aa
feat(templates): provision Desktop template inputs
jaeone94 Sep 26, 2026
11b5377
merge: take the disposal and lifecycle fixes from the model routing s…
jaeone94 Oct 1, 2026
4584e40
merge: update the input assets slice against main
jaeone94 Oct 1, 2026
b613338
merge: take the error surface fix from the model routing slice
jaeone94 Oct 1, 2026
f293b51
merge: take the detail test and routing spec fixes from the model rou…
jaeone94 Oct 1, 2026
f5afa44
merge: take the selected-models contract docblock from the stack below
jaeone94 Oct 1, 2026
ec7f93d
fix(templates): await input rebinds and release them when one fails
jaeone94 Oct 1, 2026
600af79
merge: take the review-round fixes from the slices below
jaeone94 Oct 1, 2026
1255939
fix(templates): read the disposed flag past its narrowing
jaeone94 Oct 1, 2026
47f1aa1
merge: take the selected-models boundary fix from the slices below
jaeone94 Oct 1, 2026
ae0b82e
merge: take the mock typing and metadata coverage from the slices below
jaeone94 Oct 2, 2026
abce115
merge: take the detail preview hover ownership from the slices below
jaeone94 Oct 2, 2026
7922c94
test(templates): cover the input asset handoff and its graph lookup
jaeone94 Oct 2, 2026
9283ec3
test(templates): cover the input download store and its two UI branches
jaeone94 Oct 2, 2026
2a43226
[automated] Apply ESLint and Oxfmt fixes
actions-user Oct 2, 2026
d866491
test(templates): cover the unresolved input asset paths in Detail
jaeone94 Oct 2, 2026
80147fb
Merge remote-tracking branch 'origin/ryan-di/fe-1491-stack-06-input-a…
jaeone94 Oct 2, 2026
5a04650
docs(templates): state the constraint instead of narrating the bug
jaeone94 Oct 2, 2026
0e2d29a
merge: refresh against main through the stack
jaeone94 Oct 2, 2026
4ac455a
merge: take the preparation slice's main refresh and review fixes
jaeone94 Oct 3, 2026
427c2cb
merge: take the readiness slice's review fixes
jaeone94 Oct 3, 2026
b95dc05
merge: take the downloads slice's review fixes
jaeone94 Oct 3, 2026
a0329ab
merge: take the folder-path resolution from the model routing slice
jaeone94 Oct 3, 2026
342ca77
fix(templates): take DrJKL's mechanical findings on the input assets …
jaeone94 Oct 3, 2026
9472642
fix(templates): cover the input-sync paths DrJKL measured as untested
jaeone94 Oct 3, 2026
bd5bb24
fix(templates): rebind a template input the host already had
jaeone94 Oct 3, 2026
8555d5e
merge: take the download-tracker blocker fixes from the routing slice
jaeone94 Oct 3, 2026
e1b8a10
merge: take the fan-out isolation and progress-scale fixes from the d…
jaeone94 Oct 3, 2026
afe4062
revert(templates): drop the already-present rebind channel
jaeone94 Oct 3, 2026
5fb3d6a
chore(templates): keep the bridge augmentation matching the host
jaeone94 Oct 3, 2026
f1e04e3
docs(templates): cut comments the code already states
jaeone94 Oct 3, 2026
ed54209
merge: take the partial-metadata fix from the readiness slice
jaeone94 Oct 4, 2026
151f613
merge: take the model-type label fix from the downloads slice
jaeone94 Oct 4, 2026
5bcebb7
merge: refresh against main and drop the removed isCloud argument
jaeone94 Oct 4, 2026
c34a0b4
merge: take the tracked-row consolidation from the routing slice
jaeone94 Oct 4, 2026
67dd6df
merge: take the status story from the downloads slice
jaeone94 Oct 4, 2026
b6f2761
merge: take the rebase onto main from the downloads slice
jaeone94 Oct 4, 2026
991af91
merge: take the stateFor contract and Badge story from the routing slice
jaeone94 Oct 4, 2026
33925db
merge: take the retry-claim guard from the downloads slice
jaeone94 Oct 4, 2026
e434033
merge: take the ended-job guard from the downloads slice
jaeone94 Oct 4, 2026
8913cc2
merge: take the acceptsJob split from the downloads slice
jaeone94 Oct 4, 2026
dabdb85
merge: take the row-identity check from the downloads slice
jaeone94 Oct 4, 2026
1cefa85
merge: take the validator fold and wrapper removals from the download…
jaeone94 Oct 4, 2026
0b9007a
merge: take the Detail action-state story from the routing slice
jaeone94 Oct 4, 2026
7e38ea0
merge: take the snapshot-case removal from the downloads slice
jaeone94 Oct 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/builder/AppModeWidgetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useLinkStore } from '@/stores/linkStore'
import { graphScopeOf } from '@/types/graphScopeId'
import { useWidgetValueStore } from '@/stores/widgetValueStore'
import { useAppModeStore } from '@/stores/appModeStore'
import { useTemplateInputDownloadStore } from '@/stores/templateInputDownloadStore'
import { cn } from '@comfyorg/tailwind-utils'
import { HideLayoutFieldKey, WidgetHeightKey } from '@/types/widgetTypes'
import { UNASSIGNED_NODE_ID } from '@/types/nodeId'
Expand All @@ -44,6 +45,7 @@ const { mobile = false, builderMode = false } = defineProps<{
const { t } = useI18n()
const executionErrorStore = useExecutionErrorStore()
const appModeStore = useAppModeStore()
const templateInputDownloadStore = useTemplateInputDownloadStore()
const widgetValueStore = useWidgetValueStore()
const linkStore = useLinkStore()
const maskEditor = useMaskEditor()
Expand Down Expand Up @@ -119,7 +121,8 @@ function getDropIndicator(node: LGraphNode, id: WidgetId) {
mobile,
label: t,
onMaskEdit: maskEditor.openMaskEditor,
widgetValueStore
widgetValueStore,
previewRevision: templateInputDownloadStore.previewRevision
})
}

Expand Down
14 changes: 12 additions & 2 deletions src/components/builder/useLoaderDropIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ function buildMediaUrl(
mediaType: LoaderMediaType,
filename: string,
subfolder: string,
type: string
type: string,
previewRevision?: (filename: string) => number
) {
if (!filename) return undefined

const params = new URLSearchParams({ filename, subfolder, type })
appendCloudResParam(params, filename)
const revision = previewRevision?.(filename)
if (revision) params.set('template_input_revision', String(revision))
const previewParam = mediaType === 'image' ? app.getPreviewFormatParam() : ''
return api.apiURL(`/view?${params}${previewParam}`)
}
Expand All @@ -78,6 +81,7 @@ export function getLoaderDropIndicator(
label: (key: string) => string
onMaskEdit: (node: LGraphNode) => void
widgetValueStore: Pick<ReturnType<typeof useWidgetValueStore>, 'getWidget'>
previewRevision?: (filename: string) => number
}
): LoaderDropIndicator | undefined {
const config = LOADER_MEDIA_CONFIG[node.type]
Expand All @@ -91,7 +95,13 @@ export function getLoaderDropIndicator(
? parseImageWidgetValue(stringValue)
: { filename: '', subfolder: '', type: 'input' }

const mediaUrl = buildMediaUrl(config.mediaType, filename, subfolder, type)
const mediaUrl = buildMediaUrl(
config.mediaType,
filename,
subfolder,
type,
options.previewRevision
)

return {
iconClass: iconForMediaType(config.mediaType),
Expand Down
141 changes: 80 additions & 61 deletions src/components/custom/widget/WorkflowTemplateDetail.stories.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Meta, StoryObj } from '@storybook/vue3-vite'

import WorkflowTemplateDetail from '@/components/custom/widget/WorkflowTemplateDetail.vue'
import { i18n } from '@/i18n'
import type { TemplateDetailGroup } from '@/platform/workflow/templates/types/templateDetail'

const meta: Meta<typeof WorkflowTemplateDetail> = {
Expand All @@ -12,18 +13,17 @@ const meta: Meta<typeof WorkflowTemplateDetail> = {
export default meta
type Story = StoryObj<typeof meta>

/** Stands in for the template thumbnail the dialog passes through this slot. */
const withPreview = (args: Record<string, unknown>) => ({
const t = i18n.global.t

const withPreview: NonNullable<Story['render']> = (args) => ({
components: { WorkflowTemplateDetail },
setup: () => ({ args }),
template: `
<div style="height: 640px">
<div class="h-160">
<WorkflowTemplateDetail v-bind="args">
<template #preview>
<div
style="aspect-ratio: 16 / 10; display: grid; place-items: center;
background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
color: #64748b; font-size: 13px"
class="grid aspect-8/5 place-items-center bg-secondary-background text-xs text-muted-foreground"
>
Template preview
</div>
Expand All @@ -33,90 +33,109 @@ const withPreview = (args: Record<string, unknown>) => ({
`
})

const nodes: TemplateDetailGroup = {
id: 'nodes',
label: 'Nodes',
total: '3 nodes',
rows: [
{ id: 'n1', name: 'Load Checkpoint', description: 'Core' },
{ id: 'n2', name: 'KSampler', description: 'Core' },
{ id: 'n3', name: 'VAE Decode', description: 'Core' }
]
const checkpoint = {
id: 'm1',
name: 'sd_xl_base_1.0.safetensors',
description: 'checkpoints'
}
const vae = { id: 'm2', name: 'sdxl_vae.safetensors', description: 'vae' }

const installed = {
kind: 'installed',
label: t('templateWorkflows.detail.installed')
} as const

function models(
downloadable: boolean,
total = '2 models'
/**
* `buildTemplateDetailGroups` emits one `models` group, and its total only when
* every declaration carries a size - so the resolving case shows none.
*/
function modelsGroup(
rows: TemplateDetailGroup['rows'],
total?: string
): TemplateDetailGroup {
return {
id: 'models',
label: 'Models',
total,
rows: [
{
id: 'm1',
name: 'sd_xl_base_1.0.safetensors',
description: 'checkpoints',
status: downloadable
? {
kind: 'downloadable',
label: 'Download model',
downloadState: { status: 'idle', attempt: 0 }
}
: { kind: 'installed', label: 'Downloaded' }
},
{
id: 'm2',
name: 'sdxl_vae.safetensors',
description: 'vae',
status: { kind: 'installed', label: 'Downloaded' }
}
]
label: t('templateWorkflows.detail.models'),
...(total !== undefined && { total }),
rows
}
}

/** While resolving, no row has a resolved status yet. */
const unresolvedModels: TemplateDetailGroup = {
id: 'models',
label: 'Models',
total: '2 models',
rows: [
{
id: 'm1',
name: 'sd_xl_base_1.0.safetensors',
description: 'checkpoints'
},
{ id: 'm2', name: 'sdxl_vae.safetensors', description: 'vae' }
]
}

const base = {
title: 'SDXL Text to Image',
description:
'Generate an image from a text prompt with the SDXL base checkpoint.'
}

/** Nothing is missing, so the only action opens the template. */
/**
* Detail only opens when something is missing, so this state is a missing model
* that cannot be fetched automatically rather than a template with none.
*/
export const OpenNow: Story = {
args: { ...base, groups: [nodes, models(false)], modelSetupState: 'none' },
args: {
...base,
groups: [
modelsGroup(
[
{
...checkpoint,
status: {
kind: 'manual',
label: t('templateWorkflows.detail.unavailable'),
href: 'https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0'
}
},
{ ...vae, status: installed }
],
'6.94 GB'
)
],
modelSetupState: 'none'
},
render: withPreview
}

/** Availability is not known yet, so no download action is offered. */
/** Metadata is still resolving, so Download models & open is shown disabled. */
export const Resolving: Story = {
args: {
...base,
groups: [nodes, unresolvedModels],
groups: [
modelsGroup([
{
...checkpoint,
status: {
kind: 'unknown',
label: t('templateWorkflows.detail.unknown')
}
},
{ ...vae, status: installed }
])
],
modelSetupState: 'resolving'
},
render: withPreview
}

/** A missing model adds the bulk action and the per-row action beside it. */
/** A missing model adds the per-row action beside the bulk one. */
export const DownloadableRow: Story = {
args: {
...base,
groups: [nodes, models(true)],
groups: [
modelsGroup(
[
{
...checkpoint,
status: {
kind: 'downloadable',
label: t('templateWorkflows.detail.downloadModel'),
downloadState: { status: 'idle', attempt: 0 }
}
},
{ ...vae, status: installed }
],
'6.94 GB'
)
],
modelSetupState: 'downloadable'
},
render: withPreview
Expand Down
30 changes: 28 additions & 2 deletions src/components/custom/widget/WorkflowTemplateDetailGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,35 @@ const emit = defineEmits<{ 'download-model': [rowId: string] }>()
"
>
<span
class="flex size-10 shrink-0 items-center justify-center rounded-md bg-secondary-background text-muted-foreground"
class="flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-md bg-secondary-background text-muted-foreground"
>
<i aria-hidden="true" class="icon-[lucide--box] size-4" />
<img
v-if="row.kind === 'input' && row.preview?.mediaType === 'image'"
:src="row.preview.src"
alt=""
loading="lazy"
class="size-full object-cover"
/>
<video
v-else-if="
row.kind === 'input' && row.preview?.mediaType === 'video'
"
:src="row.preview.src"
aria-hidden="true"
muted
playsinline
preload="metadata"
class="size-full object-cover"
/>
<i
v-else
aria-hidden="true"
:class="
row.kind === 'input'
? 'icon-[lucide--file-input] size-4'
: 'icon-[lucide--box] size-4'
"
/>
</span>
<span class="flex min-w-0 flex-1 flex-col gap-0.5">
<span class="truncate text-sm" :title="row.name">{{ row.name }}</span>
Expand Down
Loading
Loading