Commit Graph
4 Commits
Author SHA1 Message Date
ausboss 2a2b31721b Compare, preview bar and Save Image ignore late replies and stale paths
Review fixes for the preview-carrying nodes.

- Compare and the input preview bar no longer rebuild their panel when
  a workflow loads, and a late Align or Save reply is ignored after the
  panel is removed or the picture changes.
- The preview bar clears its picture when the preview switch is off
  and works when two nodes watch the same source.
- Save Image forgets the old saved path when the folder changes or a
  run saves nothing, and can no longer pick the same file number as
  Compare at the same time.
- Save Image accepts bfloat16 and single-channel images.
- A blank linked caption writes no caption file, and a caption file
  that already exists follows the "on existing" setting.

Tests: tests/preview_lifecycle.test.mjs covers the panel and reply
cases; tests/test_image_save_helpers.py covers the image types, the
numbering and the caption collisions; two cache tests now call the
middleware directly instead of starting a test server.

Caption behaviour changes as described above. No inputs, outputs or
mapping keys change.
2026-11-08 19:25:24 -06:00
ausboss 515b9ea4bd Frontend: use relative /scripts/ imports for subpath deployments (#276) (#282) 2026-11-05 00:31:20 -06:00
ausboss 8617fdc983 Version the pack's script imports so an update never meets old browser copies
ComfyUI sends no cache header for .mjs, and the 2.5.1 no-cache header cannot
reach a copy the browser already stored. Firefox then kept running files from
before the update, even through Ctrl+Shift+R, and the preview bar, cards and
editors failed to load.

The server now adds ?v=<tag> to the relative .mjs imports of the pack's
scripts as it serves them. The tag changes whenever any script changes, so
after an update the browser asks for addresses it has never stored. Files on
disk are unchanged. A test fails if a script names a .mjs in a way the tag
would miss.
2026-10-01 17:41:54 -05:00
ausboss a1e6940deb Keep the browser from running old frontend files after an update
ComfyUI sends no cache header for .mjs, so after a Manager update a browser
could reuse old shared modules while loading the new entry scripts. The new
entries then imported functions the old modules lack and about a third of the
pack stopped loading.

The pack now serves its .mjs files with Cache-Control: no-cache, and a small
entry (js/cache_guard) refreshes the stored copies and asks for a reload when
a tab runs older files than the installed version. It replaces the old
stale-cache toast in the appearance entry.
2026-10-01 09:10:47 -05:00