Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c87ef56
perf: show downscaled previews for large images in Vue nodes
DrJKL Nov 11, 2026
6d78e97
fix: settle image previews when downscaling cannot finish
DrJKL Nov 11, 2026
4520016
test: keep the grid node count private to its fixture
DrJKL Nov 11, 2026
5a810e8
test: move image preview pan and zoom sweeps into the grid fixture
DrJKL Nov 11, 2026
d82fe46
test: register grid upload cleanup before uploading
DrJKL Nov 11, 2026
5f37295
test: assert mask layers load the original file; move benchmark field…
DrJKL Nov 11, 2026
520f05a
fix: keep animations, live previews and Vue copy at full fidelity
DrJKL Nov 12, 2026
3419ff7
test: wait for the downscale worker reply in the preview scope test
DrJKL Nov 12, 2026
aa3f57b
fix: detect animated images from their bytes and toast Vue copy failures
DrJKL Nov 12, 2026
0067cd5
fix: keep AVIF sequences animated and return decode failures as values
DrJKL Nov 12, 2026
47b2a42
fix: make image preview ownership and worker processing safe
DrJKL Nov 12, 2026
cf9e825
refactor: reuse image preview and benchmark helpers
DrJKL Nov 12, 2026
90126f2
fix: encode benchmark PNGs with node:zlib so e2e tooling resolves the…
DrJKL Nov 12, 2026
1eee698
refactor: scope image preview workers and localize fixtures
DrJKL Nov 12, 2026
0102b77
fix: keep preview display type private
DrJKL Nov 12, 2026
815f38d
feat: preload neighboring batch images on zoomed-in nodes and in the …
DrJKL Nov 12, 2026
7a2e87f
refactor: carry structured preview metadata through Vue nodes
DrJKL Nov 12, 2026
67f43bb
fix: keep widget-specific images out of generic previews
DrJKL Nov 12, 2026
cea2518
fix: preserve preview media types and fallback behavior
DrJKL Nov 12, 2026
9336f60
fix: preserve explicit media URLs without separate previews
DrJKL Nov 12, 2026
bac2c2f
Merge main into drjkl/structured-preview-metadata
DrJKL Nov 12, 2026
80c2e76
fix: exclude non-video outputs from node video previews
DrJKL Nov 12, 2026
3c2f480
refactor: centralize node preview URL policy
DrJKL Nov 12, 2026
ebf4f5a
refactor: name result item preview URL options
DrJKL Nov 12, 2026
04a81d4
Merge main into preview URL cleanup
DrJKL Nov 13, 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
13 changes: 4 additions & 9 deletions src/stores/nodeOutputStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import type {
} from '@comfyorg/api-client/executionTypes'
import type { ResultItemType } from '@comfyorg/api-client/resultItemTypeSchema'
import { parseNodeOutput } from '@/stores/resultItemParsing'
import { isHdrImageFilename } from '@/utils/hdrFormatUtil'
import { resultItemPreviewUrl, resultItemUrl } from '@/utils/resultItemUrl'
import { api } from '@/scripts/api'
import { useApp } from '@/scripts/appInstance'
Expand Down Expand Up @@ -203,14 +202,10 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
return {
...result,
url: result.url ?? resultItemUrl(result) + rand,
previewUrl:
result.previewUrl ??
(isHdrImageFilename(result.filename)
? resultItemPreviewUrl(result)
: (result.url ??
resultItemPreviewUrl(result) +
getPreviewParam(node, outputs) +
rand))
previewUrl: resultItemPreviewUrl(result, {
previewFormat: getPreviewParam(node, outputs),
rand
})
}
})
}
Expand Down
34 changes: 30 additions & 4 deletions src/utils/resultItemUrl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,30 @@ describe('resultItemPreviewUrl', () => {
'/api/view?filename=out.png&type=output&preview=webp;75&rand=second'
})
expect(resultItemPreviewUrl(item, { fullRes: true })).toBe(item.url)
expect(resultItemPreviewUrl(item)).toBe(item.previewUrl)
expect(
resultItemPreviewUrl(item, {
previewFormat: '&preview=webp;75',
rand: '&rand=ignored'
})
).toBe(item.previewUrl)
})

it('applies preview format and output revision to generated URLs', () => {
const url = new URL(
resultItemPreviewUrl(resultItem({ filename: 'out.png' }), {
previewFormat: '&preview=webp;75',
rand: '&rand=revision-2'
}),
window.location.origin
)

expect(Object.fromEntries(url.searchParams)).toMatchObject({
filename: 'out.png',
type: 'output',
subfolder: '',
preview: 'webp;75',
rand: 'revision-2'
})
})

it.for([
Expand All @@ -51,8 +74,11 @@ describe('resultItemPreviewUrl', () => {
)

it('resolves no preview for an HDR output without a stored preview', () => {
expect(resultItemPreviewUrl(resultItem({ filename: 'render.exr' }))).toBe(
''
)
expect(
resultItemPreviewUrl(resultItem({ filename: 'render.exr' }), {
previewFormat: '&preview=webp;75',
rand: '&rand=ignored'
})
).toBe('')
})
})
15 changes: 11 additions & 4 deletions src/utils/resultItemUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ export function resultItemUrl(item: AugmentedResultItem): string {
return api.apiURL('/view?' + resultItemUrlParams(item))
}

interface ResultItemPreviewUrlOptions {
fullRes?: boolean
previewFormat?: string
rand?: string
}

export function resultItemPreviewUrl(
item: AugmentedResultItem,
options: { fullRes?: boolean } = {}
options: ResultItemPreviewUrlOptions = {}
): string {
if (isHdrImageFilename(item.filename))
return (
Expand All @@ -31,10 +37,11 @@ export function resultItemPreviewUrl(
)
if (options.fullRes) return resultItemUrl(item)
if (item.previewUrl !== undefined) return item.previewUrl
if (!isImageResult(item)) return resultItemUrl(item)
if (item.url !== undefined) return item.url
const params = resultItemUrlParams(item)
appendCloudResParam(params, item.filename)
return api.apiURL('/view?' + params)
if (isImageResult(item)) appendCloudResParam(params, item.filename)
const url = item.filename ? api.apiURL('/view?' + params) : ''
return url + (options.previewFormat ?? '') + (options.rand ?? '')
}

export function resultItemVhsAdvancedPreviewUrl(
Expand Down
Loading