Compare commits

..
217 Commits
Author SHA1 Message Date
m0rtus59 59e69ffebe Merge pull request #20 from m0rtus59/docs/icon-and-banner
Docs/icon and banner
2026-11-23 00:43:48 +05:00
m0rtus59 f5aacadd34 Merge pull request #19 from m0rtus59/docs/queue-controls-overview
Docs/queue controls overview
2026-11-23 00:42:58 +05:00
m0rtus59 b9a0271fca Merge pull request #18 from m0rtus59/experimental/gallery-similar-preview-navigation
Experimental/gallery similar preview navigation
2026-11-23 00:42:15 +05:00
Claude b2822c6af7 Bump version to 1.9.0 2026-11-22 19:40:31 +00:00
Claude 1c5f0e135e pyproject: add Registry Banner (21:9) 2026-11-22 19:39:35 +00:00
Claude 9685fa53b4 Branding: new Comfy Sidebar icon (yellow wordmark) and 21:9 banner; banner at top of README 2026-11-22 19:37:20 +00:00
Claude eda45eaa6f docs: Queue overview with batch widget pointer and Ctrl actions; mention Move to Outputs in README 2026-11-22 19:20:13 +00:00
m0rtus59 ddd15259e0 Hide avatar button without relying on localized labels 2026-11-22 22:52:55 +05:00
m0rtus59 2cda35562a Translate Hide Run on Comfy Cloud setting 2026-11-22 22:46:11 +05:00
m0rtus59 9e6672cddd Translate Hide Run on Comfy Cloud setting 2026-11-22 22:46:08 +05:00
m0rtus59 2beae3a017 Translate Hide Run on Comfy Cloud setting 2026-11-22 22:46:06 +05:00
m0rtus59 ee7768120a Translate Hide Run on Comfy Cloud setting 2026-11-22 22:46:04 +05:00
m0rtus59 a270c268ba Translate Hide Run on Comfy Cloud setting 2026-11-22 22:46:02 +05:00
m0rtus59 c8496a0d2c Translate Hide Run on Comfy Cloud setting 2026-11-22 22:46:00 +05:00
m0rtus59 9df90421c3 Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:58 +05:00
m0rtus59 5354fe7854 Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:56 +05:00
m0rtus59 b4b4bb2ed9 Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:44 +05:00
m0rtus59 ce414d710a Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:42 +05:00
m0rtus59 37569315bd Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:40 +05:00
m0rtus59 867adcfc8d Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:38 +05:00
m0rtus59 7d684125a6 Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:36 +05:00
m0rtus59 e8873eeb83 Translate Hide Run on Comfy Cloud setting 2026-11-22 22:45:34 +05:00
m0rtus59 79bd741f77 Add Hide junk setting for Comfy Cloud button 2026-11-22 22:45:09 +05:00
m0rtus59 33951dd82a Add Hide junk support for Comfy Cloud button 2026-11-22 22:45:07 +05:00
m0rtus59 4aeeccb11f Match Active queue button without translated text 2026-11-22 22:45:05 +05:00
m0rtus59 190f1ff999 Add translations for experimental gallery and preview UI 2026-11-22 22:24:18 +05:00
m0rtus59 f134976f6b Add translations for experimental gallery and preview UI 2026-11-22 22:24:16 +05:00
m0rtus59 f6a97a8f4d Add translations for experimental gallery and preview UI 2026-11-22 22:24:14 +05:00
m0rtus59 bbbd27c2f7 Add translations for experimental gallery and preview UI 2026-11-22 22:24:13 +05:00
m0rtus59 3d391bfff3 Add translations for experimental gallery and preview UI 2026-11-22 22:24:11 +05:00
m0rtus59 5b1118c962 Add translations for experimental gallery and preview UI 2026-11-22 22:24:09 +05:00
m0rtus59 1df1d5f47e Add translations for experimental gallery and preview UI 2026-11-22 22:24:07 +05:00
m0rtus59 ce2c16a4a4 Add translations for experimental gallery and preview UI 2026-11-22 22:23:56 +05:00
m0rtus59 3d8af78a12 Add translations for experimental gallery and preview UI 2026-11-22 22:23:54 +05:00
m0rtus59 ca3cc677a6 Add translations for experimental gallery and preview UI 2026-11-22 22:23:52 +05:00
m0rtus59 023638664c Add translations for experimental gallery and preview UI 2026-11-22 22:23:50 +05:00
m0rtus59 539518498e Add translations for experimental gallery and preview UI 2026-11-22 22:23:48 +05:00
m0rtus59 25169294ab Add translations for experimental gallery and preview UI 2026-11-22 22:23:46 +05:00
m0rtus59 50b804f4c6 Add translations for experimental gallery and preview UI 2026-11-22 22:23:44 +05:00
m0rtus59 deb7ec052b Add translations for experimental gallery and preview UI 2026-11-22 22:23:20 +05:00
m0rtus59 f574fe75b0 Add translations for experimental gallery and preview UI 2026-11-22 22:23:18 +05:00
m0rtus59 8b46e8c0eb Add translations for experimental gallery and preview UI 2026-11-22 22:23:16 +05:00
m0rtus59 0817beff1b Add translations for experimental gallery and preview UI 2026-11-22 22:23:14 +05:00
m0rtus59 f0a0e9cc4e Add translations for experimental gallery and preview UI 2026-11-22 22:23:12 +05:00
m0rtus59 cb65684554 Add translations for experimental gallery and preview UI 2026-11-22 22:23:09 +05:00
m0rtus59 6f97a9c8a5 Add Move to Outputs action to batch inspect cards 2026-11-22 21:56:42 +05:00
Claude 8310c95f95 docs: add Gallery controls overview image to the README 2026-11-22 15:16:09 +00:00
Claude 43cd6660ae docs: refresh Queue controls overview (new header buttons, accurate pointers) 2026-11-22 15:06:37 +00:00
m0rtus59 99f1dcf2e4 Merge pull request #17 from m0rtus59/fix/gallery-toggle-register-unregister
Fix 'Enable Output Gallery Sidebar' toggle
2026-11-22 18:52:20 +05:00
Claude 22b2fdc748 Fix 'Enable Output Gallery Sidebar' toggle: register/unregister the tab instead of hiding its button
The setting hid the tab button by scanning the sidebar DOM for the first button
whose data-tab-id, title or icon looked like the gallery, once, and (on startup)
after a fixed 50ms. The sidebar renders asynchronously and re-renders on its own,
so the button reappeared after reload, and the loose match could hide a different
tab's button. Now the tab is registered only while the setting is on and
unregistered when it is turned off, so state no longer depends on DOM timing.
A disabled gallery also no longer builds its view at startup.
2026-11-22 09:54:00 +00:00
Claude bfa59866af Faster card hover: near-instant spotlight/border on enter, quicker fade-out 2026-11-22 09:48:24 +00:00
Claude b3d3750f1e Card action buttons: no slide/grow on Ctrl, fade instead
The Ctrl delete state swapped width/padding/border on a button that has no
label in Similar Prompts, so with 'transition: all' it snapped to icon width
and then grew back, looking like the button was replaced. Action buttons now
keep a constant border-box (transparent border) and only transition colors,
the wider Ctrl layout is applied only to buttons that actually gain a text
label, and elements that appear in Ctrl mode use a shared fade-in.
2026-11-22 09:43:20 +00:00
Claude 2d9449a0ff Similar Prompts: justified row layout instead of vertical masonry columns
Groups are wide and short, so cards now flow left to right in rows that wrap,
each sized from its real aspect ratio (equal height per row, last row keeps
natural size). PNG dimensions are read from the IHDR header, cached with the
prompt text, and sent with each item, so layout is exact before images load.
Card size slider now sets the target row height.
2026-11-22 09:30:40 +00:00
Claude fa8152c030 Similar Prompts: ignore boilerplate text shared verbatim by many different images
LLM enhancer meta-prompts are stored in every image made with them, which put
all of those images in one 100% group. Cache the prompt as separate segments
(one per text input, interned) and, before grouping, drop any segment that at
least 3 images share while being otherwise different from each other. Identical
prompts across a seed sweep are still kept, so real duplicates are found.
2026-11-22 09:23:18 +00:00
Claude ebf0c0ea28 Similar Prompts: masonry layout, fix gallery teardown crash, faster grouping
- Lay out each group with shortest-column masonry (like Gallery/Queue) instead of a uniform CSS grid; relayout on resize and card-size change
- Fix ReferenceError in teardownGalleryView (similarPromptsDialog was never declared); track the dialog and prevent duplicate opens
- Deleting an image now updates the group's count and removes empty groups
- Replace O(n^2) preview asset lookup with index
- prompt_search: count shared tokens via the inverted index and prune by size ratio instead of building/intersecting sets per pair (identical output, ~2.5-6x faster)
- Drop unused showFullscreenPreview import in galleryView
2026-11-22 09:10:51 +00:00
m0rtus59 fb8f8dcf81 Remove optical offset from preview trash icon 2026-11-22 13:57:11 +05:00
m0rtus59 042b8fb35d Fix preview stacking and delete control alignment 2026-11-22 13:51:53 +05:00
m0rtus59 5550aae5d7 Expose delete confirmation state to preview controls 2026-11-22 13:51:51 +05:00
m0rtus59 cfac1f8d03 Normalize nested paths before sending files to Recycle Bin 2026-11-22 13:39:03 +05:00
m0rtus59 2a586cfa39 Style fullscreen preview delete confirmation 2026-11-22 13:39:02 +05:00
m0rtus59 4a1f69f1ca Keep fullscreen previews above lower-priority overlays 2026-11-22 13:39:00 +05:00
m0rtus59 fc03bf2262 Polish fullscreen preview controls and keyboard delete feedback 2026-11-22 13:38:58 +05:00
m0rtus59 6f24fdbf1a Enable deleting the selected runtime preview image 2026-11-22 13:22:09 +05:00
m0rtus59 62e212ca02 Match preview control sizing to the close button 2026-11-22 13:21:36 +05:00
m0rtus59 0dd346bd83 Keep preview selection anchored to the clicked sidebar item 2026-11-22 13:21:15 +05:00
m0rtus59 a9f1fcb3f6 Align preview delete control with the shared overlay buttons 2026-11-22 13:21:13 +05:00
m0rtus59 064b917074 Delete the selected Similar Prompts group image only 2026-11-22 13:20:47 +05:00
m0rtus59 a3c0621fbf Keep preview deletion tied to the selected sidebar card 2026-11-22 13:20:45 +05:00
m0rtus59 438fc2820e Persist Similar Prompts viewer preferences 2026-11-22 13:20:28 +05:00
m0rtus59 08f7ebec51 Navigate and delete visible sidebar preview items 2026-11-22 13:20:25 +05:00
m0rtus59 ee1c613dab Add delete controls to fullscreen previews 2026-11-22 13:20:24 +05:00
m0rtus59 8ddc22ae7d Tweak group status spacing and themed slider accent 2026-11-22 13:02:54 +05:00
m0rtus59 3ae1109ca2 Polish full-width group overlay controls 2026-11-22 12:54:44 +05:00
m0rtus59 6d92775d6a Use full shared overlay for Similar Prompts 2026-11-22 12:54:35 +05:00
m0rtus59 0e3fd15987 Move Similar Prompts into shared overlay stack 2026-11-22 12:41:06 +05:00
m0rtus59 69869fd778 Use shared overlay for similar prompt groups 2026-11-22 12:40:41 +05:00
m0rtus59 d184bdb861 Support stacked sidebar overlays 2026-11-22 12:40:39 +05:00
m0rtus59 0adc42371f Polish Similar Prompts modal backdrop 2026-11-22 12:29:52 +05:00
m0rtus59 1106e366ff Use native modal and Gallery cards in Similar Prompts 2026-11-22 12:29:44 +05:00
m0rtus59 90aa5e3759 Fix Similar Prompts module import path 2026-11-22 12:14:03 +05:00
m0rtus59 ac7a83ce46 Preserve current Gallery folder in Similar Prompts finder 2026-11-22 12:04:39 +05:00
m0rtus59 425c5a1d39 Move Similar Prompts dialog out of Gallery view 2026-11-22 12:04:22 +05:00
m0rtus59 3800c54a44 Extract Similar Prompts dialog into dedicated module 2026-11-22 12:04:17 +05:00
m0rtus59 6e0102d59e Polish similar prompt cards and spotlight glow 2026-11-22 12:04:04 +05:00
m0rtus59 a15c417701 Fix Queue preview navigation and preload next image 2026-11-22 12:04:02 +05:00
m0rtus59 326d18cadf Improve similar prompt cards and add safe delete controls 2026-11-22 11:42:31 +05:00
m0rtus59 22fd5d819d Add image navigation to runtime Queue preview 2026-11-22 11:42:22 +05:00
m0rtus59 23536657e7 Use angle-bracket preview navigation controls 2026-11-22 01:58:50 +05:00
m0rtus59 187d44cf36 Keep preview navigation index aligned with filtered images 2026-11-22 01:58:23 +05:00
m0rtus59 ca7742858c Cancel superseded similarity scans 2026-11-22 01:57:50 +05:00
m0rtus59 384ad09107 Use an isolated native Comfy dialog for similar prompts 2026-11-22 01:57:28 +05:00
m0rtus59 a28b51249f Center fitted runtime previews independently of image zoom 2026-11-22 01:57:08 +05:00
m0rtus59 fdefa9aae9 Optimize similarity group scoring 2026-11-22 01:56:15 +05:00
m0rtus59 dc513a0199 Stop Gallery prompt scan when dialog request is cancelled 2026-11-22 01:55:45 +05:00
m0rtus59 4c44af1486 Keep runtime fit mode separate from saved zoom state 2026-11-22 01:54:48 +05:00
m0rtus59 90ad6aac23 Keep runtime preview cursor in fit mode 2026-11-22 01:54:22 +05:00
m0rtus59 f681a80148 Open prompt-group images in the preview viewer 2026-11-22 01:54:20 +05:00
m0rtus59 869dfcf78a Tune common-token filtering for prompt groups 2026-11-22 01:54:18 +05:00
m0rtus59 9b56ff7dd0 Add preview navigation and runtime fit mode 2026-11-22 01:53:27 +05:00
m0rtus59 aed377f327 Pass sibling images to fullscreen preview navigation 2026-11-22 01:52:41 +05:00
m0rtus59 92716efb26 Add native similar-prompts Gallery popup 2026-11-22 01:52:30 +05:00
m0rtus59 08b911377a Expose Gallery similar prompt endpoint 2026-11-22 01:51:29 +05:00
m0rtus59 ef45f9266c Add similar prompt grouping helper 2026-11-22 01:51:27 +05:00
m0rtus59 398c8c4adc Merge pull request #16 from m0rtus59/feature/about-version-badge
Show ComfySidebar build version in About panel
2026-11-19 22:07:51 +05:00
m0rtus59 2b265aaf40 Fix version string parsing 2026-11-19 21:56:36 +05:00
m0rtus59 9567209ce4 Fix pyproject version parsing 2026-11-19 21:56:29 +05:00
m0rtus59 a83c0f82ea Show build version in ComfyUI About panel 2026-11-19 21:56:15 +05:00
m0rtus59 a13030b96b Expose extension version and commit metadata 2026-11-19 21:56:13 +05:00
M0rtus59 0007ec0081 version bump to 1.8.7 2026-11-19 21:46:35 +05:00
m0rtus59 0fb27c758b Merge pull request #15 from m0rtus59/feature/clean-history-dropdown
Preserve Outputs during Queue cleanup
2026-11-19 21:43:00 +05:00
m0rtus59 cfff37e770 Refresh intermediate buttons after TEMP cleanup 2026-11-19 21:37:23 +05:00
m0rtus59 f85cdce3a1 Add intermediate result revalidation after cleanup 2026-11-19 21:37:20 +05:00
m0rtus59 b15b106d22 Remove obsolete TEMP directory deletion helper 2026-11-19 21:20:09 +05:00
m0rtus59 1802efc3c6 Remove unused whole-TEMP cleanup endpoints 2026-11-19 21:20:06 +05:00
m0rtus59 30d94822da Translate Clear All confirmation (zh) 2026-11-19 21:19:23 +05:00
m0rtus59 a82b134326 Translate Clear All confirmation (zh-tw) 2026-11-19 21:19:20 +05:00
m0rtus59 9c5f34ed65 Translate Clear All confirmation (tr) 2026-11-19 21:19:18 +05:00
m0rtus59 c077861199 Translate Clear All confirmation (pt-br) 2026-11-19 21:19:15 +05:00
m0rtus59 d84a1f03af Translate Clear All confirmation (ko) 2026-11-19 21:19:12 +05:00
m0rtus59 79f49c013c Translate Clear All confirmation (ja) 2026-11-19 21:19:09 +05:00
m0rtus59 0a857144c0 Translate Clear All confirmation (it) 2026-11-19 21:19:07 +05:00
m0rtus59 96da8b9a8d Translate Clear All confirmation (he) 2026-11-19 21:19:02 +05:00
m0rtus59 455256c94f Translate Clear All confirmation (fr) 2026-11-19 21:18:59 +05:00
m0rtus59 022a1e0ce1 Translate Clear All confirmation (fa) 2026-11-19 21:18:57 +05:00
m0rtus59 cc2f59f508 Translate Clear All confirmation (es) 2026-11-19 21:18:54 +05:00
m0rtus59 a9de31753e Translate Clear All confirmation (ar) 2026-11-19 21:18:52 +05:00
m0rtus59 2ab5879431 Translate Clear All confirmation (ru) 2026-11-19 21:18:49 +05:00
m0rtus59 125302f04b Translate Clear All confirmation (en) 2026-11-19 21:18:47 +05:00
m0rtus59 feaafe0609 Use shared cleanup for Clear All History 2026-11-19 21:18:35 +05:00
m0rtus59 194c5e9530 Clean card TEMP files and sweep missing cards 2026-11-19 21:18:33 +05:00
m0rtus59 7e400a2146 Make temporary cleanup preserve Output-backed cards 2026-11-19 21:18:31 +05:00
m0rtus59 7d1b135fd4 Add TEMP cleanup translations (zh) 2026-11-19 21:17:57 +05:00
m0rtus59 bb0aa7b30b Add TEMP cleanup translations (zh-tw) 2026-11-19 21:17:55 +05:00
m0rtus59 3d0bee2e72 Add TEMP cleanup translations (tr) 2026-11-19 21:17:52 +05:00
m0rtus59 32bd1c0cc6 Add TEMP cleanup translations (pt-br) 2026-11-19 21:17:49 +05:00
m0rtus59 2f13e59279 Add TEMP cleanup translations (ko) 2026-11-19 21:17:47 +05:00
m0rtus59 5073983790 Add TEMP cleanup translations (ja) 2026-11-19 21:17:44 +05:00
m0rtus59 ce5dcbace7 Add TEMP cleanup translations (it) 2026-11-19 21:17:32 +05:00
m0rtus59 f81abfa7cf Add TEMP cleanup translations (he) 2026-11-19 21:17:29 +05:00
m0rtus59 1ab93d2e8a Add TEMP cleanup translations (fr) 2026-11-19 21:17:27 +05:00
m0rtus59 77ddd4ff49 Add TEMP cleanup translations (fa) 2026-11-19 21:17:24 +05:00
m0rtus59 15ed5c11ab Add TEMP cleanup translations (es) 2026-11-19 21:17:22 +05:00
m0rtus59 f872b3bf02 Add TEMP cleanup translations (ar) 2026-11-19 21:17:19 +05:00
m0rtus59 257e43e82c Treat vanished TEMP entries as already cleared 2026-11-19 20:44:12 +05:00
m0rtus59 4c52f0e915 Skip linked TEMP entries during cleanup 2026-11-19 20:43:34 +05:00
m0rtus59 a60ff98618 Route Clear All History through TEMP cleanup 2026-11-19 20:43:22 +05:00
m0rtus59 d1eb10812f Fix locale JSON separator 2026-11-19 20:43:07 +05:00
m0rtus59 ab11e82554 Fix locale JSON separator 2026-11-19 20:43:04 +05:00
m0rtus59 9853e82174 Fix newline in TEMP deletion handler 2026-11-19 20:43:01 +05:00
m0rtus59 668c14b52e Add Clear All TEMP cleanup translations 2026-11-19 20:42:48 +05:00
m0rtus59 2ea065e54c Add Clear All TEMP cleanup translations 2026-11-19 20:42:45 +05:00
m0rtus59 6de1d36f5e Expand Clear All History to clean TEMP 2026-11-19 20:42:39 +05:00
m0rtus59 efc408b3f2 Add full TEMP directory cleanup 2026-11-19 20:42:33 +05:00
m0rtus59 dc2e1a1373 Reuse disk deletion policy for TEMP cleanup 2026-11-19 20:42:22 +05:00
m0rtus59 ea7acc0962 Add safe TEMP directory cleanup endpoints 2026-11-19 20:42:14 +05:00
m0rtus59 0310096066 Merge pull request #13 from m0rtus59/feature/clean-history-dropdown
Add Clear Temporary button (replaces cleanup dropdown)
2026-11-19 19:42:41 +05:00
Claude fd830f2236 Replace clean dropdown with a Clear Temporary button
- Drop the three-option dropdown; restore plain header buttons
- Add Clear Temporary: removes finished cards that hold nothing saved
  (text-only cards and cards whose files are all in TEMP) together with
  those temp files; a card with any file in Outputs is kept
- Reuse the existing Recycle Bin / permanent delete setting and the trash
  fallback dialog; cards whose files could not be deleted are kept
- Show the card count in the tooltip on the first press, skip arming when
  there is nothing to clear
- Move the renumber button out of the header (Alt+R and the command/context
  menu entries are unchanged)
2026-11-19 14:12:33 +00:00
m0rtus59 1d3e317d5c Preserve cards with intermediate media outputs 2026-11-17 00:17:50 +05:00
m0rtus59 a0c93d1fbb Reset clean confirmations when menu closes 2026-11-17 00:16:09 +05:00
m0rtus59 72466f5512 Remove obsolete clean-button helper 2026-11-17 00:14:17 +05:00
m0rtus59 b70a188f61 Replace history clear buttons with three-option dropdown 2026-11-17 00:13:00 +05:00
m0rtus59 5c5558dc9b Add text-only history cleanup action 2026-11-17 00:12:58 +05:00
m0rtus59 e14d6588bc Add targeted text-only history cleanup 2026-11-17 00:12:56 +05:00
m0rtus59 0d6c594589 Merge pull request #12 from m0rtus59/fix/queue-cleanup
Queue: keep card on cancelled delete, clean up missing files, fix history limit and workflow loss
2026-11-16 18:25:33 +05:00
m0rtus59 877dff6fc7 Merge pull request #11 from m0rtus59/fix/backend-hardening
Land backend hardening on main (was merged into the wrong branch) and untrack tests/
2026-11-16 18:23:20 +05:00
Claude 77fbe6cf98 Queue: keep cards on cancelled delete, clean up missing files, fix history limit and workflow loss
1. Cancelling the Recycle Bin dialog no longer removes the card. Disk deletion now runs
   before the card animation and the card is only removed if nothing was left undeleted;
   an already-missing file (404) counts as done. Shared helper deleteFilesWithFeedback.

2. Cards whose output files are gone (TEMP cleared) are cleaned up again, but verified:
   new POST /comfy-sidebar/files-exist lets the client confirm with the server instead of
   trusting a single failed image request (the reason history was previously kept). Runs once
   after history loads and when a card's last image fails. Completed jobs only; text-only jobs
   and cancelled/failed cards are never removed. New setting 'Remove Cards With Missing Files'
   (default on). When off, the card is kept text-only.

3. History limit evicted the wrong cards after a reload: the server keeps runs the sidebar
   already pruned; re-adding them as new gave them higher sequence numbers than saved cards,
   so the newest runs were pruned. History older than a known card now only fills free slots
   and ranks below existing cards.

4. Workflow is kept in storage unless it can be re-read from a saved output PNG (text-only,
   temp previews, video/webp, failed jobs). On storage quota errors, old workflows are shed
   before any card is dropped.
2026-11-15 18:02:24 +00:00
Claude 6e918fae79 Merge main into fix/backend-hardening 2026-11-15 17:59:13 +00:00
Claude 5ba50a29c8 Stop tracking tests/ and ignore it
The test suite stays on disk locally (python -m unittest discover -s tests) but is no longer part of the repository.
2026-11-15 17:55:57 +00:00
m0rtus59 82322f2e73 version grep hardening 2026-11-15 18:15:21 +05:00
m0rtus59 0524ae0d87 Merge pull request #9 from m0rtus59/feat/delete-fallback-dialog
Ask before falling back when the Recycle Bin can't be used
2026-11-15 17:49:49 +05:00
m0rtus59 2e237f500f Merge pull request #8 from m0rtus59/fix/new-workflow-picker-trigger
Only open the quick workflow picker for new blank workflows
2026-11-15 17:39:33 +05:00
m0rtus59 91c929fde0 Merge pull request #7 from m0rtus59/fix/review-findings
Fix undefined references, preview reload loop, TDZ crash and markdown/innerHTML injection
2026-11-15 17:11:38 +05:00
Claude fd8389df94 Normalize __init__.py to LF and add .gitattributes
__init__.py mixed CRLF (most of the file) with LF (newer endpoints). Everything else in the
repo is LF. Whitespace-only change; use 'git diff -w' or 'git show -w' to review.
2026-11-15 11:24:20 +00:00
Claude 8fe8f5ab07 Harden file endpoints: no overwrites, exact sources, JSON-only POSTs
- promote-output: resolve exactly <root for type>/<subfolder>/<file> instead of the lenient
  multi-root search (which could copy a same-named file from another folder); never overwrite
  an existing input file (a different image gets ' (1)', an identical one is reused).
- gallery/list: realpath the output dir first; a symlinked/junctioned output folder produced
  '../..' subfolder values.
- All POST endpoints require Content-Type: application/json (forces a CORS preflight for
  cross-site requests) and a JSON object body.
- move-temp-to-output: a locked source file (Windows) no longer rolls back a successful copy.
- Share the unique-name reservation between promote and move-temp; import shutil/filecmp at
  module level.
- CI: anchor the version grep in publish_action.yml to the 'version =' line.

Adds tests for all of the above.
2026-11-15 11:24:13 +00:00
Claude 411bb83fe2 Remove unused imports; rename leaked moonCopyCode global
ESLint (no-unused-vars) found 9 unused imports. Also window.moonCopyCode (a leftover
name) is now window.comfySidebarCopyCode.
2026-11-15 11:24:00 +00:00
Claude a3d67f9433 Ask before falling back when the Recycle Bin can't be used
Previously, if send2trash was missing or raised, delete-file silently fell back to
os.remove, permanently deleting a file the user had only asked to trash.

Server: never fall back on its own. Return 409 with code trash_unavailable
(send2trash not installed) or trash_failed, plus the error and the Python
executable. 'permanent' must now be a real boolean true.

Client: deleteFileOnServer shows a dialog offering to turn on direct deletion
(saves the setting and retries), to retry after fixing send2trash (shows the exact
pip command for ComfyUI's Python), or to cancel. After Cancel, the rest of a
batch delete stays quiet instead of asking for every file.

Adds a stubbed-ComfyUI test harness (python -m unittest discover -s tests) and
en/ru strings; other locales fall back to English.
2026-11-14 17:18:46 +00:00
Claude bd80d4dde7 Only open the quick workflow picker for new blank workflows
ComfyUI calls workflowStore.createNewTemporary for every new unsaved tab, including
loaded files, templates, the default graph and duplicates. The picker treated that
action name as an explicit "new blank workflow" signal, so it opened for all of them.

Inspect the action arguments instead: a name (file load/duplicate) or a graph that
already has nodes/subgraphs is not a blank workflow.
2026-11-14 17:16:27 +00:00
Claude e3c9270879 Fix undefined references, preview reload loop, TDZ crash and markdown/innerHTML injection
- executionTracker: import SettingIds (execution_start/executing handlers threw ReferenceError)
- galleryView: import copyImageToClipboard (Copy button was dead)
- sidebar: hoist setGalleryButtonVisible to module scope (was out of scope at call site)
- comparison: call showPlaceholder() after slider/cleanupMedia exist (TDZ crash with empty source)
- mediaPreview: fix always-true src comparison that reloaded videos every render
- mediaPreview: render folder name via textContent (folder names are workflow-controlled)
- text_reader: block quote/angle chars in link URLs (attribute injection), disallow
  protocol-relative links, stop underscore emphasis eating snake_case, URLs and code
- mediaActions: findNodeIdForImage also matches subfolder
2026-11-14 16:52:08 +00:00
m0rtus59 c50e0dbca6 Merge branch 'feature/queue-move-temp-to-output' 2026-11-14 13:48:40 +05:00
m0rtus59 b01a60b03a Bump version to 1.8.6 2026-11-14 13:47:43 +05:00
m0rtus59 e0b248b02e Preload moved image before refreshing Queue preview 2026-11-14 13:36:10 +05:00
m0rtus59 2af0b1d69b Keep existing media visible during Queue preview updates 2026-11-14 13:36:00 +05:00
m0rtus59 d31a0592dd Preserve existing Turkish locale entries and add Move to Outputs translations 2026-11-14 13:11:32 +05:00
m0rtus59 4f5786744e Compare against current media element URL for stale errors 2026-11-14 13:10:38 +05:00
m0rtus59 e46da79bbf Ignore stale media errors after moving images 2026-11-14 13:10:32 +05:00
m0rtus59 02872fa2a9 Polish localized move action and cleanup imports 2026-11-14 13:09:51 +05:00
m0rtus59 d18757b77c Polish localized move action and cleanup imports 2026-11-14 13:09:48 +05:00
m0rtus59 7f0c74aa01 Polish localized move action and cleanup imports 2026-11-14 13:09:46 +05:00
m0rtus59 832f24e04c Preserve intermediate batch navigation after missing image 2026-11-14 13:09:31 +05:00
m0rtus59 cfed7ad464 Update node output references before selected image 2026-11-14 13:09:15 +05:00
m0rtus59 a463bbec8a Translate Move to Outputs action (zh) 2026-11-14 13:09:01 +05:00
m0rtus59 a9382dc969 Translate Move to Outputs action (zh-tw) 2026-11-14 13:08:59 +05:00
m0rtus59 cb1823f216 Translate Move to Outputs action (tr) 2026-11-14 13:08:57 +05:00
m0rtus59 fcf31d2f4f Translate Move to Outputs action (ru) 2026-11-14 13:08:54 +05:00
m0rtus59 66df393360 Translate Move to Outputs action (pt-br) 2026-11-14 13:08:52 +05:00
m0rtus59 eae77b683d Translate Move to Outputs action (ko) 2026-11-14 13:08:45 +05:00
m0rtus59 3852b71e0c Translate Move to Outputs action (ja) 2026-11-14 13:08:43 +05:00
m0rtus59 9c949edc7b Translate Move to Outputs action (it) 2026-11-14 13:08:41 +05:00
m0rtus59 ae0d068e08 Translate Move to Outputs action (he) 2026-11-14 13:08:39 +05:00
m0rtus59 16e321d19a Translate Move to Outputs action (fr) 2026-11-14 13:08:36 +05:00
m0rtus59 6bb94886b3 Translate Move to Outputs action (fa) 2026-11-14 13:08:34 +05:00
m0rtus59 5e04a25b23 Translate Move to Outputs action (es) 2026-11-14 13:08:32 +05:00
m0rtus59 ce58fff869 Translate Move to Outputs action (en) 2026-11-14 13:08:29 +05:00
m0rtus59 501d34a36d Translate Move to Outputs action (ar) 2026-11-14 13:08:27 +05:00
m0rtus59 dd6652c5fd Preserve Queue history when output files are missing 2026-11-14 13:08:13 +05:00
m0rtus59 24a0ae5ae8 Add Move to Outputs to intermediate output cards 2026-11-14 13:07:33 +05:00
m0rtus59 d1d6739764 Style the Move to Outputs label 2026-11-14 13:07:17 +05:00
m0rtus59 9134a59aa1 Refine Queue move action and avoid card refresh flicker 2026-11-14 13:07:14 +05:00
m0rtus59 abbb7866b2 Add shared image-reference update helper 2026-11-14 13:07:11 +05:00
m0rtus59 914cf661b3 Hide Move to Outputs unless Ctrl is held 2026-11-14 11:20:16 +05:00
m0rtus59 34977f26a1 Keep Move to Outputs visibility in sync with selected batch image 2026-11-14 11:19:43 +05:00
m0rtus59 0a0fcd580d Add English strings for Move to Outputs action 2026-11-14 11:19:21 +05:00
m0rtus59 2a6a3fcabb Style Queue temp-to-output Ctrl action 2026-11-14 11:19:17 +05:00
m0rtus59 0563af7123 Add Ctrl+Click Move to Outputs action to Queue cards 2026-11-14 11:19:15 +05:00
m0rtus59 944fa74601 Add Queue temp image move request helper 2026-11-14 11:19:13 +05:00
m0rtus59 cd8bc7a201 Add safe temp-to-output image move endpoint 2026-11-14 11:19:09 +05:00
m0rtus59 ec13f830f2 fixed strings for EN locale 2026-11-14 02:38:36 +05:00
62 changed files with 3330 additions and 733 deletions
+5
View File
@@ -0,0 +1,5 @@
# Keep the repository on LF so files never end up with mixed line endings.
* text=auto eol=lf
*.png binary
*.jpg binary
*.webp binary
+3 -2
View File
@@ -28,8 +28,9 @@ jobs:
- name: Extract Version
id: get_version
run: |
VERSION=$(grep -m 1 'version' pyproject.toml | cut -d '"' -f 2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
VERSION=$(sed -n '/^\[project\]/,/^\[/p' pyproject.toml | grep -m 1 '^version' | cut -d '"' -f 2)
test -n "$VERSION" || { echo "Failed to extract project version"; exit 1; }
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
# 2. Automatically create Git Tag & GitHub Release
- name: Create GitHub Release
+3 -1
View File
@@ -2,4 +2,6 @@ __pycache__/
*.pyc
Thumbs.db
.DS_Store
desktop.ini
desktop.ini
# Local test suite (kept out of the repository)
tests/
+7 -1
View File
@@ -1,3 +1,7 @@
<p align="center">
<img src="assets/banner.png" alt="Comfy Sidebar" width="100%">
</p>
# ComfyUI-ComfySidebar
A compact and powerful layout overhaul for ComfyUI that makes generation results easier to browse, preview, compare, and manage.
@@ -10,7 +14,7 @@ A compact and powerful layout overhaul for ComfyUI that makes generation results
* **Left or right side:** Choose which side the sidebar appears on in ComfyUI settings.
* **Simplified mouse-friendly workflow** with drag-and-drop support and convenient actions for moving results back into the workflow, opening files, and managing outputs. Hold `Ctrl` for extra actions such as opening an image's location or deleting it directly from your device.
* **Simplified mouse-friendly workflow** with drag-and-drop support and convenient actions for moving results back into the workflow, opening files, and managing outputs. Hold `Ctrl` for extra actions such as opening an image's location, deleting it directly from your device, or moving a temporary image to your Outputs folder.
<img src="assets/controls.png" alt="ComfySidebar controls overview">
@@ -20,6 +24,8 @@ A compact and powerful layout overhaul for ComfyUI that makes generation results
* **Output Gallery sidebar:** Browse files and subfolders directly from your ComfyUI `output` directory without leaving the interface. Features dedicated cards for images, videos, audio, and 3D assets (`.glb`/`.gltf`), breadcrumb navigation, filename and prompt metadata search across subfolders, and persistent sorting.
<img src="assets/gallery.png" alt="ComfySidebar Gallery controls overview">
* **Hotkeys on any keyboard layout:** Shortcuts such as `Q`, `Ctrl+Q` and `Alt+R` keep working while a non-Latin layout (for example Russian) is active. Non-Latin keys are treated as the Latin key in the same physical position, and typing in text fields is not affected. Can be turned off with **Fix non-ASCII keybinds** in the settings.
* **Runtime preview mode** combined with workflow overview makes ComfyUI practical for running and monitoring workflows in a more streamlined, queue-oriented way.
+681 -394
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 51 KiB

+7 -9
View File
@@ -146,15 +146,13 @@ export function findActiveQueueIndicator() {
const container = findTopbarContainer();
if (!container) return null;
const buttons = container.querySelectorAll("button, .p-button, .comfyui-menu-item");
for (const btn of buttons) {
if (btn.classList.contains("comfy-sidebar-custom-properties-toggle")) continue;
const text = (btn.textContent || "").toLowerCase();
if (text.includes("active") || text.includes("queued") || text.includes("running") || text.includes("pending")) {
return btn;
}
}
return null;
// ComfyUI's Active queue control has a distinctive button layout. Match its
// structural classes rather than its translated label ("Active", etc.).
return container.querySelector(
"button.px-3.text-xs.p-2.rounded-lg.h-8, " +
".p-button.px-3.text-xs.p-2.rounded-lg.h-8, " +
".comfyui-menu-item.px-3.text-xs.p-2.rounded-lg.h-8"
);
}
export function findNativeExtensionsPanel() {
+24 -1
View File
@@ -1,4 +1,3 @@
import { app } from "/scripts/app.js";
import {
findOriginalPropertiesButton,
findTopbarContainer,
@@ -455,6 +454,10 @@ function syncAvatarVisibility() {
styleEl = document.createElement("style");
styleEl.id = STYLE_AVATAR_ID;
styleEl.textContent = `
/* Current ComfyUI profile/avatar control. Match stable class tokens,
not its localized tooltip or accessible label. */
button[class~="hover:bg-transparent"][class~="p-1"][class~="text-xs"][class~="rounded-lg"][class~="h-8"][class~="text-muted-foreground"][class~="bg-transparent"],
[role="button"][class~="hover:bg-transparent"][class~="p-1"][class~="text-xs"][class~="rounded-lg"][class~="h-8"][class~="text-muted-foreground"][class~="bg-transparent"],
img[alt*="User Avatar"],
img[alt*="user avatar"],
button:has(img[alt*="User Avatar"]),
@@ -682,6 +685,25 @@ function syncActiveQueueIndicator(isClassicLayoutEnabled) {
}
}
function syncRunOnComfyCloudButton() {
const shouldHide = getSetting("Comfy Sidebar.Hide Junk.Run on Comfy Cloud", false);
const container = findTopbarContainer();
if (!container) return;
// The cloud action is currently the second compact square button in the
// topbar. Keep this scoped to the action bar to avoid matching other UI.
const cloudButton = container.querySelector("button.rounded-lg.size-8:nth-of-type(2)");
if (!cloudButton) return;
if (shouldHide) {
if (cloudButton.style.display !== "none") {
cloudButton.style.setProperty("display", "none", "important");
}
} else if (cloudButton.style.display === "none") {
cloudButton.style.removeProperty("display");
}
}
export function syncRuntimePreviewButton() {
const panel = findPropertiesPanel();
if (!panel) return;
@@ -757,6 +779,7 @@ export function syncClassicLayout() {
syncExtensionsPanel(isClassicLayoutEnabled);
syncPropertiesButton(isClassicLayoutEnabled);
syncActiveQueueIndicator(isClassicLayoutEnabled);
syncRunOnComfyCloudButton();
updateSidebarTabsVisibility();
applySidebarOverride();
if (!sidebarTopObserver) {
+2
View File
@@ -26,6 +26,8 @@ export const SettingIds = Object.freeze({
HIDE_GRAPH_BUTTON: "Comfy Sidebar.Hide Junk.Graph Button",
CLASSIC_LAYOUT: "Comfy Sidebar.Comfy Layout",
LATIN_HOTKEYS: "Comfy Sidebar.Latin Hotkeys On Any Layout",
PERMANENT_DELETE: "Comfy Sidebar.Permanent Delete on Disk Deletion",
REMOVE_MISSING_CARDS: "Comfy Sidebar.Remove Cards With Missing Files",
QUICK_WORKFLOW_PICKER: "Comfy Sidebar.Quick Workflow Picker",
MAX_HISTORY_ITEMS: "Comfy.Queue.MaxHistoryItems",
DOCK_QUEUE: "Comfy.Queue.QPOV2",
+11 -2
View File
@@ -25,7 +25,12 @@ export const PersistenceAdapter = {
return img;
}).filter(Boolean);
const includeWorkflow = cleanedImages.length === 0 || state.status !== PromptStatus.COMPLETED;
// The workflow is only dropped from storage when it can be read back from a saved PNG.
// Text-only jobs, temp previews (the TEMP folder gets cleared), videos/webp and unfinished
// jobs have no such copy, and ComfyUI's own history is gone after a server restart.
const recoverableFromFile = cleanedImages.some(img =>
img.type === "output" && /\.png$/i.test(img.filename || ""));
const includeWorkflow = !recoverableFromFile || state.status !== PromptStatus.COMPLETED;
serializable.push({
pid: String(state.pid),
@@ -61,7 +66,11 @@ export const PersistenceAdapter = {
break;
} catch (e) {
if (e.name === "QuotaExceededError" || e.code === 22 || e.code === 1014) {
serializable.shift();
// Storage is full. First shed workflows, oldest card first, and only drop
// whole cards once there is no workflow left to shed.
const withWorkflow = serializable.find(item => item.workflow);
if (withWorkflow) withWorkflow.workflow = null;
else serializable.shift();
} else {
console.warn("Comfy Sidebar: LocalStorage error", e);
break;
+26
View File
@@ -1,6 +1,7 @@
import { PromptStatus, StoreEvents } from "./constants.js";
import { createPromptState, revokePromptBlobs } from "./promptState.js";
import { PersistenceAdapter } from "./persistence.js";
import { collectCardFiles } from "../utils/utils.js";
class Store {
constructor() {
@@ -154,6 +155,31 @@ class Store {
return toDelete;
}
/**
* Finished cards eligible for temporary cleanup. TEMP files are removed individually;
* cards with surviving Output files remain in the Queue.
* Returns [{ pid, files }] without changing anything.
*/
getTemporaryPrompts() {
const result = [];
for (const [pid, state] of this.prompts.entries()) {
if (state.status === PromptStatus.PENDING || state.status === PromptStatus.ACTIVE) continue;
const files = collectCardFiles(state);
const hasTemp = files.some((file) => file.type === "temp");
const hasOutput = files.some((file) => (file.type || "output") !== "temp");
if (hasTemp || !hasOutput) result.push({ pid, files });
}
return result;
}
removePrompts(pids) {
for (const pid of pids) {
this.deletePrompt(pid);
}
this.emit(StoreEvents.PROMPTS_CLEARED, { count: pids.length });
return pids;
}
setSearchQuery(query) {
this.ui.searchQuery = (query || "").trim();
this.emit(StoreEvents.SEARCH_CHANGED, { query: this.ui.searchQuery });
+1 -1
View File
@@ -1,7 +1,7 @@
import { api } from "/scripts/api.js";
import { app } from "/scripts/app.js";
import { store } from "../core/store.js";
import { PromptStatus } from "../core/constants.js";
import { PromptStatus, SettingIds } from "../core/constants.js";
import { createPromptState, activatePrompt, updatePromptProgress } from "../core/promptState.js";
import { syncQueue, concludeRun, initSessionAndHistory, clearCancelledOrFailed } from "./queueService.js";
import { findImagesInOutputs, findTextsInOutputs } from "../utils/utils.js";
+112
View File
@@ -0,0 +1,112 @@
import { api } from "/scripts/api.js";
import { store } from "../core/store.js";
import { PromptStatus, SettingIds } from "../core/constants.js";
import { getSetting } from "../core/settings.js";
/**
* Cards whose output files no longer exist (for example the TEMP folder was cleared on restart).
*
* A failed image request alone is never treated as proof: it can be a race with "Move to Outputs",
* a restart in progress or a path reused by a newer run. We ask the server whether the files are
* really gone, and only then act.
*/
const CHUNK = 500;
const fileKey = (f) => `${f.type || "output"}/${f.subfolder || ""}/${f.filename}`;
/** Image/media files of a card that live on the server's disk (not live preview blobs). */
export function cardDiskFiles(state) {
return (state?.images || []).filter(
(img) => img && img.filename && !(img.url && img.url.startsWith("blob:"))
);
}
/**
* Resolves to a Map(key -> exists) for the given files, or null if the server could not answer
* (older server, network error). Callers must treat null as "unknown", never as "missing".
*/
export async function checkFilesExist(files) {
const unique = new Map();
for (const f of files) unique.set(fileKey(f), { filename: f.filename, subfolder: f.subfolder || "", type: f.type || "output" });
const entries = [...unique.entries()];
const result = new Map();
try {
for (let i = 0; i < entries.length; i += CHUNK) {
const chunk = entries.slice(i, i + CHUNK);
const res = await api.fetchApi("/comfy-sidebar/files-exist", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ files: chunk.map(([, f]) => f) })
});
if (!res.ok) return null;
const data = await res.json();
if (!Array.isArray(data.exists) || data.exists.length !== chunk.length) return null;
chunk.forEach(([key], idx) => result.set(key, data.exists[idx] !== false));
}
} catch (err) {
console.warn("Comfy Sidebar: could not verify output files", err);
return null;
}
return result;
}
function removeCards(pids) {
if (pids.length === 0) return;
for (const pid of pids) store.deletePrompt(pid);
// Drop them from the server's history too, otherwise they come back on the next reload.
api.fetchApi("/history", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ delete: pids })
}).catch((err) => console.warn("Comfy Sidebar: failed to delete history entries", err));
}
/**
* Checks every finished card once (single request) and removes the ones whose files are all gone.
* Does nothing when the "remove cards with missing files" setting is off. Returns the removed count.
*
* Genuine text-only jobs (no files at all) are never touched.
*/
export async function sweepMissingCards() {
if (!getSetting(SettingIds.REMOVE_MISSING_CARDS, true)) return 0;
// Only completed jobs are cleaned up; cancelled/failed cards keep their error info.
const finished = store.getAllPrompts().filter((s) => s.status === PromptStatus.COMPLETED);
const allFiles = finished.flatMap(cardDiskFiles);
const exists = allFiles.length > 0 ? await checkFilesExist(allFiles) : new Map();
if (!exists) return 0; // couldn't verify: keep everything
const doomed = [];
for (const s of finished) {
const files = cardDiskFiles(s);
if (files.length > 0) {
if (files.every((f) => exists.get(fileKey(f)) === false)) doomed.push(s.pid);
} else if (!(s.texts && s.texts.length > 0)) {
// Finished, no files, no text: an empty "No Outputs" shell left over from a missing-file cleanup.
doomed.push(s.pid);
}
}
removeCards(doomed);
return doomed.length;
}
/**
* Called when the last image of a card failed to load.
* Resolves to:
* - "removed": the file is confirmed gone and the setting asks us to drop the card (already done)
* - "missing": the file is confirmed gone but the card is kept (setting off); show it text-only
* - "kept": the file exists, or we couldn't tell: leave the card exactly as it is
*/
export async function handleMissingMedia(state, img) {
if (!state || !img || !img.filename) return "kept";
const exists = await checkFilesExist([img]);
if (!exists || exists.get(fileKey(img)) !== false) return "kept";
if (state.status === PromptStatus.COMPLETED && getSetting(SettingIds.REMOVE_MISSING_CARDS, true) && store.hasPrompt(state.pid)) {
removeCards([String(state.pid)]);
return "removed";
}
return "missing";
}
+53 -8
View File
@@ -5,7 +5,7 @@ import { PromptStatus, StoreEvents, SettingIds } from "../core/constants.js";
import { getSetting } from "../core/settings.js";
import { createPromptState, activatePrompt, finalizePrompt } from "../core/promptState.js";
import { normalizeQueueItem, normalizeHistoryItem } from "./queueNormalizer.js";
import { findImagesInOutputs, findTextsInOutputs, getPrimaryOutputImages, getNodeTitle } from "../utils/utils.js";
import { findTextsInOutputs, getPrimaryOutputImages, getNodeTitle } from "../utils/utils.js";
function extractNodeTitles(outputs, workflow, promptGraph = null) {
const titles = {};
@@ -255,6 +255,19 @@ export async function initSessionAndHistory() {
}));
normalized.sort((a, b) => a.norm.queueNumber - b.norm.queueNumber);
const maxItems = getSetting(SettingIds.MAX_HISTORY_ITEMS, 64);
// The server keeps runs that this sidebar already pruned (its history is bigger than the Queue
// limit). Re-adding those as brand-new cards would give them *higher* sequence numbers than the
// cards we saved, and the limit would then evict the newest runs instead of the oldest ones.
// So history that is older than a card we already have is only used to fill free slots, and is
// ranked below everything else.
const knownQueueNumbers = normalized
.filter(({ norm }) => store.hasPrompt(norm.pid))
.map(({ norm }) => norm.queueNumber);
const newestKnownQueueNumber = knownQueueNumbers.length > 0 ? Math.max(...knownQueueNumbers) : -Infinity;
const backfill = [];
normalized.forEach(({ norm: item, promptGraph }) => {
const { images, texts, nodeTitles: titles } = extractPromptOutputs(item.outputs, item.workflow, promptGraph);
@@ -288,8 +301,7 @@ export async function initSessionAndHistory() {
return;
}
const seq = store.nextSequence();
const newState = createPromptState(item.pid, {
const stateInit = {
status: item.status,
images,
texts,
@@ -297,15 +309,33 @@ export async function initSessionAndHistory() {
nodeTitles: titles,
workflow: item.workflow,
progressText: "",
timestamp: seq,
rendered: true
});
store.setPrompt(item.pid, newState);
};
if (item.queueNumber <= newestKnownQueueNumber) {
backfill.push({ pid: item.pid, stateInit });
return;
}
store.setPrompt(item.pid, createPromptState(item.pid, { ...stateInit, timestamp: store.nextSequence() }));
});
if (backfill.length > 0) {
const all = store.getAllPrompts();
const finishedCount = all.filter(s => s.status !== PromptStatus.PENDING && s.status !== PromptStatus.ACTIVE).length;
const room = Math.max(0, maxItems - finishedCount);
const take = room > 0 ? backfill.slice(-room) : [];
const lowest = all.reduce((min, s) => (s.timestamp > 0 ? Math.min(min, s.timestamp) : min), Infinity);
const base = Number.isFinite(lowest) ? lowest : 1;
take.forEach(({ pid, stateInit }, idx) => {
// Positive fractions below every existing card, oldest backfill lowest.
const timestamp = base * (idx + 1) / (take.length + 1);
store.setPrompt(pid, createPromptState(pid, { ...stateInit, timestamp }));
});
}
await updatePromptSearchTexts(normalized.map(({ norm, promptGraph }) => ({ pid: norm.pid, promptGraph })));
const maxItems = getSetting(SettingIds.MAX_HISTORY_ITEMS, 64);
store.pruneHistory(maxItems);
await syncQueue();
} catch (err) {
@@ -374,4 +404,19 @@ export async function clearCancelledOrFailed() {
} catch (e) {
console.error("Comfy Sidebar: Failed to clear cancelled or failed tasks", e);
}
}
}
export async function removeHistoryItems(pids) {
if (!pids || pids.length === 0) return;
try {
store.removePrompts(pids);
await api.fetchApi("/history", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ delete: pids })
});
await syncQueue();
} catch (e) {
console.error("Comfy Sidebar: Failed to remove history items", e);
}
}
+91 -44
View File
@@ -8,7 +8,8 @@ import { renumberNodesTopologically, setManualNodeId } from "./utils/nodeRenumbe
import { applySidebarOverride } from "./comfy/adapter.js";
import { syncAllNodeBadges, setupVueNodeObserver, toggleIgnoreActiveNode } from "./comfy/nodes.js";
import { applyClassicLayout, setupPropertiesPanelToggleFix, syncClassicLayout, syncStockHistoryAndProgressSettings, destroyLayoutFix } from "./comfy/layout.js";
import { initSessionAndHistory, syncQueue } from "./queue/queueService.js";
import { initSessionAndHistory } from "./queue/queueService.js";
import { sweepMissingCards } from "./queue/missingFiles.js";
import { setupExecutionTracker } from "./queue/executionTracker.js";
import { setupSidebarView, renderSidebar, teardownSidebarView } from "./ui/sidebarView.js";
import { setupGalleryView, teardownGalleryView } from "./ui/galleryView.js";
@@ -18,6 +19,28 @@ import { getScrollContainer } from "./utils/utils.js";
import { store } from "./core/store.js";
import { getSetting, setSetting } from "./core/settings.js";
// The About panel supports extension-provided badges. Resolve build metadata before
// registering the extension so the badge is part of its initial registration.
let aboutPageBadges = [];
try {
const response = await fetch("/comfy-sidebar/version", { cache: "no-store" });
if (response.ok) {
const { version, commit } = await response.json();
if (version && version !== "unknown") {
const hasCommit = typeof commit === "string" && /^[0-9a-f]{7}$/i.test(commit);
aboutPageBadges = [{
label: `Comfy Sidebar v${version}${hasCommit ? ` (${commit})` : ""}`,
url: hasCommit
? `https://github.com/m0rtus59/ComfyUI-ComfySidebar/commit/${commit}`
: "https://github.com/m0rtus59/ComfyUI-ComfySidebar",
icon: "icon-[lucide--github]"
}];
}
}
} catch (error) {
console.warn("[ComfySidebar] Could not load version information for the About panel:", error);
}
let isInitialized = false;
let activeKeydownHandler = null;
let cleanupFns = [];
@@ -50,6 +73,11 @@ function setupKeydownShortcuts() {
document.addEventListener("keydown", activeKeydownHandler, true);
}
// Assigned in setup(): registers/unregisters the Gallery sidebar tab to match the
// "Enable Output Gallery Sidebar" setting. Null until setup() has run (the setting's
// initial onChange fires earlier, in init(), when there is nothing to toggle yet).
let syncGalleryTab = null;
function registerSettings() {
app.ui.settings.addSetting({
id: SettingIds.GRID_COLUMNS_THRESHOLD,
@@ -79,34 +107,25 @@ function registerSettings() {
defaultValue: false
});
const setGalleryButtonVisible = (visible) => {
try {
const buttons = document.querySelectorAll(".side-bar-button, [data-tab-id]");
for (const btn of buttons) {
if (btn.getAttribute("data-tab-id") === "classic-comfy-gallery" ||
btn.getAttribute("title")?.includes("Gallery") ||
btn.querySelector(".pi-folder")) {
btn.style.display = visible ? "" : "none";
break;
}
}
} catch (e) {
console.warn("[ComfySidebar] Error toggling gallery tab button:", e);
}
};
app.ui.settings.addSetting({
id: "Comfy Sidebar.Enable Gallery",
name: t("Enable Output Gallery Sidebar"),
type: "boolean",
defaultValue: true,
onChange: (val) => {
setGalleryButtonVisible(val ?? true);
syncGalleryTab?.(val ?? true);
}
});
app.ui.settings.addSetting({
id: "Comfy Sidebar.Permanent Delete on Disk Deletion",
id: SettingIds.REMOVE_MISSING_CARDS,
name: t("Remove Queue cards whose output files no longer exist (e.g. after the temp folder is cleared)"),
type: "boolean",
defaultValue: true
});
app.ui.settings.addSetting({
id: SettingIds.PERMANENT_DELETE,
name: t("Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)"),
type: "boolean",
defaultValue: false
@@ -162,6 +181,16 @@ function registerSettings() {
}
});
app.ui.settings.addSetting({
id: "Comfy Sidebar.Hide Junk.Run on Comfy Cloud",
name: t("Hide Run on Comfy Cloud button"),
type: "boolean",
defaultValue: false,
onChange: () => {
setTimeout(() => { syncClassicLayout(); }, 0);
}
});
app.ui.settings.addSetting({
id: "Comfy Sidebar.Hide Junk.Floating Canvas Controls",
name: t("Floating Canvas Controls"),
@@ -293,6 +322,7 @@ function setupWorkflowTabsPositionWatcher() {
app.registerExtension({
name: "ComfySidebar.ClassicRestore",
aboutPageBadges,
async init() {
await initI18n();
@@ -407,6 +437,7 @@ app.registerExtension({
const sidebarContainer = setupSidebarView();
await initSessionAndHistory();
await sweepMissingCards();
setupKeydownShortcuts();
syncAllNodeBadges();
@@ -436,32 +467,47 @@ app.registerExtension({
}
});
const galleryContainer = setupGalleryView();
app.extensionManager.registerSidebarTab({
id: "classic-comfy-gallery",
icon: "pi pi-folder",
title: t("Gallery"),
tooltip: t("Gallery (Outputs)"),
type: "custom",
render: (el) => {
document.querySelectorAll(".comfy-sidebar-scroll-top-btn").forEach(btn => { btn.style.display = "none"; });
const scrollParent = getScrollContainer(el);
if (activeSidebarTab === "queue" && scrollParent) {
queueScrollPos = scrollParent.scrollTop;
}
activeSidebarTab = "gallery";
el.replaceChildren(galleryContainer);
requestAnimationFrame(() => {
const sp = getScrollContainer(el);
if (sp) sp.scrollTop = galleryScrollPos;
});
}
});
// The Gallery tab is only registered while the setting is enabled. Hiding its
// button in the DOM was unreliable: the sidebar renders asynchronously and
// re-renders on its own, so the button came back (or the wrong one was hidden).
let galleryContainer = null;
let galleryTabRegistered = false;
const isGalleryEnabled = getSetting("Comfy Sidebar.Enable Gallery", true);
if (!isGalleryEnabled) {
setTimeout(() => setGalleryButtonVisible(false), 50);
}
const registerGalleryTab = () => {
if (galleryTabRegistered) return;
galleryContainer ||= setupGalleryView();
app.extensionManager.registerSidebarTab({
id: "classic-comfy-gallery",
icon: "pi pi-folder",
title: t("Gallery"),
tooltip: t("Gallery (Outputs)"),
type: "custom",
render: (el) => {
document.querySelectorAll(".comfy-sidebar-scroll-top-btn").forEach(btn => { btn.style.display = "none"; });
const scrollParent = getScrollContainer(el);
if (activeSidebarTab === "queue" && scrollParent) {
queueScrollPos = scrollParent.scrollTop;
}
activeSidebarTab = "gallery";
el.replaceChildren(galleryContainer);
requestAnimationFrame(() => {
const sp = getScrollContainer(el);
if (sp) sp.scrollTop = galleryScrollPos;
});
}
});
galleryTabRegistered = true;
};
const unregisterGalleryTab = () => {
if (!galleryTabRegistered) return;
if (activeSidebarTab === "gallery") activeSidebarTab = "queue";
app.extensionManager.unregisterSidebarTab?.("classic-comfy-gallery");
galleryTabRegistered = false;
};
syncGalleryTab = (enabled) => (enabled ? registerGalleryTab() : unregisterGalleryTab());
syncGalleryTab(getSetting("Comfy Sidebar.Enable Gallery", true));
requestAnimationFrame(() => {
applySidebarOverride();
@@ -469,6 +515,7 @@ app.registerExtension({
},
destroy() {
syncGalleryTab = null;
for (const fn of cleanupFns.splice(0)) {
try { if (typeof fn === "function") fn(); } catch (e) {}
}
+120 -36
View File
@@ -1,9 +1,8 @@
import { app } from "/scripts/app.js";
import { PromptStatus } from "../core/constants.js";
import { t } from "../core/i18n.js";
import { store } from "../core/store.js";
import { renderCardImages } from "./mediaPreview.js";
import { copyImageToClipboard, openFileOrFolder, deleteFileOnServer, findNodeIdForImage, removeImageFromNodeOutputs } from "./mediaActions.js";
import { copyImageToClipboard, deleteFilesWithFeedback, moveTempImageToOutput, updateMovedImageReferences, findNodeIdForImage, removeImageFromNodeOutputs } from "./mediaActions.js";
import { centerAndSelectCanvasNode } from "../comfy/adapter.js";
import { getRunOutputs, extractWorkflowFromPng, isImageFormat, animateCardRemoval, downloadJson, getScrollContainer, attachDeleteConfirmation } from "../utils/utils.js";
import { showFullscreenPreview } from "../utils/comparison.js";
@@ -20,6 +19,20 @@ export function resetAllCardHoverStates() {
}
}
/**
* Re-check intermediate files after Queue cleanup has removed TEMP images.
* The normal card update path caches this validation, so invalidate it first.
*/
export function revalidateIntermediateResults(pid) {
const state = store.getPrompt(pid);
const cardObj = cardPool.get(String(pid));
if (!state || !cardObj) return;
state._hasValidatedIntermediates = false;
cardObj._isCheckingIntermediates = false;
syncCardButtonVisibility(cardObj, state);
}
export function syncCardButtonVisibility(cardObj, state) {
if (!cardObj) return;
@@ -120,6 +133,81 @@ export function syncCardButtonVisibility(cardObj, state) {
: t("Delete Card");
}
if (cardObj.btnMove) {
const canMoveCurrentImage = Boolean(
currentImg &&
currentImg.type === "temp" &&
isImageFormat(currentImg.filename || currentImg.url)
);
if (canMoveCurrentImage) {
cardObj.btnMove.style.removeProperty("display");
cardObj.btnMove.title = t("Move selected image to Outputs (Ctrl+Click)");
cardObj.btnMove.onclick = async (ev) => {
ev.stopPropagation();
if (!ev.ctrlKey && !ev.metaKey) return;
if (cardObj._isMovingTempImage) return;
const liveState = store.getPrompt(state.pid) || state;
const selectedImage = liveState.images?.[cardObj.currentImageIndex || 0];
if (!selectedImage || selectedImage.type !== "temp") return;
cardObj._isMovingTempImage = true;
cardObj.btnMove.style.opacity = "0.5";
const moved = await moveTempImageToOutput(selectedImage);
if (moved?.success) {
// Update raw node outputs before the selected image object itself is mutated.
updateMovedImageReferences(liveState.nodeOutputs, selectedImage, moved);
updateMovedImageReferences(liveState.images, selectedImage, moved);
store.updatePrompt(liveState.pid, liveState);
// Keep the already-decoded temp image visible while the new output URL
// is preloaded. Only switch the existing media element once the replacement
// is ready, so the card never collapses to an empty preview in between.
const selectedIndex = cardObj.currentImageIndex || 0;
const currentMedia = cardObj.grid.querySelector(".comfy-sidebar-media-wrapper > img");
const movedImage = liveState.images?.[selectedIndex];
const nextSrc = movedImage
? (movedImage.url || (window.location.origin + `/view?filename=${encodeURIComponent(movedImage.filename)}&type=${movedImage.type || "output"}&subfolder=${encodeURIComponent(movedImage.subfolder || "")}${liveState.pid ? `&rand=${encodeURIComponent(liveState.pid)}` : ""}`))
: null;
const refreshPreview = () => {
renderCardImages(cardObj, liveState, (st) => {
const scrollEl = getScrollContainer(store.ui.cardStack);
if (scrollEl) store.ui.mainQueueScrollTop = scrollEl.scrollTop;
store.openBatchSubmenu({
pid: st.pid,
images: st.images,
workflow: st.workflow,
nodeOutputs: st.nodeOutputs
});
});
cardObj.lastImagesSignature = `${liveState.status || ""}:${liveState.images.map(img => img.url || img.filename).join("|")}`;
syncCardButtonVisibility(cardObj, liveState);
};
if (currentMedia && nextSrc && currentMedia.tagName === "IMG") {
const preload = new Image();
preload.onload = refreshPreview;
preload.onerror = refreshPreview;
preload.src = nextSrc;
} else {
refreshPreview();
}
showNotification(t("Moved selected image to Outputs."), "success", t("Move to Outputs"));
} else {
showNotification(t("Failed to move image to Outputs."), "error", t("Move to Outputs"));
}
cardObj._isMovingTempImage = false;
cardObj.btnMove.style.opacity = "";
};
} else {
cardObj.btnMove.style.setProperty("display", "none", "important");
cardObj.btnMove.onclick = null;
}
}
if (cardObj.btnFocus) {
const nodeId = (currentImg ? findNodeIdForImage(state, currentImg) : null) || state.activeNodeId;
if (nodeId) {
@@ -420,6 +508,15 @@ export function getOrCreateCard(state, callbacks = {}) {
btnDelLabel.textContent = t("Delete File");
btnDel.appendChild(btnDelLabel);
const btnMove = document.createElement("span");
btnMove.className = "pi pi-folder-open comfy-sidebar-card-action-btn comfy-sidebar-btn-move";
btnMove.title = t("Move selected image to Outputs (Ctrl+Click)");
const btnMoveLabel = document.createElement("span");
btnMoveLabel.className = "comfy-sidebar-move-label";
btnMoveLabel.textContent = t("Move to Outputs");
btnMove.appendChild(btnMoveLabel);
btnMove.style.display = "none";
const leftHoverPanel = document.createElement("div");
leftHoverPanel.className = "comfy-sidebar-left-hover-panel";
Object.assign(leftHoverPanel.style, {
@@ -434,7 +531,7 @@ export function getOrCreateCard(state, callbacks = {}) {
leftHoverBtn.className = "pi pi-images comfy-sidebar-card-action-btn";
leftHoverBtn.title = t("View all intermediate outputs");
hoverPanel.append(btnImg, btnJson, btnDel);
hoverPanel.append(btnImg, btnJson, btnMove, btnDel);
leftHoverPanel.append(btnCopy, btnFocus, leftHoverBtn);
// Appending grid FIRST ensures overlays (badges, cancel button) naturally render on top
@@ -459,6 +556,7 @@ export function getOrCreateCard(state, callbacks = {}) {
btnJson,
btnDel,
btnDelLabel,
btnMove,
canDeleteFromDisk: true,
statusText,
firstImgElement: null,
@@ -501,44 +599,30 @@ export function getOrCreateCard(state, callbacks = {}) {
confirmTitle: t("Click again to confirm removing card"),
confirmDiskTitle: t("Ctrl+Click again to delete file from DISK / TRASH"),
onConfirm: async (shouldDeleteFromDisk) => {
animateCardRemoval(card, async () => {
if (shouldDeleteFromDisk) {
const liveState = store.getPrompt(state.pid) || state;
if (shouldDeleteFromDisk) {
const filesToDelete = [];
const seen = new Set();
const addFile = (item) => {
if (item && item.filename) {
const key = `${item.type || ""}/${item.subfolder || ""}/${item.filename}`;
if (!seen.has(key)) {
seen.add(key);
filesToDelete.push(item);
}
}
};
(liveState.images || []).forEach(addFile);
const allOutputs = getRunOutputs(liveState.nodeOutputs, liveState.workflow);
allOutputs.forEach(out => (out.images || []).forEach(addFile));
let deletedCount = 0;
let lastAction = "trashed";
for (const fileItem of filesToDelete) {
const action = await deleteFileOnServer(fileItem);
if (action) {
deletedCount++;
lastAction = action;
const filesToDelete = [];
const seen = new Set();
const addFile = (item) => {
if (item && item.filename) {
const key = `${item.type || ""}/${item.subfolder || ""}/${item.filename}`;
if (!seen.has(key)) {
seen.add(key);
filesToDelete.push(item);
}
}
};
if (deletedCount > 0) {
const msg = lastAction === "trashed"
? `Moved ${deletedCount} file${deletedCount > 1 ? "s" : ""} to Recycle Bin.`
: `Permanently deleted ${deletedCount} file${deletedCount > 1 ? "s" : ""}.`;
showNotification(msg, "success", "Delete Files");
}
}
(liveState.images || []).forEach(addFile);
const allOutputs = getRunOutputs(liveState.nodeOutputs, liveState.workflow);
allOutputs.forEach(out => (out.images || []).forEach(addFile));
// Delete first, animate afterwards: if a file can't be deleted (for example the user
// cancelled the Recycle Bin dialog) the card must stay.
if (!(await deleteFilesWithFeedback(filesToDelete))) return;
}
animateCardRemoval(card, () => {
deleteHistoryItem(state.pid);
});
}
+63
View File
@@ -0,0 +1,63 @@
import { store } from "../core/store.js";
import { PromptStatus } from "../core/constants.js";
import { t } from "../core/i18n.js";
import { removeHistoryItems } from "../queue/queueService.js";
import { createDeleteTally, deleteFilesIntoTally, notifyDeleteTally } from "./mediaActions.js";
import { showNotification } from "../utils/nodeRenumber.js";
import { sweepMissingCards } from "../queue/missingFiles.js";
import { revalidateIntermediateResults } from "./cardRenderer.js";
/**
* Number of cards "Clear Temporary" would remove right now.
*/
export function countTemporaryCards() {
return store.getTemporaryPrompts().length;
}
/**
* Removes every finished card that holds nothing saved (text-only cards and cards whose files
* all live in the TEMP folder) together with those temp files.
*
* Files go to the Recycle Bin or are deleted permanently, depending on the same setting as the
* per-card delete. If a file can't be deleted (for example the user cancelled the Recycle Bin
* dialog) its card is kept, so a card never disappears while its files are still on disk.
*/
export async function clearTemporaryCards() {
const candidates = store.getTemporaryPrompts();
if (candidates.length === 0) return 0;
const tally = createDeleteTally();
const removable = [];
for (const { pid, files } of candidates) {
// Never touch files belonging to active or pending workflows.
const live = store.getPrompt(pid);
if (!live || live.status === PromptStatus.PENDING || live.status === PromptStatus.ACTIVE) continue;
const tempFiles = files.filter((file) => file.type === "temp");
if (tempFiles.length > 0 && !(await deleteFilesIntoTally(tempFiles, tally))) continue;
// Keep the card if any Output file remains. Text-only and TEMP-only cards are removable.
const hasOutput = files.some((file) => (file.type || "output") !== "temp");
if (!hasOutput) removable.push(pid);
}
await removeHistoryItems(removable);
// Reuse the existing missing-file sweep to repair cards whose intermediates were just removed.
await sweepMissingCards();
// TEMP files may also be referenced by intermediate node outputs. Re-run the
// card's cached existence check so stale "show intermediate results" buttons vanish.
for (const { pid } of candidates) {
revalidateIntermediateResults(pid);
}
const title = t("Clear Temporary");
if (removable.length > 0) {
showNotification(t("Cleared {count} temporary card(s).", { count: removable.length }), "success", title);
}
notifyDeleteTally(tally, title, "Could not delete {count} file(s). Their cards were kept.");
return removable.length;
}
+142
View File
@@ -0,0 +1,142 @@
import { t } from "../core/i18n.js";
/**
* Shown when a file could not be moved to the Recycle Bin / Trash.
*
* Resolves to one of:
* - "permanent": the user wants direct (permanent) deletion turned on and used for this file
* - "retry": the user fixed the trash problem and wants to try again
* - "cancel": nothing is deleted
*
* `code` is "trash_unavailable" (send2trash is not installed) or "trash_failed" (it raised).
*/
export function askTrashFallback({ filename = "", code = "trash_failed", error = "", python = "" } = {}) {
return new Promise((resolve) => {
const previouslyFocused = document.activeElement;
const titleId = "comfy-sidebar-trash-dialog-title";
const backdrop = document.createElement("div");
Object.assign(backdrop.style, {
position: "fixed", inset: "0", zIndex: "100000",
background: "rgba(0, 0, 0, 0.55)", backdropFilter: "blur(2px)",
display: "flex", alignItems: "center", justifyContent: "center", padding: "16px"
});
const box = document.createElement("div");
box.setAttribute("role", "dialog");
box.setAttribute("aria-modal", "true");
box.setAttribute("aria-labelledby", titleId);
Object.assign(box.style, {
width: "min(480px, 100%)", maxHeight: "85vh", overflowY: "auto", boxSizing: "border-box",
padding: "20px 22px", borderRadius: "12px", display: "flex", flexDirection: "column", gap: "12px",
background: "var(--card, var(--secondary, var(--p-surface-800, #181818)))",
color: "var(--foreground, var(--fg-color, #eee))",
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
boxShadow: "0 12px 40px rgba(0, 0, 0, 0.5)", fontSize: "13px", lineHeight: "1.5"
});
const title = document.createElement("div");
title.id = titleId;
title.textContent = t("Couldn't move the file to the Recycle Bin");
Object.assign(title.style, { fontSize: "15px", fontWeight: "600" });
const intro = document.createElement("div");
intro.textContent = t("Could not move \"{filename}\" to the Recycle Bin / Trash.", { filename });
intro.style.wordBreak = "break-word";
const hint = document.createElement("div");
hint.style.opacity = "0.85";
const detailBlocks = [];
if (code === "trash_unavailable") {
hint.textContent = t("The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:");
const cmd = document.createElement("code");
cmd.textContent = `"${python || "python"}" -m pip install send2trash`;
detailBlocks.push(cmd);
} else {
hint.textContent = t("The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.");
if (error) {
const detail = document.createElement("code");
detail.textContent = error;
detailBlocks.push(detail);
}
}
for (const block of detailBlocks) {
Object.assign(block.style, {
display: "block", padding: "8px 10px", borderRadius: "6px", fontFamily: "monospace",
fontSize: "12px", whiteSpace: "pre-wrap", wordBreak: "break-all", userSelect: "all",
background: "rgba(0, 0, 0, 0.3)", border: "1px solid var(--border, rgba(255, 255, 255, 0.12))"
});
}
const note = document.createElement("div");
note.textContent = t("Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings \u2192 Comfy Sidebar.");
Object.assign(note.style, { fontSize: "12px", opacity: "0.65" });
const actions = document.createElement("div");
Object.assign(actions.style, { display: "flex", flexWrap: "wrap", justifyContent: "flex-end", gap: "8px", marginTop: "4px" });
const makeButton = (label, kind, result) => {
const btn = document.createElement("button");
btn.type = "button";
btn.textContent = label;
const colors = kind === "danger"
? { bg: "rgba(239, 68, 68, 0.15)", border: "#ef4444", fg: "#fca5a5" }
: kind === "primary"
? { bg: "var(--primary, var(--p-primary-color, #a855f7))", border: "transparent", fg: "#fff" }
: { bg: "transparent", border: "var(--border, rgba(255, 255, 255, 0.2))", fg: "inherit" };
Object.assign(btn.style, {
padding: "7px 14px", borderRadius: "8px", cursor: "pointer", fontSize: "13px",
background: colors.bg, border: `1px solid ${colors.border}`, color: colors.fg
});
btn.onclick = () => finish(result);
return btn;
};
const btnPermanent = makeButton(t("Turn on direct deletion"), "danger", "permanent");
const btnRetry = makeButton(t("Try again"), "primary", "retry");
const btnCancel = makeButton(t("Cancel"), "neutral", "cancel");
actions.append(btnPermanent, btnRetry, btnCancel);
box.append(title, intro, hint, ...detailBlocks, note, actions);
backdrop.appendChild(box);
let done = false;
const focusables = [btnPermanent, btnRetry, btnCancel];
const onKeyDown = (e) => {
if (e.key === "Escape") {
e.preventDefault();
e.stopPropagation();
finish("cancel");
} else if (e.key === "Tab") {
// Keep keyboard focus inside the dialog
const idx = focusables.indexOf(document.activeElement);
const next = e.shiftKey
? (idx <= 0 ? focusables.length - 1 : idx - 1)
: (idx === focusables.length - 1 ? 0 : idx + 1);
e.preventDefault();
focusables[next].focus();
} else {
// Don't let ComfyUI hotkeys (Delete, Ctrl+Z, ...) act on the canvas behind the dialog
e.stopPropagation();
}
};
function finish(result) {
if (done) return;
done = true;
document.removeEventListener("keydown", onKeyDown, true);
backdrop.remove();
try { previouslyFocused?.focus?.({ preventScroll: true }); } catch (e) { /* element may be gone */ }
resolve(result);
}
backdrop.addEventListener("pointerdown", (e) => {
if (e.target === backdrop) finish("cancel");
});
document.addEventListener("keydown", onKeyDown, true);
document.body.appendChild(backdrop);
btnRetry.focus({ preventScroll: true });
});
}
+17 -5
View File
@@ -1,14 +1,15 @@
import { app } from "/scripts/app.js";
import { SettingIds, PromptStatus } from "../core/constants.js";
import { t } from "../core/i18n.js";
import { deleteFileOnServer, openFileOrFolder } from "./mediaActions.js";
import { deleteFileOnServer, openFileOrFolder, copyImageToClipboard } from "./mediaActions.js";
import { extractWorkflowFromPng, isImageFormat, animateCardRemoval, getScrollContainer, calculateGridColumns, downloadJson, setupSpotlightTracker, attachDeleteConfirmation } from "../utils/utils.js";
import { getSetting } from "../core/settings.js";
import { renderCardImages } from "./mediaPreview.js";
import { showNotification } from "../utils/nodeRenumber.js";
import { openSimilarPromptsDialog } from "./similarPrompts.js";
let galleryContainerEl = null;
let cardStackEl = null;
let similarPromptsDialog = null;
let scrollToTopBtnEl = null;
let currentColumnCount = 1;
let currentSubfolder = "";
@@ -275,6 +276,7 @@ function createFileCard(file) {
pid: `gallery-${file.filename}`,
status: PromptStatus.COMPLETED,
images: [fileAsset],
_previewImages: cachedFiles,
workflow: null
});
@@ -339,8 +341,10 @@ function createFileCard(file) {
onConfirm: async () => {
const action = await deleteFileOnServer(fileAsset);
if (action) {
const msg = action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file.");
showNotification(msg, "success", t("Delete File"));
if (action !== "missing") {
const msg = action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file.");
showNotification(msg, "success", t("Delete File"));
}
cachedFiles = cachedFiles.filter(f => f.filename !== file.filename || f.subfolder !== file.subfolder);
displayedFilesCount = Math.max(0, displayedFilesCount - 1);
@@ -581,7 +585,11 @@ export function setupGalleryView() {
renderGallery();
});
actionsGroup.append(btnSort, btnUp, btnOpenFolder, btnRefresh);
const btnSimilar = createHeaderBtn("pi pi-clone", t("Find Similar Prompts"), async () => {
if (similarPromptsDialog && !similarPromptsDialog.destroyed) return;
similarPromptsDialog = await openSimilarPromptsDialog(currentSubfolder);
});
actionsGroup.append(btnSort, btnUp, btnOpenFolder, btnSimilar, btnRefresh);
standardHeader.appendChild(actionsGroup);
const searchContainer = document.createElement("div");
@@ -726,6 +734,10 @@ export function teardownGalleryView() {
galleryResizeObserver.disconnect();
galleryResizeObserver = null;
}
if (similarPromptsDialog) {
similarPromptsDialog.destroy();
similarPromptsDialog = null;
}
// Reset header-reveal state so a re-opened gallery starts with a visible header
lastScrollTop = 0;
scrollDeltaAccumulator = 0;
+154 -14
View File
@@ -1,4 +1,8 @@
import { getSetting } from "../core/settings.js";
import { getSetting, setSetting } from "../core/settings.js";
import { SettingIds } from "../core/constants.js";
import { askTrashFallback } from "./deleteFallbackDialog.js";
import { showNotification } from "../utils/nodeRenumber.js";
import { t } from "../core/i18n.js";
export async function copyImageToClipboard(src) {
try {
@@ -52,31 +56,167 @@ export async function openFileOrFolder(img) {
a.remove();
}
export async function deleteFileOnServer(fileItem) {
/**
* Deletes a generated file on the server.
* Resolves to "trashed" / "deleted" on success, "missing" if the file was already gone,
* or null if it could not be deleted (error, or the user cancelled the trash-failed dialog).
*
* If the Recycle Bin can't be used the server refuses to delete (HTTP 409) rather than silently
* deleting permanently; we then ask the user whether to turn on direct deletion or retry
* after fixing send2trash.
*/
export async function deleteFileOnServer(fileItem, { suppressDialog = false, endpoint = "/comfy-sidebar/delete-file" } = {}) {
if (!fileItem || !fileItem.filename) return null;
const isPermanent = getSetting("Comfy Sidebar.Permanent Delete on Disk Deletion", false);
let permanent = !!getSetting(SettingIds.PERMANENT_DELETE, false);
for (let attempt = 0; attempt < 5; attempt++) {
let res;
let data = {};
try {
res = await fetch(endpoint, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
filename: fileItem.filename,
subfolder: fileItem.subfolder || "",
type: fileItem.type || "output",
permanent
})
});
data = await res.json().catch(() => ({}));
} catch (e) {
console.error("Comfy Sidebar: Failed to delete file on server", e);
return null;
}
if (res.ok) return data.action || (permanent ? "deleted" : "trashed");
if (res.status === 404) return "missing"; // already gone (e.g. temp folder was cleared)
if (data.code === "queue_busy") return "busy";
const trashProblem = !permanent && (data.code === "trash_unavailable" || data.code === "trash_failed");
if (!trashProblem) {
console.error("Comfy Sidebar: Failed to delete file on server", data.error || res.statusText);
return null;
}
if (suppressDialog) return null; // the user already said "cancel" for this batch
const choice = await askTrashFallback({
filename: fileItem.filename,
code: data.code,
error: data.error,
python: data.python
});
if (choice === "permanent") {
setSetting(SettingIds.PERMANENT_DELETE, true);
permanent = true;
} else if (choice !== "retry") {
return null;
}
}
return null;
}
export function createDeleteTally() {
return { deleted: 0, blocked: 0, lastAction: "trashed", cancelled: false };
}
/**
* Deletes files one by one and records the outcome in `tally`.
* Returns true when nothing was left undeleted. Files that were already gone count as done.
* After one cancelled Recycle Bin dialog the tally remembers it, so a batch never asks twice.
*/
export async function deleteFilesIntoTally(files, tally) {
let blockedHere = 0;
for (const file of files) {
const action = await deleteFileOnServer(file, { suppressDialog: tally.cancelled });
if (action === "trashed" || action === "deleted") {
tally.deleted++;
tally.lastAction = action;
} else if (action !== "missing") {
tally.blocked++;
blockedHere++;
tally.cancelled = true;
}
}
return blockedHere === 0;
}
export function notifyDeleteTally(tally, title = "Delete Files", blockedMessage = "Could not delete {count} file(s). The card was kept.") {
if (tally.deleted > 0) {
const msg = tally.lastAction === "trashed"
? t("Moved {count} file(s) to Recycle Bin.", { count: tally.deleted })
: t("Permanently deleted {count} file(s).", { count: tally.deleted });
showNotification(msg, "success", title);
}
if (tally.blocked > 0) {
showNotification(t(blockedMessage, { count: tally.blocked }), "warn", title);
}
}
/**
* Deletes several files from disk and tells the user what happened.
* Returns true when nothing was left undeleted. Files that were already gone count as done.
* Callers must keep their card when this returns false (e.g. the user cancelled the dialog),
* otherwise the card would vanish while its files are still on disk.
*/
export async function deleteFilesWithFeedback(files, title = "Delete Files") {
const tally = createDeleteTally();
const ok = await deleteFilesIntoTally(files, tally);
notifyDeleteTally(tally, title);
return ok;
}
export async function moveTempImageToOutput(fileItem) {
if (!fileItem || !fileItem.filename || fileItem.type !== "temp") return null;
try {
const res = await fetch("/comfy-sidebar/delete-file", {
const res = await fetch("/comfy-sidebar/move-temp-to-output", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
filename: fileItem.filename,
subfolder: fileItem.subfolder || "",
type: fileItem.type || "output",
permanent: isPermanent
type: fileItem.type
})
});
if (res.ok) {
const data = await res.json();
return data.action || (isPermanent ? "deleted" : "trashed");
if (!res.ok) {
const data = await res.json().catch(() => ({}));
console.error("Comfy Sidebar: Failed to move temp image", data.error || res.statusText);
return null;
}
return null;
} catch (e) {
console.error("Comfy Sidebar: Failed to delete file on server", e);
return await res.json();
} catch (err) {
console.error("Comfy Sidebar: Failed to move temp image", err);
return null;
}
}
export function updateMovedImageReferences(value, oldImage, moved) {
const oldFilename = oldImage?.filename;
const oldSubfolder = oldImage?.subfolder || "";
if (!value || !oldFilename || !moved?.filename) return;
const visit = (obj) => {
if (!obj || typeof obj !== "object") return;
if (Array.isArray(obj)) {
obj.forEach(visit);
return;
}
if (obj.filename === oldFilename &&
(obj.subfolder || "") === oldSubfolder &&
(obj.type || "temp") === "temp") {
obj.filename = moved.filename;
obj.subfolder = moved.subfolder || "";
obj.type = moved.type || "output";
if (obj.url && !obj.url.startsWith("blob:")) delete obj.url;
}
Object.values(obj).forEach(visit);
};
visit(value);
}
export function removeImageFromNodeOutputs(nodeOutputs, targetImg) {
if (!nodeOutputs || !targetImg || !targetImg.filename) return;
@@ -115,10 +255,10 @@ export function findNodeIdForImage(state, img) {
for (const key in out) {
const val = out[key];
if (Array.isArray(val)) {
if (val.some(i => i && typeof i === "object" && i.filename === img.filename)) {
if (val.some(i => i && typeof i === "object" && i.filename === img.filename && (i.subfolder || "") === (img.subfolder || ""))) {
return nodeId;
}
} else if (val && typeof val === "object" && val.filename === img.filename) {
} else if (val && typeof val === "object" && val.filename === img.filename && (val.subfolder || "") === (img.subfolder || "")) {
return nodeId;
}
}
+189 -53
View File
@@ -1,11 +1,11 @@
import { isImageFormat, isVideoFormat, is3DFormat, isAudioFormat, getFilenameFromUrl, findImagesInOutputs } from "../utils/utils.js";
import { openFileOrFolder, removeImageFromNodeOutputs } from "./mediaActions.js";
import { openFileOrFolder, removeImageFromNodeOutputs, deleteFileOnServer } from "./mediaActions.js";
import { stopAllAudioPlayback, isAudioViewerOpen, setCurrentlyPlayingAudio, getCurrentlyPlayingAudio } from "./audioController.js";
import { showFullscreenPreview } from "../utils/comparison.js";
import { store } from "../core/store.js";
import { PromptStatus } from "../core/constants.js";
import { handleMissingMedia } from "../queue/missingFiles.js";
import { t } from "../core/i18n.js";
import { deleteHistoryItem } from "../queue/queueService.js";
import { showNotification } from "../utils/nodeRenumber.js";
export function findWorkflowBackgroundThumbnail(state, randParam = "") {
if (!state) return null;
@@ -369,7 +369,12 @@ export function renderGenericFileCardPreview(cardObj, wrapper, src, img, state)
const folderInfo = document.createElement("div");
folderInfo.className = "comfy-sidebar-file-subtext";
folderInfo.innerHTML = `<i class="pi pi-folder" style="font-size: 10px;"></i><span>${folderName}</span>`;
const folderIcon = document.createElement("i");
folderIcon.className = "pi pi-folder";
folderIcon.style.fontSize = "10px";
const folderLabel = document.createElement("span");
folderLabel.textContent = folderName; // folder names are user/workflow-controlled: never innerHTML
folderInfo.append(folderIcon, folderLabel);
const openHint = document.createElement("div");
openHint.className = "comfy-sidebar-file-subtext";
@@ -429,6 +434,26 @@ export function renderCardImages(cardObj, state, onNavigateBatch) {
const idx = cardObj.currentImageIndex;
const img = state.images[idx];
if (cardObj.element) {
cardObj.element._sidebarPreviewAsset = img || null;
cardObj.element._sidebarPreviewState = state;
cardObj.element._sidebarPreviewCardObj = cardObj;
}
// The Queue's advanced action follows the currently selected batch image.
if (cardObj.btnMove) {
const canMoveToOutputs = Boolean(
img &&
img.type === "temp" &&
isImageFormat(img.filename || img.url)
);
if (canMoveToOutputs) {
cardObj.btnMove.style.removeProperty("display");
} else {
cardObj.btnMove.style.setProperty("display", "none", "important");
}
}
if (!img) {
cardObj.grid.innerHTML = "";
cardObj.firstImgElement = null;
@@ -467,15 +492,15 @@ export function renderCardImages(cardObj, state, onNavigateBatch) {
const existingFile = wrapper.querySelector(".comfy-sidebar-file-wrapper");
if (existingTopImg) {
// Keep the currently rendered frame visible while a replacement source loads.
// Clearing src here made every card refresh briefly collapse to an empty preview.
if (existingTopImg.tagName === "VIDEO") {
existingTopImg.onloadedmetadata = null;
existingTopImg.pause();
existingTopImg.src = "";
existingTopImg.load();
} else {
existingTopImg.onload = null;
existingTopImg.src = "";
}
existingTopImg.onerror = null;
}
if (is3D) {
@@ -545,7 +570,94 @@ export function renderCardImages(cardObj, state, onNavigateBatch) {
activeSrc = canvas.toDataURL("image/png");
} catch (_) {}
}
showFullscreenPreview([activeSrc], ev.shiftKey, state?.pid);
const visibleCardAssets = Array.from(store.ui.cardStack?.querySelectorAll(".comfy-sidebar-card") || [])
.filter(card => card._sidebarPreviewAsset && isImageFormat(card._sidebarPreviewAsset.filename || card._sidebarPreviewAsset.url))
.map(card => ({
...card._sidebarPreviewAsset,
_sidebarOwnerState: card._sidebarPreviewState,
_sidebarOwnerCardObj: card._sidebarPreviewCardObj
}));
const sourceItems = state?._previewImages || (visibleCardAssets.length > 1 ? visibleCardAssets : (state?.images || [img]));
const previewSourceItems = sourceItems
.filter(item => item && isImageFormat(item.filename || item.url))
.map(item => item._sidebarOwnerState ? item : {
...item,
_sidebarOwnerState: state,
_sidebarOwnerCardObj: cardObj
});
const previewItems = previewSourceItems.map(item =>
item.url || "/view?filename=" + encodeURIComponent(item.filename) +
"&type=" + encodeURIComponent(item.type || "output") +
"&subfolder=" + encodeURIComponent(item.subfolder || "") +
(state?.pid ? "&rand=" + encodeURIComponent(state.pid) : "")
);
const currentIndex = Math.max(0, previewSourceItems.findIndex(item =>
item.filename === img.filename && (item.subfolder || "") === (img.subfolder || "")
));
if (previewItems.length) previewItems[currentIndex] = activeSrc;
const onDeletePreviewAsset = async (asset) => {
const action = await deleteFileOnServer(asset);
if (!["trashed", "deleted", "missing"].includes(action)) return false;
if (action !== "missing") {
showNotification(
action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file."),
"success", t("Delete File")
);
}
const ownerState = asset._sidebarOwnerState || state;
const ownerCardObj = asset._sidebarOwnerCardObj || cardObj;
if (typeof asset?._onPreviewAssetDeleted === "function") {
asset._onPreviewAssetDeleted();
} else if (typeof ownerState?._onPreviewAssetDeleted === "function") {
ownerState._onPreviewAssetDeleted(asset);
} else {
const sameFile = candidate => candidate &&
candidate.filename === asset.filename &&
(candidate.subfolder || "") === (asset.subfolder || "") &&
(candidate.type || "output") === (asset.type || "output");
const cardId = ownerCardObj.element?.id || "";
if (cardId.startsWith("card-batch-")) {
const batchInfo = store.ui.activeSubmenuBatchImages;
if (Array.isArray(batchInfo?.images)) {
const index = batchInfo.images.findIndex(sameFile);
if (index >= 0) batchInfo.images.splice(index, 1);
}
const parentPid = ownerState.parentPromptId || batchInfo?.parentPromptId || ownerState.pid;
const parent = store.getPrompt(parentPid);
if (parent) {
parent.images = (parent.images || []).filter(item => !sameFile(item));
if (parent.nodeOutputs) removeImageFromNodeOutputs(parent.nodeOutputs, asset);
store.updatePrompt(parentPid, parent);
}
ownerCardObj.element?.remove();
} else if (cardId.startsWith("card-submenu-")) {
ownerState.images = (ownerState.images || []).filter(item => !sameFile(item));
const parent = store.getPrompt(ownerState.pid);
if (parent?.nodeOutputs) {
removeImageFromNodeOutputs(parent.nodeOutputs, asset);
store.updatePrompt(parent.pid, parent);
}
if (ownerState.images.length) renderCardImages(ownerCardObj, ownerState, onNavigateBatch);
else ownerCardObj.element?.remove();
} else {
const liveState = store.getPrompt(ownerState.pid) || ownerState;
liveState.images = (liveState.images || []).filter(item => !sameFile(item));
if (liveState.nodeOutputs) removeImageFromNodeOutputs(liveState.nodeOutputs, asset);
if (store.getPrompt(liveState.pid)) store.updatePrompt(liveState.pid, liveState);
else if (liveState.images.length) renderCardImages(ownerCardObj, liveState, onNavigateBatch);
else ownerCardObj.element?.remove();
}
}
return true;
};
showFullscreenPreview(
previewItems.length ? previewItems : [activeSrc],
ev.shiftKey,
state?.pid,
currentIndex,
{ assets: previewSourceItems, onDelete: onDeletePreviewAsset }
);
};
mediaEl.onerror = () => {
@@ -554,80 +666,104 @@ export function renderCardImages(cardObj, state, onNavigateBatch) {
const cardId = cardObj.element?.id || "";
// 1. If an intermediate output item is missing, remove only this item
// Ignore a late error from the previous URL if this media element has
// already been pointed at a replacement file (for example after Move).
const failedUrl = new URL(src, window.location.origin).href;
const activeUrl = mediaEl.src;
if (activeUrl && activeUrl !== failedUrl) return;
// 1. If an intermediate output item is missing, remove only that image.
// A node can have several images, so never discard the node's other outputs.
if (cardId.startsWith("card-submenu-")) {
const parentState = store.getPrompt(state.pid);
if (parentState && parentState.nodeOutputs) {
if (state.nodeId && parentState.nodeOutputs[state.nodeId]) {
delete parentState.nodeOutputs[state.nodeId];
} else {
removeImageFromNodeOutputs(parentState.nodeOutputs, img);
}
const missingIndex = state.images?.findIndex(item =>
item.filename === img.filename &&
(item.subfolder || "") === (img.subfolder || "")
) ?? -1;
if (missingIndex >= 0) state.images.splice(missingIndex, 1);
if (parentState?.nodeOutputs) {
removeImageFromNodeOutputs(parentState.nodeOutputs, img);
store.updatePrompt(parentState.pid, parentState);
}
cardObj.element?.remove();
const remaining = store.ui.cardStack?.querySelectorAll('.comfy-sidebar-card');
if (!remaining || remaining.length === 0) {
store.closeSubmenu();
if (state.images?.length > 0) {
cardObj.currentImageIndex = Math.min(cardObj.currentImageIndex || 0, state.images.length - 1);
renderCardImages(cardObj, state, onNavigateBatch);
} else {
cardObj.element?.remove();
const remaining = store.ui.cardStack?.querySelectorAll('.comfy-sidebar-card');
if (!remaining || remaining.length === 0) store.closeSubmenu();
}
return;
}
// 2. If a batch item is missing, remove only this item from the batch
// 2. If a batch item is missing, remove only this item and keep its history.
if (cardId.startsWith("card-batch-")) {
const parentPid = state.parentPromptId || state.pid;
const batchInfo = store.ui.activeSubmenuBatchImages;
const parentPid = state.parentPromptId || batchInfo?.parentPromptId || state.pid;
const parentState = store.getPrompt(parentPid);
if (Array.isArray(batchInfo?.images)) {
const batchIndex = batchInfo.images.findIndex(item =>
item.filename === img.filename &&
(item.subfolder || "") === (img.subfolder || "")
);
if (batchIndex >= 0) batchInfo.images.splice(batchIndex, 1);
}
if (parentState) {
if (Array.isArray(parentState.images)) {
const idx = parentState.images.findIndex(i => i.filename === img.filename && (i.subfolder || "") === (img.subfolder || ""));
if (idx > -1) parentState.images.splice(idx, 1);
}
if (parentState.nodeOutputs) {
removeImageFromNodeOutputs(parentState.nodeOutputs, img);
}
if ((!parentState.images || parentState.images.length === 0) && parentState.status === PromptStatus.COMPLETED) {
deleteHistoryItem(parentPid);
} else {
store.updatePrompt(parentPid, parentState);
}
if (parentState.nodeOutputs) removeImageFromNodeOutputs(parentState.nodeOutputs, img);
store.updatePrompt(parentPid, parentState);
}
cardObj.element?.remove();
const remaining = store.ui.cardStack?.querySelectorAll('.comfy-sidebar-card');
if (!remaining || remaining.length === 0) {
store.closeSubmenu();
}
if (!remaining || remaining.length === 0) store.closeSubmenu();
return;
}
// 3. Main card: if this file is gone, clean it up
// 3. Main card
const liveState = store.getPrompt(state.pid);
if (liveState) {
if (Array.isArray(liveState.images)) {
liveState.images = liveState.images.filter(i =>
!(i.filename === img.filename && (i.subfolder || "") === (img.subfolder || ""))
);
}
if (liveState.nodeOutputs) {
removeImageFromNodeOutputs(liveState.nodeOutputs, img);
}
const sameFile = (i) => i.filename === img.filename && (i.subfolder || "") === (img.subfolder || "");
const remaining = Array.isArray(liveState.images) ? liveState.images.filter(i => !sameFile(i)) : [];
if (liveState.images && liveState.images.length > 0) {
cardObj.currentImageIndex = 0;
if (remaining.length > 0) {
// Other images of this card are still there: only drop the broken one.
liveState.images = remaining;
if (liveState.nodeOutputs) removeImageFromNodeOutputs(liveState.nodeOutputs, img);
cardObj.currentImageIndex = Math.min(cardObj.currentImageIndex || 0, remaining.length - 1);
cardObj.lastImagesSignature = "";
store.updatePrompt(liveState.pid, liveState);
renderCardImages(cardObj, liveState, onNavigateBatch);
return;
}
// If the job is still actively generating/running, keep it
if (liveState.status && liveState.status !== PromptStatus.COMPLETED) {
cardObj.lastImagesSignature = "";
store.updatePrompt(liveState.pid, liveState);
return;
}
// The last image of this card failed to load. One failed request is not proof that the file is
// gone (race with Move, restart, a path reused by a newer run), so ask the server first.
handleMissingMedia(liveState, img).then((outcome) => {
if (outcome === "removed") {
cardObj.element?.remove();
return;
}
if (outcome !== "missing") return; // file exists, or we couldn't tell: leave the card alone
// Temp image preview was deleted and only intermediate prompt text remains: delete card for good
deleteHistoryItem(liveState.pid);
cardObj.element?.remove();
// Confirmed gone, and the user chose to keep history: show the card text-only. Its workflow
// stays available (drag / JSON button) because the card now has no images.
liveState.images = [];
if (liveState.nodeOutputs) removeImageFromNodeOutputs(liveState.nodeOutputs, img);
renderCardImages(cardObj, liveState, onNavigateBatch);
cardObj.grid.innerHTML = "";
cardObj.firstImgElement = null;
cardObj.lastImagesSignature = "";
cardObj.placeholder.textContent = liveState.texts?.length
? liveState.texts.join("\n\n")
: t("No Outputs");
cardObj.placeholder.style.display = "block";
store.updatePrompt(liveState.pid, liveState);
});
return;
}
@@ -742,7 +878,7 @@ export function renderCardImages(cardObj, state, onNavigateBatch) {
}
const currentSrc = mediaEl.getAttribute("src") || mediaEl.src;
if (currentSrc !== src && currentSrc !== (currentSrc + "#t=0.001")) {
if (currentSrc !== src && currentSrc !== (src + "#t=0.001")) {
if (src.startsWith("blob:") && !isVideo) {
const tempImg = new Image();
tempImg.onload = () => {
+142 -35
View File
@@ -8,9 +8,10 @@ import { updateSidebarBadge, centerAndSelectCanvasNode } from "../comfy/adapter.
import { matchesFilter, getRunOutputs, isImageFormat, animateCardRemoval, getScrollContainer, calculateGridColumns, setupSpotlightTracker, attachDeleteConfirmation } from "../utils/utils.js";
import { getSetting } from "../core/settings.js";
import { renderCardImages } from "./mediaPreview.js";
import { deleteFileOnServer, removeImageFromNodeOutputs, copyImageToClipboard, findNodeIdForImage } from "./mediaActions.js";
import { deleteFilesWithFeedback, moveTempImageToOutput, updateMovedImageReferences, removeImageFromNodeOutputs, copyImageToClipboard, findNodeIdForImage } from "./mediaActions.js";
import { toggleIgnoreActiveNode } from "../comfy/nodes.js";
import { renumberNodesTopologically, showNotification } from "../utils/nodeRenumber.js";
import { showNotification } from "../utils/nodeRenumber.js";
import { clearTemporaryCards, countTemporaryCards } from "./clearTemporary.js";
let scrollToTopBtnEl = null;
let globalClickRegistered = false;
@@ -261,7 +262,9 @@ export function setupSidebarView() {
return btn;
};
const createActionBtn = (iconClass, tooltip, hoverColor, onClickFn) => {
// `onArm` runs on the first press. Return false to cancel arming (nothing to confirm),
// or a string to show as the tooltip while the button waits for its confirming press.
const createActionBtn = (iconClass, tooltip, hoverColor, onClickFn, onArm = null) => {
const btn = document.createElement("button");
btn.className = `${iconClass} comfy-sidebar-header-btn`;
btn.title = tooltip;
@@ -269,6 +272,7 @@ export function setupSidebarView() {
let timeout = null, isPending = false;
const reset = () => {
isPending = false;
btn.title = tooltip;
Object.assign(btn.style, {
color: "", background: "",
borderColor: "", boxShadow: ""
@@ -279,6 +283,9 @@ export function setupSidebarView() {
btn.addEventListener("click", async (ev) => {
ev.stopPropagation();
if (!isPending) {
const armed = onArm ? onArm() : true;
if (armed === false) return;
if (typeof armed === "string") btn.title = armed;
isPending = true;
Object.assign(btn.style, {
color: "#fff", background: hoverColor, borderColor: hoverColor,
@@ -308,10 +315,6 @@ export function setupSidebarView() {
toggleIgnoreActiveNode(() => renderSidebar());
});
const btnRenumber = createInstantBtn("pi pi-sort-numeric-down", t("Renumber All Nodes by Execution Order (Alt+R)"), async () => {
await renumberNodesTopologically();
});
const divider = document.createElement("div");
Object.assign(divider.style, {
width: "1px", height: "14px", background: "var(--border, var(--border-color, #444))",
@@ -323,15 +326,28 @@ export function setupSidebarView() {
renderSidebar();
});
const btnClearAll = createActionBtn("pi pi-trash", t("Clear All History"), "#dc3545", async () => {
await clearAllHistory();
const btnClearTemporary = createActionBtn("pi pi-hourglass", t("Clear Temporary (cards and files not saved to Outputs)"), "#fd7e14", async () => {
await clearTemporaryCards();
renderSidebar();
}, () => {
const count = countTemporaryCards();
if (count === 0) {
showNotification(t("Nothing temporary to clear."), "success", t("Clear Temporary"));
return false;
}
return t("Click again to clear {count} temporary card(s)", { count });
});
const btnClearAll = createActionBtn("pi pi-trash", t("Clear All History"), "#dc3545", async () => {
await clearTemporaryCards();
await clearAllHistory();
renderSidebar();
}, () => t("Click again to clear all history"));
actionsGroup.appendChild(btnToggleIgnore);
actionsGroup.appendChild(btnRenumber);
actionsGroup.appendChild(divider);
actionsGroup.appendChild(btnClearInterrupted);
actionsGroup.appendChild(btnClearTemporary);
actionsGroup.appendChild(btnClearAll);
standardHeader.appendChild(actionsGroup);
@@ -552,20 +568,27 @@ export function renderSidebar() {
btnDelLabel.textContent = t("Delete File");
btnDel.appendChild(btnDelLabel);
const btnMove = document.createElement("span");
btnMove.className = "pi pi-folder-open comfy-sidebar-card-action-btn comfy-sidebar-btn-move";
btnMove.title = t("Move selected image to Outputs (Ctrl+Click)");
const btnMoveLabel = document.createElement("span");
btnMoveLabel.className = "comfy-sidebar-move-label";
btnMoveLabel.textContent = t("Move to Outputs");
btnMove.appendChild(btnMoveLabel);
btnMove.style.display = "none";
attachDeleteConfirmation(btnDel, {
idleTitle: t("Remove from batch (Hold Ctrl to delete file from disk)"),
confirmTitle: t("Click again to confirm removing from batch"),
confirmDiskTitle: t("Ctrl+Click again to delete file from DISK / TRASH"),
onConfirm: async (shouldDeleteFromDisk) => {
animateCardRemoval(card, async () => {
if (shouldDeleteFromDisk && img && img.filename) {
const action = await deleteFileOnServer(img);
if (action) {
const msg = action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file.");
showNotification(msg, "success", t("Delete File"));
}
}
// Delete first: if the file can't be deleted (e.g. the Recycle Bin dialog was
// cancelled) the card has to stay.
if (shouldDeleteFromDisk && img && img.filename) {
if (!(await deleteFilesWithFeedback([img], t("Delete File")))) return;
}
animateCardRemoval(card, async () => {
const pid = batchInfo.parentPromptId || batchInfo.pid;
const state = store.getPrompt(pid);
const imgIdx = batchInfo.images.indexOf(img);
@@ -602,7 +625,7 @@ export function renderSidebar() {
}
});
hoverPanel.append(btnImg, btnDel);
hoverPanel.append(btnImg, btnMove, btnDel);
const leftHoverPanel = document.createElement("div");
leftHoverPanel.className = "comfy-sidebar-left-hover-panel";
@@ -661,12 +684,56 @@ export function renderSidebar() {
btnCopy,
btnFocus,
btnDel,
btnMove,
firstImgElement: null
};
cardPool.set(cardId, cardObj);
}
if (cardObj.btnMove) {
const canMoveImage = Boolean(
img &&
img.type === "temp" &&
isImageFormat(img.filename || img.url)
);
if (canMoveImage) {
cardObj.btnMove.title = t("Move selected image to Outputs (Ctrl+Click)");
cardObj.btnMove.onclick = async (ev) => {
ev.stopPropagation();
if (!ev.ctrlKey && !ev.metaKey) return;
if (cardObj._isMovingTempImage) return;
const pid = batchInfo.parentPromptId || batchInfo.pid;
const liveState = store.getPrompt(pid);
const imageToMove = img;
if (!imageToMove || imageToMove.type !== "temp") return;
cardObj._isMovingTempImage = true;
cardObj.btnMove.style.opacity = "0.5";
const moved = await moveTempImageToOutput(imageToMove);
if (moved?.success) {
updateMovedImageReferences(liveState?.images, imageToMove, moved);
updateMovedImageReferences(liveState?.nodeOutputs, imageToMove, moved);
updateMovedImageReferences(batchInfo.images, imageToMove, moved);
updateMovedImageReferences(batchInfo.nodeOutputs, imageToMove, moved);
if (liveState) store.updatePrompt(pid, liveState);
showNotification(t("Moved selected image to Outputs."), "success", t("Move to Outputs"));
renderSidebar();
} else {
showNotification(t("Failed to move image to Outputs."), "error", t("Move to Outputs"));
}
cardObj._isMovingTempImage = false;
cardObj.btnMove.style.opacity = "";
};
} else {
cardObj.btnMove.onclick = null;
}
}
cardObj.placeholder.style.display = "none";
renderCardImages(cardObj, {
pid: batchInfo.pid,
@@ -804,27 +871,24 @@ export function renderSidebar() {
btnDelLabel.textContent = t("Delete File");
btnDel.appendChild(btnDelLabel);
const btnMove = document.createElement("span");
btnMove.className = "pi pi-folder-open comfy-sidebar-card-action-btn comfy-sidebar-btn-move";
btnMove.title = t("Move selected image to Outputs (Ctrl+Click)");
const btnMoveLabel = document.createElement("span");
btnMoveLabel.className = "comfy-sidebar-move-label";
btnMoveLabel.textContent = t("Move to Outputs");
btnMove.appendChild(btnMoveLabel);
attachDeleteConfirmation(btnDel, {
idleTitle: t("Delete node output (Hold Ctrl to delete file from disk)"),
confirmTitle: t("Click again to confirm removing output"),
confirmDiskTitle: t("Ctrl+Click again to delete this node's files from DISK / TRASH"),
onConfirm: async (shouldDeleteFromDisk) => {
animateCardRemoval(card, async () => {
if (shouldDeleteFromDisk && out.images) {
let count = 0;
let lastAct = "trashed";
for (const imgItem of out.images) {
const action = await deleteFileOnServer(imgItem);
if (action) { count++; lastAct = action; }
}
if (count > 0) {
const msg = lastAct === "trashed"
? `Moved ${count} file${count > 1 ? "s" : ""} to Recycle Bin.`
: `Permanently deleted ${count} file${count > 1 ? "s" : ""}.`;
showNotification(msg, "success", "Delete Files");
}
}
if (shouldDeleteFromDisk && out.images) {
if (!(await deleteFilesWithFeedback(out.images))) return;
}
animateCardRemoval(card, async () => {
if (st.nodeOutputs && st.nodeOutputs[out.nodeId]) {
delete st.nodeOutputs[out.nodeId];
}
@@ -843,7 +907,7 @@ export function renderSidebar() {
}
});
hoverPanel.append(btnImg, btnDel);
hoverPanel.append(btnImg, btnMove, btnDel);
const leftHoverPanel = document.createElement("div");
leftHoverPanel.className = "comfy-sidebar-left-hover-panel";
@@ -898,12 +962,55 @@ export function renderSidebar() {
btnCopy,
btnFocus,
btnDel,
btnMove,
firstImgElement: null
};
cardPool.set(cardId, cardObj);
}
if (cardObj.btnMove) {
const selectedImage = out.images?.[cardObj.currentImageIndex || 0];
const canMoveSelectedImage = Boolean(
selectedImage &&
selectedImage.type === "temp" &&
isImageFormat(selectedImage.filename || selectedImage.url)
);
if (canMoveSelectedImage) {
cardObj.btnMove.title = t("Move selected image to Outputs (Ctrl+Click)");
cardObj.btnMove.onclick = async (ev) => {
ev.stopPropagation();
if (!ev.ctrlKey && !ev.metaKey) return;
if (cardObj._isMovingTempImage) return;
const liveState = store.getPrompt(st.pid) || st;
const imageToMove = out.images?.[cardObj.currentImageIndex || 0];
if (!imageToMove || imageToMove.type !== "temp") return;
cardObj._isMovingTempImage = true;
cardObj.btnMove.style.opacity = "0.5";
const moved = await moveTempImageToOutput(imageToMove);
if (moved?.success) {
updateMovedImageReferences(liveState.images, imageToMove, moved);
updateMovedImageReferences(liveState.nodeOutputs, imageToMove, moved);
updateMovedImageReferences(out.images, imageToMove, moved);
store.updatePrompt(liveState.pid, liveState);
showNotification(t("Moved selected image to Outputs."), "success", t("Move to Outputs"));
renderSidebar();
} else {
showNotification(t("Failed to move image to Outputs."), "error", t("Move to Outputs"));
}
cardObj._isMovingTempImage = false;
cardObj.btnMove.style.opacity = "";
};
} else {
cardObj.btnMove.onclick = null;
}
}
if (out.images && out.images.length > 0) {
cardObj.placeholder.style.display = "none";
renderCardImages(cardObj, {
+323
View File
@@ -0,0 +1,323 @@
import { t } from "../core/i18n.js";
import { deleteFileOnServer } from "./mediaActions.js";
import { attachDeleteConfirmation, setupSpotlightTracker } from "../utils/utils.js";
import { showNotification } from "../utils/nodeRenumber.js";
import { renderCardImages } from "./mediaPreview.js";
import { SidebarOverlay } from "../utils/overlay.js";
export async function openSimilarPromptsDialog(currentSubfolder = "") {
let requestId = 0;
let requestController = null;
let debounce = null;
const closeGroupViewer = () => {
requestController?.abort();
clearTimeout(debounce);
};
// The group viewer shares the same overlay system as fullscreen previews.
// A preview opened from a card is appended later and becomes the top layer.
const overlay = new SidebarOverlay({
className: "comfy-sidebar-similar-prompts-overlay",
background: "rgba(0, 0, 0, 0.58)",
zIndex: 1000,
onUserClose: closeGroupViewer
});
// Render directly on the shared overlay. Its bounds already account for
// open sidebars, so the group UI naturally uses the remaining workspace.
const content = document.createElement("div");
Object.assign(content.style, {
position: "absolute", inset: "0", width: "100%", height: "100%",
minHeight: "0", display: "flex", flexDirection: "column", gap: "12px",
padding: "20px 24px", boxSizing: "border-box", font: "inherit",
pointerEvents: "auto", userSelect: "auto", overflow: "hidden", zIndex: "20"
});
const heading = document.createElement("div");
Object.assign(heading.style, {
display: "flex", alignItems: "center", justifyContent: "space-between", gap: "12px", flex: "none"
});
const title = document.createElement("strong");
title.textContent = t("Similar prompt groups");
const status = document.createElement("span");
Object.assign(status.style, { marginLeft: "auto", marginRight: "44px", fontSize: "11px", opacity: "0.65" });
// SidebarOverlay supplies the same round close control used by previews.
heading.append(title, status);
const controls = document.createElement("div");
Object.assign(controls.style, {
display: "flex", alignItems: "center", flexWrap: "wrap", gap: "18px",
fontSize: "12px", flex: "none", padding: "4px 0"
});
const thresholdLabel = document.createElement("label");
thresholdLabel.textContent = t("Similarity threshold");
Object.assign(thresholdLabel.style, { display: "flex", alignItems: "center", gap: "10px", lineHeight: "1" });
const threshold = document.createElement("input");
threshold.type = "range";
threshold.min = "25";
threshold.max = "90";
threshold.step = "5";
const savedSettings = (() => {
try { return JSON.parse(localStorage.getItem("comfy-sidebar-similar-prompts-settings-v1") || "{}"); }
catch (_) { return {}; }
})();
threshold.value = String(Math.max(25, Math.min(90, Number(savedSettings.threshold) || 55)));
Object.assign(threshold.style, { verticalAlign: "middle", accentColor: "var(--primary, var(--p-primary-color, var(--primary-color, var(--accent, currentColor))))", cursor: "pointer" });
const thresholdValue = document.createElement("span");
Object.assign(thresholdValue.style, { alignSelf: "center", minWidth: "34px", fontVariantNumeric: "tabular-nums" });
thresholdValue.textContent = threshold.value + "%";
thresholdLabel.append(threshold, thresholdValue);
controls.appendChild(thresholdLabel);
const cardSizeLabel = document.createElement("label");
cardSizeLabel.textContent = t("Card size");
Object.assign(cardSizeLabel.style, { display: "flex", alignItems: "center", gap: "10px", lineHeight: "1" });
const cardSize = document.createElement("input");
cardSize.type = "range";
cardSize.min = "100";
cardSize.max = "280";
cardSize.step = "10";
cardSize.value = String(Math.max(100, Math.min(280, Number(savedSettings.cardSize) || 150)));
Object.assign(cardSize.style, { verticalAlign: "middle", accentColor: "var(--primary, var(--p-primary-color, var(--primary-color, var(--accent, currentColor))))", cursor: "pointer" });
cardSizeLabel.appendChild(cardSize);
controls.appendChild(cardSizeLabel);
const results = document.createElement("div");
Object.assign(results.style, {
overflowY: "auto", minHeight: "0", flex: "1", paddingRight: "4px",
display: "flex", flexDirection: "column", gap: "12px"
});
content.append(heading, controls, results);
overlay.container.appendChild(content);
overlay.addCleanup(closeGroupViewer);
setupSpotlightTracker(results, ".comfy-sidebar-card");
const saveSettings = () => {
try {
localStorage.setItem("comfy-sidebar-similar-prompts-settings-v1", JSON.stringify({
threshold: Number(threshold.value),
cardSize: Number(cardSize.value)
}));
} catch (_) {}
};
// Justified-row layout: cards flow left to right and wrap like text, each
// sized from its real aspect ratio so every card in a row shares a height
// and each row fills the width. (Vertical masonry columns looked odd here
// because the groups are wide and short, so we read them row by row.)
// Dimensions come from the server, so layout is exact before images load.
const GAP = 8;
const ROW_HEIGHT_PER_SIZE = 1.5; // slider value -> target row height in px
let groupViews = [];
let cardChrome = null; // horizontal/vertical padding+border of a card
const measureChrome = (card) => {
const cs = getComputedStyle(card);
const px = (v) => parseFloat(v) || 0;
return {
h: px(cs.paddingLeft) + px(cs.paddingRight) + px(cs.borderLeftWidth) + px(cs.borderRightWidth),
v: px(cs.paddingTop) + px(cs.paddingBottom) + px(cs.borderTopWidth) + px(cs.borderBottomWidth)
};
};
const sizeCard = (card) => {
const rowHeight = Number(cardSize.value) * ROW_HEIGHT_PER_SIZE;
const chrome = cardChrome || { h: 18, v: 18 };
const basis = card._aspect * Math.max(20, rowHeight - chrome.v) + chrome.h;
// Grow in proportion to width so cards in a row keep equal heights.
card.style.flex = `${basis} 1 ${basis}px`;
};
const resizeAllCards = () => {
const sample = groupViews.flatMap(view => view.cards)[0];
if (sample?.isConnected) cardChrome = measureChrome(sample);
groupViews.forEach(view => view.cards.forEach(sizeCard));
};
const updateCardSize = () => {
resizeAllCards();
saveSettings();
};
cardSize.addEventListener("input", updateCardSize);
const loadGroups = async () => {
if (requestController) requestController.abort();
const controller = new AbortController();
requestController = controller;
const id = ++requestId;
status.textContent = t("Scanning prompts...");
results.replaceChildren();
groupViews = [];
thresholdValue.textContent = threshold.value + "%";
try {
const params = new URLSearchParams({
subfolder: currentSubfolder,
threshold: (Number(threshold.value) / 100).toFixed(2)
});
const response = await fetch("/comfy-sidebar/gallery/similar-prompts?" + params.toString(), {
signal: controller.signal
});
if (!response.ok) throw new Error("HTTP " + response.status);
const data = await response.json();
if (id !== requestId || overlay.destroyed) return;
status.textContent = t("{count} groups · {scanned} PNGs scanned", {
count: data.groups?.length || 0, scanned: data.scanned || 0
});
if (!data.groups?.length) {
const empty = document.createElement("div");
empty.textContent = t("No similar prompt groups found at this threshold.");
empty.style.cssText = "padding:28px;text-align:center;opacity:.65;font-size:12px";
results.appendChild(empty);
return;
}
data.groups.forEach((group, groupIndex) => {
const section = document.createElement("section");
Object.assign(section.style, {
border: "1px solid var(--border-color, rgba(255,255,255,.12))",
borderRadius: "8px", padding: "10px", display: "flex",
flexDirection: "column", gap: "8px"
});
const groupHeader = document.createElement("div");
Object.assign(groupHeader.style, {
display: "flex", justifyContent: "space-between", fontSize: "11px", opacity: ".8"
});
const groupName = document.createElement("strong");
const view = { grid: null, cards: [] };
const updateGroupTitle = () => {
groupName.textContent = t("Group") + " " + (groupIndex + 1) + " · " + view.cards.length + " " + t("images");
};
const removeCard = (card) => {
card.remove();
const at = view.cards.indexOf(card);
if (at >= 0) view.cards.splice(at, 1);
if (!view.cards.length) {
section.remove();
groupViews = groupViews.filter(v => v !== view);
} else {
updateGroupTitle();
}
};
const score = document.createElement("span");
score.textContent = group.similarity + "% " + t("similarity");
groupHeader.append(groupName, score);
const grid = document.createElement("div");
grid.className = "comfy-sidebar-similar-grid";
Object.assign(grid.style, {
display: "flex", flexWrap: "wrap", gap: GAP + "px", alignItems: "flex-start", width: "100%"
});
view.grid = grid;
// Zero-height spacer soaking up the free space on the last row so
// it keeps natural card sizes instead of stretching to full width.
const tailSpacer = document.createElement("div");
Object.assign(tailSpacer.style, {
flex: "1000000 1 0px", height: "0", marginTop: "-" + GAP + "px"
});
const previewAssets = group.items.map(item => ({
filename: item.filename,
subfolder: item.subfolder || "",
type: "output"
}));
group.items.forEach((item, itemIndex) => {
const card = document.createElement("div");
card.className = "comfy-sidebar-card completed";
Object.assign(card.style, {
position: "relative", cursor: "pointer", minWidth: "0", boxSizing: "border-box"
});
card._aspect = item.width > 0 && item.height > 0 ? item.width / item.height : 1;
const previewUrl = "/view?filename=" + encodeURIComponent(item.filename) +
"&type=output&subfolder=" + encodeURIComponent(item.subfolder || "");
const gridContent = document.createElement("div");
gridContent.style.width = "100%";
// Reserve the right height before the image arrives.
if (item.width > 0 && item.height > 0) gridContent.style.aspectRatio = item.width + " / " + item.height;
const cardObj = {
element: card,
grid: gridContent,
dimEl: null,
currentImageIndex: 0,
firstImgElement: null
};
const asset = {
filename: item.filename,
subfolder: item.subfolder || "",
type: "output",
url: previewUrl
};
previewAssets[itemIndex]._onPreviewAssetDeleted = () => removeCard(card);
// Use Gallery's media renderer so the image keeps its native
// aspect ratio and the spotlight remains on the card surface.
renderCardImages(cardObj, {
pid: `similar-${groupIndex}-${item.filename}`,
images: [asset],
_previewImages: previewAssets,
workflow: null
});
const nameBadge = document.createElement("div");
nameBadge.className = "comfy-sidebar-card-filename-badge";
nameBadge.textContent = item.filename;
nameBadge.title = item.filename;
const actions = document.createElement("div");
actions.className = "comfy-sidebar-hover-panel";
Object.assign(actions.style, {
position: "absolute", bottom: "4px", right: "4px",
flexDirection: "column", gap: "4px", zIndex: "20"
});
const deleteButton = document.createElement("span");
deleteButton.className = "pi pi-trash comfy-sidebar-card-action-btn comfy-sidebar-btn-del";
attachDeleteConfirmation(deleteButton, {
idleTitle: t("Delete file"),
confirmTitle: t("Click again to confirm deleting file"),
confirmDiskTitle: t("Ctrl+Click again to delete file from DISK / TRASH"),
onConfirm: async () => {
const action = await deleteFileOnServer({
filename: item.filename,
subfolder: item.subfolder || "",
type: "output"
});
if (action && action !== "missing") {
showNotification(
action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file."),
"success", t("Delete File")
);
}
if (action) removeCard(card);
}
});
actions.appendChild(deleteButton);
card.append(gridContent, nameBadge, actions);
view.cards.push(card);
sizeCard(card);
grid.appendChild(card);
});
grid.appendChild(tailSpacer);
updateGroupTitle();
section.append(groupHeader, grid);
results.appendChild(section);
groupViews.push(view);
if (!cardChrome) resizeAllCards();
});
} catch (error) {
if (error?.name === "AbortError" || id !== requestId) return;
status.textContent = t("Could not scan prompts");
const message = document.createElement("div");
message.textContent = error?.message || String(error);
message.style.cssText = "padding:20px;color:var(--error-text,#f87171);font-size:12px";
results.appendChild(message);
} finally {
if (requestController === controller) requestController = null;
}
};
threshold.addEventListener("input", () => {
thresholdValue.textContent = threshold.value + "%";
saveSettings();
clearTimeout(debounce);
debounce = setTimeout(loadGroups, 250);
});
await loadGroups();
return overlay;
}
+228 -17
View File
@@ -1,4 +1,4 @@
import { isVideoFormat, is3DFormat, isAudioFormat, getFilenameFromUrl } from "./utils.js";
import { isVideoFormat, is3DFormat, isAudioFormat, getFilenameFromUrl, isImageFormat, findImagesInOutputs, attachDeleteConfirmation } from "./utils.js";
import { create3DViewer } from "./viewer3d.js";
import { createTextReader } from "./text_reader.js";
import { stopAllAudioPlayback } from "../ui/audioController.js";
@@ -6,11 +6,32 @@ import { SidebarOverlay } from "./overlay.js";
import { store } from "../core/store.js";
import { PromptStatus } from "../core/constants.js";
import { t } from "../core/i18n.js";
import { deleteFileOnServer, removeImageFromNodeOutputs } from "../ui/mediaActions.js";
import { showNotification } from "./nodeRenumber.js";
let activeComparisonViewer = null;
let isRuntimePreviewActive = false;
let onRuntimePreviewStateChange = null;
async function deletePromptPreviewAsset(state, asset) {
const action = await deleteFileOnServer(asset);
if (!["trashed", "deleted", "missing"].includes(action)) return false;
if (action !== "missing") {
showNotification(
action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file."),
"success", t("Delete File")
);
}
const sameFile = item => item &&
item.filename === asset.filename &&
(item.subfolder || "") === (asset.subfolder || "") &&
(item.type || "output") === (asset.type || "output");
state.images = (state.images || []).filter(item => !sameFile(item));
if (state.nodeOutputs) removeImageFromNodeOutputs(state.nodeOutputs, asset);
store.updatePrompt(state.pid, state);
return true;
}
export function isRuntimePreviewEnabled() {
return isRuntimePreviewActive;
}
@@ -64,7 +85,20 @@ export function focusRuntimePreviewTarget() {
if (activePrompt && activePrompt.status === PromptStatus.ACTIVE) {
const previewSrc = activePrompt._previewBlobUrl ||
(activePrompt.images && activePrompt.images.length > 0 ? (activePrompt.images[0].url || activePrompt.images[0].filename) : null);
showFullscreenPreview([previewSrc || ""], false, activePrompt.pid);
const promptImages = [
...(activePrompt.images || []),
...(activePrompt.nodeOutputs ? findImagesInOutputs(activePrompt.nodeOutputs, activePrompt.workflow) : [])
];
const previewImages = promptImages.filter((img, index, all) =>
img && isImageFormat(img.filename || img.url) &&
all.findIndex(other => other && (other.filename || other.url) === (img.filename || img.url)) === index
);
const previewUrls = previewImages.map(img => img.url || `/view?filename=${encodeURIComponent(img.filename)}&type=${img.type || "output"}&subfolder=${encodeURIComponent(img.subfolder || "")}${activePrompt.pid ? "&rand=" + encodeURIComponent(activePrompt.pid) : ""}`);
const startIndex = previewImages.findIndex(img => img.url === previewSrc || img.filename === activePrompt.images?.[0]?.filename);
showFullscreenPreview(previewUrls.length ? previewUrls : [previewSrc || ""], false, activePrompt.pid, Math.max(0, startIndex), {
assets: previewImages,
onDelete: asset => deletePromptPreviewAsset(activePrompt, asset)
});
return;
}
@@ -77,7 +111,19 @@ export function focusRuntimePreviewTarget() {
const randParam = latest.pid ? `&rand=${encodeURIComponent(latest.pid)}` : "";
const src = latest._previewBlobUrl ||
(firstImg ? (firstImg.url || `/view?filename=${encodeURIComponent(firstImg.filename)}&type=${firstImg.type || 'output'}&subfolder=${encodeURIComponent(firstImg.subfolder || '')}${randParam}`) : "");
showFullscreenPreview([src || ""], false, latest.pid);
const promptImages = [
...(latest.images || []),
...(latest.nodeOutputs ? findImagesInOutputs(latest.nodeOutputs, latest.workflow) : [])
];
const previewImages = promptImages.filter((img, index, all) =>
img && isImageFormat(img.filename || img.url) &&
all.findIndex(other => other && (other.filename || other.url) === (img.filename || img.url)) === index
);
const previewUrls = previewImages.map(img => img.url || `/view?filename=${encodeURIComponent(img.filename)}&type=${img.type || "output"}&subfolder=${encodeURIComponent(img.subfolder || "")}${randParam}`);
showFullscreenPreview(previewUrls.length ? previewUrls : [src || ""], false, latest.pid, 0, {
assets: previewImages,
onDelete: asset => deletePromptPreviewAsset(latest, asset)
});
} else {
// Queue is totally empty
showFullscreenPreview([""], false, null);
@@ -124,6 +170,7 @@ function createAudioViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = () =>
let togglePlayFn = () => {};
const overlay = new SidebarOverlay({
zIndex: 1100,
onDestroy,
onUserClose: () => {
if (isRuntimePreviewActive) setRuntimePreviewEnabled(false, false);
@@ -463,18 +510,32 @@ const setupVideoPlayback = (vid, container) => {
};
};
function createComparisonViewer(baseSrc, onDestroy = () => {}) {
function createComparisonViewer(baseSrc, onDestroy = () => {}, navigationItems = [], startIndex = 0, previewOptions = {}) {
const isBaseVideo = isVideoFormat(baseSrc);
let splitRatio = 50;
let splitRatio = 50;
let mediaB = null;
let navItems = Array.isArray(navigationItems) ? navigationItems.filter(Boolean) : [];
let navAssets = Array.isArray(previewOptions.assets) ? previewOptions.assets.slice() : [];
let navIndex = Math.max(0, Math.min(startIndex, navItems.length - 1));
let navigate = () => {};
const overlay = new SidebarOverlay({
zIndex: 1100,
onDestroy,
onUserClose: () => {
if (isRuntimePreviewActive) setRuntimePreviewEnabled(false, false);
},
onKeyDown: (e) => {
if (e.key === " " && mediaB) {
if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && navItems.length > 1) {
e.preventDefault();
e.stopPropagation();
navigate(e.key === "ArrowRight" ? 1 : -1);
} else if (e.key === "Delete" && !e.repeat && navAssets[navIndex] && typeof previewOptions.onDelete === "function") {
e.preventDefault();
e.stopPropagation();
// Uses the same two-step confirmation state as clicking the trash icon.
deleteButton.click();
} else if (e.key === " " && mediaB) {
e.preventDefault();
updateSliderPosition(splitRatio > 50 ? 0 : 100);
}
@@ -575,10 +636,6 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
wrapper.appendChild(mediaA);
let isZoomed = false;
if (!baseSrc) {
showPlaceholder();
}
const slider = document.createElement("div");
slider.className = "comfy-sidebar-comparison-slider";
Object.assign(slider.style, {
@@ -623,12 +680,24 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
}
};
// Must run after `slider` and `cleanupMedia` are initialised (showPlaceholder uses both).
if (!baseSrc) {
showPlaceholder();
}
const syncImageScales = () => {
if (!mediaA) return;
const wA = mediaA.naturalWidth || mediaA.videoWidth || 0;
const hA = mediaA.naturalHeight || mediaA.videoHeight || 0;
if (!wA || !hA) return;
// Runtime previews always stay centered and fitted, without changing the
// zoom preference retained for ordinary image inspection.
if (isRuntimePreviewActive) {
scrollContainer.scrollTop = 0;
scrollContainer.scrollLeft = 0;
}
// Calculate available space inside the preview area
const availW = Math.max(100, (scrollContainer.clientWidth || window.innerWidth) - 48);
const availH = Math.max(100, (scrollContainer.clientHeight || window.innerHeight) - 96);
@@ -646,9 +715,9 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
if (!mediaB) {
slider.style.display = "none";
wrapper.style.cursor = isBaseVideo ? "default" : (isZoomed ? "zoom-out" : "zoom-in");
wrapper.style.cursor = isBaseVideo || isRuntimePreviewActive ? "default" : (isZoomed ? "zoom-out" : "zoom-in");
if (mediaA) mediaA.style.pointerEvents = isBaseVideo ? "none" : "auto";
if (isZoomed) {
if (isZoomed && !isRuntimePreviewActive) {
wrapper.style.maxWidth = "none";
wrapper.style.maxHeight = "none";
wrapper.style.width = `${wA}px`;
@@ -775,7 +844,7 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
}
const toggleZoom = () => {
if (isBaseVideo) return;
if (isBaseVideo || isRuntimePreviewActive) return;
isZoomed = !isZoomed;
syncImageScales();
if (!isZoomed) {
@@ -860,8 +929,142 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
cleanupMedia(mediaB);
});
const navButtonStyle = {
position: "absolute", top: "50%", transform: "translateY(-50%)",
width: "30px", height: "30px", borderRadius: "50%",
border: "1px solid var(--border-color, rgba(255,255,255,.18))",
background: "color-mix(in srgb, var(--card, #181818) 88%, transparent)",
color: "var(--fg-color, #eee)", fontSize: "18px", cursor: "pointer",
zIndex: "35", pointerEvents: "auto", backdropFilter: "blur(8px)"
};
const prevButton = document.createElement("button");
prevButton.type = "button";
prevButton.title = t("Previous image (←)");
Object.assign(prevButton.style, navButtonStyle, {
left: "18px", padding: "0", lineHeight: "1", appearance: "none",
display: "flex", alignItems: "center", justifyContent: "center"
});
const prevIcon = document.createElement("span");
prevIcon.className = "pi pi-angle-left";
prevIcon.style.pointerEvents = "none";
prevButton.appendChild(prevIcon);
const nextButton = document.createElement("button");
nextButton.type = "button";
nextButton.title = t("Next image (→)");
Object.assign(nextButton.style, navButtonStyle, {
right: "18px", padding: "0", lineHeight: "1", appearance: "none",
display: "flex", alignItems: "center", justifyContent: "center"
});
const nextIcon = document.createElement("span");
nextIcon.className = "pi pi-angle-right";
nextIcon.style.pointerEvents = "none";
nextButton.appendChild(nextIcon);
const deleteButton = document.createElement("button");
deleteButton.type = "button";
deleteButton.className = "comfy-sidebar-preview-delete";
deleteButton.title = t("Delete current image");
Object.assign(deleteButton.style, navButtonStyle, {
top: "auto", bottom: "24px", right: "24px", transform: "none",
padding: "0", lineHeight: "1", appearance: "none",
fontSize: "15px", display: "none", alignItems: "center", justifyContent: "center"
});
const deleteIcon = document.createElement("span");
deleteIcon.className = "pi pi-trash";
Object.assign(deleteIcon.style, {
display: "block", lineHeight: "1", pointerEvents: "none",
transform: "none"
});
deleteButton.appendChild(deleteIcon);
attachDeleteConfirmation(deleteButton, {
canDiskDelete: false,
idleTitle: t("Delete current image"),
confirmTitle: t("Click again to confirm deleting this image"),
confirmDiskTitle: t("Click again to confirm deleting this image"),
onStateChange: (pending, disk) => {
if (pending) {
deleteButton.style.setProperty("background-color", disk ? "#7f1d1d" : "#dc3545", "important");
deleteButton.style.setProperty("color", disk ? "#ffc9c9" : "#ffffff", "important");
deleteButton.style.setProperty("box-shadow", disk
? "0 0 10px rgba(220, 38, 38, 0.85)"
: "0 0 8px rgba(220, 53, 69, 0.6)", "important");
deleteButton.style.setProperty("border-color", disk ? "#ef4444" : "#dc3545", "important");
} else {
for (const property of ["background-color", "color", "box-shadow", "border-color"]) {
deleteButton.style.removeProperty(property);
}
}
},
onConfirm: async () => {
const asset = navAssets[navIndex];
if (!asset || typeof previewOptions.onDelete !== "function") return;
const removed = await previewOptions.onDelete(asset);
if (!removed) return;
navItems.splice(navIndex, 1);
navAssets.splice(navIndex, 1);
if (!navItems.length) {
overlay.destroy();
return;
}
navIndex = Math.min(navIndex, navItems.length - 1);
navigate(0);
updateNavigation();
}
});
const updateNavigation = () => {
const visible = navItems.length > 1;
prevButton.style.display = nextButton.style.display = visible ? "flex" : "none";
prevButton.style.alignItems = nextButton.style.alignItems = "center";
prevButton.style.justifyContent = nextButton.style.justifyContent = "center";
deleteButton.style.display = navAssets[navIndex] && typeof previewOptions.onDelete === "function" ? "flex" : "none";
};
navigate = (delta) => {
if (!navItems.length || (navItems.length < 2 && delta !== 0)) return;
navIndex = (navIndex + delta + navItems.length) % navItems.length;
const targetSrc = navItems[navIndex];
if (!targetSrc) return;
if (mediaB) {
cleanupMedia(mediaB);
mediaB.remove();
mediaB = null;
}
slider.style.display = "none";
// Keep the current frame visible while the next image loads to avoid a blank flash.
const preload = new Image();
preload.onload = () => {
mediaA.onload = null;
mediaA.onerror = () => showPlaceholder();
mediaA.src = targetSrc;
hidePlaceholder();
infoText.style.color = "#aaa";
infoText.textContent = t("Click image to zoom (100%/Fit) | Shift+Click another card to compare.");
syncImageScales();
};
preload.onerror = () => {
mediaA.onerror = () => showPlaceholder();
mediaA.src = targetSrc;
};
preload.src = targetSrc;
if (!isZoomed) {
scrollContainer.scrollTop = 0;
scrollContainer.scrollLeft = 0;
}
};
prevButton.onclick = (e) => { e.stopPropagation(); navigate(-1); };
nextButton.onclick = (e) => { e.stopPropagation(); navigate(1); };
overlay.container.append(prevButton, nextButton, deleteButton);
updateNavigation();
return {
is3D: false,
setNavigationItems(items, index = 0, assets = null, options = null) {
navItems = Array.isArray(items) ? items.filter(Boolean) : [];
if (Array.isArray(assets)) navAssets = assets.slice();
if (options) previewOptions = options;
navIndex = Math.max(0, Math.min(index, navItems.length - 1));
updateNavigation();
},
isAudio: false,
isText: false,
loadTarget(targetSrc, isShiftClick) {
@@ -914,10 +1117,14 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
};
}
export function showFullscreenPreview(imgSrcs, isShiftClick = false, pid = null) {
export function showFullscreenPreview(imgSrcs, isShiftClick = false, pid = null, startIndex = 0, previewOptions = {}) {
if (!imgSrcs || imgSrcs.length === 0) return;
const item = imgSrcs[0];
const selectedIndex = Math.max(0, Math.min(Number(startIndex) || 0, imgSrcs.length - 1));
const item = imgSrcs[selectedIndex];
const navigationItems = imgSrcs.map(entry =>
typeof entry === "string" ? entry : (entry?.url || entry?.filename || "")
).filter(Boolean);
const targetPid = pid || (typeof item === "object" && item ? item.pid : null);
const pidStr = targetPid ? String(targetPid) : null;
@@ -1005,14 +1212,18 @@ export function showFullscreenPreview(imgSrcs, isShiftClick = false, pid = null)
activeComparisonViewer = null;
} else {
activeComparisonViewer.targetPid = pidStr;
activeComparisonViewer.setNavigationItems?.(navigationItems, selectedIndex, previewOptions.assets, previewOptions);
activeComparisonViewer.loadTarget(src, isShiftClick);
return;
}
}
activeComparisonViewer = createComparisonViewer(
src,
() => { activeComparisonViewer = null; }
src,
() => { activeComparisonViewer = null; },
navigationItems,
selectedIndex,
previewOptions
);
if (activeComparisonViewer) {
activeComparisonViewer.targetPid = pidStr;
+24 -1
View File
@@ -10,6 +10,25 @@ function isTemporaryWorkflow(wf) {
return wf.isTemporary === true || wf.isPersisted === false;
}
/**
* ComfyUI's workflow store calls `createNewTemporary(path?, workflowData?)` for *every* new unsaved tab:
* the "+" button / New command, but also loading a file (drag & drop, Open, PNG metadata, paste),
* templates, "load default" and "Duplicate". Only the first group should open the quick picker.
*
* What distinguishes them is the action's arguments:
* - a file load / duplicate passes a name (the file name) as `path`;
* - default workflow / templates / pasted graphs pass data that already contains nodes;
* - a blank workflow has no name and an empty graph.
*/
export function isBlankWorkflowCreation(args) {
const [path, workflowData] = Array.isArray(args) ? args : [];
if (typeof path === "string" && path.trim() !== "") return false;
if (!workflowData || typeof workflowData !== "object") return true;
const hasNodes = Array.isArray(workflowData.nodes) && workflowData.nodes.length > 0;
const hasSubgraphs = Array.isArray(workflowData.definitions?.subgraphs) && workflowData.definitions.subgraphs.length > 0;
return !hasNodes && !hasSubgraphs;
}
function findNewWorkflowButton(target) {
if (!target || typeof target.closest !== "function") return null;
@@ -460,7 +479,7 @@ export function setupNewWorkflowQuickPicker() {
let unsubWorkflowAction = null;
const wfMgr = app.extensionManager?.workflow;
if (wfMgr && typeof wfMgr.$onAction === "function") {
unsubWorkflowAction = wfMgr.$onAction(({ name, after, onError }) => {
unsubWorkflowAction = wfMgr.$onAction(({ name, args, after, onError }) => {
if (name === "closeWorkflow") {
activeCloseCount++;
after(() => { activeCloseCount = Math.max(0, activeCloseCount - 1); });
@@ -472,6 +491,10 @@ export function setupNewWorkflowQuickPicker() {
if (!getSetting(SettingIds.QUICK_WORKFLOW_PICKER, true)) return;
if (isReplacing || activeCloseCount > 0 || wfMgr.tabsRestored === false) return;
// Loaded files, templates, the default graph and duplicates also go through
// createNewTemporary: they are not "new blank workflow" and must not open the picker.
if (!isBlankWorkflowCreation(args)) return;
const isExplicitNew = name === "createNewTemporary" || Date.now() <= userInitiatedBlankUntil;
if (!isExplicitNew) return;
+23 -6
View File
@@ -1,5 +1,6 @@
import { store } from "../core/store.js";
import { findActiveSidebars, findPropertiesPanel } from "../comfy/adapter.js";
import { findActiveSidebars } from "../comfy/adapter.js";
const activeOverlays = [];
export class SidebarOverlay {
constructor(options = {}) {
@@ -7,8 +8,9 @@ export class SidebarOverlay {
this.onUserClose = options.onUserClose || (() => {});
this.cleanupFns = [];
this.observedElements = new Set();
activeOverlays.push(this);
// Elevate sidebars above overlay
// Keep sidebars elevated until the final stacked overlay is closed.
document.body.classList.add("comfy-sidebar-overlay-active");
// Root container: visual backdrop (covers 100% flush from sidebar to sidebar, zero gap)
@@ -20,7 +22,7 @@ export class SidebarOverlay {
backdropFilter: "blur(8px)",
color: "var(--fg-color, #eee)",
display: "flex", flexDirection: "column", alignItems: "center",
justifyContent: "center", zIndex: "1000", boxSizing: "border-box",
justifyContent: "center", zIndex: String(options.zIndex ?? 1000), boxSizing: "border-box",
overflow: "hidden", pointerEvents: "none", userSelect: "none"
});
@@ -38,7 +40,7 @@ export class SidebarOverlay {
});
this.container.appendChild(this.backdrop);
// Close button
// Optional built-in close button
this.closeBtn = document.createElement("span");
this.closeBtn.className = "pi pi-times";
this.closeBtn.title = "Close (Esc)";
@@ -64,6 +66,7 @@ export class SidebarOverlay {
this.onUserClose();
this.destroy();
};
if (options.closeButton === false) this.closeBtn.style.display = "none";
this.container.appendChild(this.closeBtn);
// ResizeObserver to track live drag-resizing on all active sidebars
@@ -104,10 +107,22 @@ export class SidebarOverlay {
// Global Key Handler (Esc to close)
const onKeyDown = (e) => {
// Highest z-index wins; ties go to the most recently opened overlay.
// This lets fullscreen previews remain interactive above utility overlays
// even when those overlays are opened afterwards.
const topmostOverlay = activeOverlays.reduce((top, candidate) => {
if (!top) return candidate;
const candidateZ = Number(candidate.container.style.zIndex) || 0;
const topZ = Number(top.container.style.zIndex) || 0;
return candidateZ >= topZ ? candidate : top;
}, null);
if (topmostOverlay !== this) return;
if (e.key === "Escape") {
e.preventDefault();
e.stopImmediatePropagation();
this.onUserClose();
this.destroy();
return;
}
if (options.onKeyDown) options.onKeyDown(e);
};
@@ -190,7 +205,9 @@ export class SidebarOverlay {
destroy() {
if (this.destroyed) return;
this.destroyed = true;
document.body.classList.remove("comfy-sidebar-overlay-active");
const stackIndex = activeOverlays.indexOf(this);
if (stackIndex >= 0) activeOverlays.splice(stackIndex, 1);
if (activeOverlays.length === 0) document.body.classList.remove("comfy-sidebar-overlay-active");
for (const fn of this.cleanupFns.splice(0)) {
try { fn(); } catch (e) {}
+72 -8
View File
@@ -16,7 +16,7 @@ export function injectStyles() {
.comfy-sidebar-card:hover {
border-color: color-mix(in srgb, var(--border, var(--border-color, #555)) 50%, var(--foreground, var(--fg-color, #fff)) 50%) !important;
background: color-mix(in srgb, var(--card, var(--secondary, var(--p-surface-800, var(--comfy-menu-bg, #262626)))) 85%, var(--foreground, var(--fg-color, #fff)) 15%) !important;
transition: border-color 0.2s, background-color 0.2s;
transition: border-color 0.1s ease-out, background-color 0.1s ease-out;
}
/* Border & Frame Spotlight (Uses the theme's main hue) */
@@ -32,7 +32,8 @@ export function injectStyles() {
transparent 70%
);
opacity: 0;
transition: opacity 0.25s ease;
/* Leaving fades out quickly so a fast sweep over many cards doesn't leave a glow trail */
transition: opacity 0.12s ease-out;
pointer-events: none;
z-index: 1;
}
@@ -40,6 +41,8 @@ export function injectStyles() {
.comfy-sidebar-card:hover::before,
.comfy-sidebar-folder-card:hover::before {
opacity: 0.65;
/* Entering is near-instant so the glow keeps up with the cursor */
transition: opacity 0.05s ease-out;
}
/* Active job uses the theme accent (orange); Cancelled & Error remain standout Yellow & Red */
.comfy-sidebar-card.active { border-color: var(--primary, var(--p-primary-color, #ea580c)) !important; --hover-color: var(--primary, var(--p-primary-color, #ea580c)); }
@@ -149,7 +152,12 @@ export function injectStyles() {
font-size: 13px !important;
border-radius: 6px !important;
cursor: pointer !important;
transition: all 0.15s ease !important;
/* Constant box: Ctrl mode only recolors the border, so size and padding
never animate. Only colors transition (no slide/grow effects). */
box-sizing: border-box;
border: 1px solid transparent;
transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease,
box-shadow 0.15s ease, opacity 0.15s ease !important;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
z-index: 20 !important;
transform: translateZ(0);
@@ -160,6 +168,32 @@ export function injectStyles() {
color: #ffffff !important;
}
.comfy-sidebar-move-label {
display: inline;
margin-left: 5px;
font-size: 10px;
font-weight: bold;
white-space: nowrap;
font-family: sans-serif;
letter-spacing: 0.3px;
}
/* Fullscreen preview trash button uses the same confirmation glow as card deletes. */
.comfy-sidebar-preview-delete.confirm-delete,
.comfy-sidebar-preview-delete.confirm-delete:hover {
background-color: #dc3545 !important;
color: #ffffff !important;
box-shadow: 0 0 8px rgba(220, 53, 69, 0.6) !important;
}
.comfy-sidebar-preview-delete.confirm-delete-disk,
.comfy-sidebar-preview-delete.confirm-delete-disk:hover {
background-color: #7f1d1d !important;
color: #ffc9c9 !important;
box-shadow: 0 0 10px rgba(220, 38, 38, 0.85) !important;
border: 1px solid #ef4444 !important;
}
/* Delete Confirmation Active State */
.comfy-sidebar-card-action-btn.confirm-delete,
.comfy-sidebar-card-action-btn.confirm-delete:hover {
@@ -177,6 +211,11 @@ export function injectStyles() {
border: 1px solid #ef4444 !important;
}
/* Move to Outputs is an advanced Queue action: never show it outside Ctrl mode. */
.comfy-sidebar-btn-move {
display: none !important;
}
/* Dynamic Ctrl Key Hover State */
.comfy-sidebar-del-label {
display: none;
@@ -188,7 +227,7 @@ export function injectStyles() {
letter-spacing: 0.3px;
}
body.comfy-sidebar-ctrl-active .comfy-sidebar-card-action-btn:not(.comfy-sidebar-btn-del) {
body.comfy-sidebar-ctrl-active .comfy-sidebar-card-action-btn:not(.comfy-sidebar-btn-del):not(.comfy-sidebar-btn-move) {
display: none !important;
}
@@ -196,20 +235,45 @@ export function injectStyles() {
display: none !important;
}
body.comfy-sidebar-ctrl-active .comfy-sidebar-btn-move {
display: inline-flex !important;
background-color: #166534 !important;
color: #ffffff !important;
border-color: #22c55e !important;
width: auto !important;
padding: 0 8px !important;
}
body.comfy-sidebar-ctrl-active .comfy-sidebar-btn-del {
background-color: #991b1b !important;
color: #ffffff !important;
border: 1px solid #ef4444 !important;
width: auto !important;
padding: 0 8px !important;
border-color: #ef4444 !important;
border-radius: 6px !important;
box-shadow: 0 0 10px rgba(239, 68, 68, 0.6) !important;
}
/* Only buttons that gain a text label (Queue/Gallery) get wider; icon-only
delete buttons (Similar Prompts) keep their size and just glow. */
body.comfy-sidebar-ctrl-active .comfy-sidebar-btn-del:has(.comfy-sidebar-del-label) {
width: auto !important;
padding: 0 8px !important;
}
body.comfy-sidebar-ctrl-active .comfy-sidebar-btn-del .comfy-sidebar-del-label {
display: inline;
}
/* Anything that appears because Ctrl is held fades in instead of sliding/growing. */
@keyframes comfy-sidebar-fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
body.comfy-sidebar-ctrl-active .comfy-sidebar-btn-move,
body.comfy-sidebar-ctrl-active .comfy-sidebar-gallery-btn-del,
body.comfy-sidebar-ctrl-active .comfy-sidebar-btn-del .comfy-sidebar-del-label {
animation: comfy-sidebar-fade-in 0.15s ease both;
}
/* Translucent Folder Indicator on Ctrl Press */
.comfy-sidebar-ctrl-overlay {
position: absolute;
@@ -822,7 +886,7 @@ export function injectStyles() {
display: flex;
align-items: center;
gap: 8px;
transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
transition: border-color 0.1s ease-out, background-color 0.1s ease-out, transform 0.1s ease;
user-select: none;
min-width: 0;
position: relative;
+5 -5
View File
@@ -2,7 +2,7 @@ import { SidebarOverlay } from "./overlay.js";
import { t } from "../core/i18n.js";
// Global helper for code block copying in Markdown view
window.moonCopyCode = function(button) {
window.comfySidebarCopyCode = function(button) {
try {
const container = button.parentElement;
if (!container) return;
@@ -36,11 +36,11 @@ function parseInlineMarkdown(html) {
html = html.replace(/`([^`]+)`/g, '<code style="background:#252525;padding:2px 6px;border-radius:3px;font-family:monospace;color:#e06c75;border:1px solid #333;font-size:12px;">$1</code>');
html = html.replace(/\*\*\*(.*?)\*\*\*/g, '<strong style="color:#ffffff;font-weight:600;"><em>$1</em></strong>');
html = html.replace(/\*\*(.*?)\*\*/g, '<strong style="color:#ffffff;font-weight:600;">$1</strong>');
html = html.replace(/__(.*?)__/g, '<strong style="color:#ffffff;font-weight:600;">$1</strong>');
html = html.replace(/(?<![\w])__(.+?)__(?![\w])/g, '<strong style="color:#ffffff;font-weight:600;">$1</strong>');
html = html.replace(/\*(.*?)\*/g, '<em>$1</em>');
html = html.replace(/_(.*?)_/g, '<em>$1</em>');
html = html.replace(/(?<![\w])_(.+?)_(?![\w])/g, '<em>$1</em>');
html = html.replace(/~~(.*?)~~/g, '<span style="text-decoration:line-through;color:#888;">$1</span>');
html = html.replace(/\[([^\]]+)\]\(((?:https?:\/\/|\/)[^\s)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--primary, #ea580c);text-decoration:none;border-bottom:1px dashed var(--primary, #ea580c);cursor:pointer;">$1</a>');
html = html.replace(/\[([^\]]+)\]\(((?:https?:\/\/|\/(?!\/))[^\s)"'<>`]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--primary, #ea580c);text-decoration:none;border-bottom:1px dashed var(--primary, #ea580c);cursor:pointer;">$1</a>');
html = html.replace(/\$(?!\s)([^\$]+?)(?<!\s)\$/g, '<span style="font-family:\'Times New Roman\',Times,serif;font-size:14px;color:#e5c07b;font-style:italic;padding:0 2px;">$1</span>');
return html;
}
@@ -92,7 +92,7 @@ function parseMarkdown(text) {
const rCode = codeContent.join("\n");
const langBadge = codeLang ? `<div style="position:absolute;top:6px;left:10px;color:#85c5ec;font-size:10px;font-family:sans-serif;font-weight:bold;text-transform:uppercase;opacity:0.8;user-select:none;">${codeLang}</div>` : '';
const btnStyle = "position:absolute;top:6px;right:6px;background:var(--secondary, #333);color:var(--muted-foreground, #aaa);border:1px solid var(--border, #555);border-radius:3px;padding:3px 8px;font-size:10px;cursor:pointer;";
htmlLines.push(`<div class="code-block-container" style="position:relative;margin:8px 0;">${langBadge}<button onclick="window.moonCopyCode(this)" style="${btnStyle}">${t("Copy")}</button><pre style="background:color-mix(in srgb, var(--card, #1e1e1e) 90%, black 10%);padding:10px;padding-top:28px;border-radius:4px;border:1px solid var(--border, #333);font-family:monospace;overflow-x:auto;margin:0;color:#85c5ec;"><code>${rCode}</code></pre></div>`);
htmlLines.push(`<div class="code-block-container" style="position:relative;margin:8px 0;">${langBadge}<button onclick="window.comfySidebarCopyCode(this)" style="${btnStyle}">${t("Copy")}</button><pre style="background:color-mix(in srgb, var(--card, #1e1e1e) 90%, black 10%);padding:10px;padding-top:28px;border-radius:4px;border:1px solid var(--border, #333);font-family:monospace;overflow-x:auto;margin:0;color:#85c5ec;"><code>${rCode}</code></pre></div>`);
codeContent = []; codeLang = ""; inCodeBlock = false;
} else {
inCodeBlock = true; codeLang = trimmed.slice(3).trim();
+22
View File
@@ -406,6 +406,26 @@ export function getRunOutputs(nodeOutputs, rawWorkflow, promptGraph = null) {
return list;
}
/**
* Every file of a card that lives on the server's disk: its own files plus the files of all
* node outputs. Live preview blobs are not on disk and are skipped.
*/
export function collectCardFiles(state) {
const files = [];
const seen = new Set();
const addFile = (item) => {
if (!item || !item.filename) return;
if (item.url && item.url.startsWith("blob:")) return;
const key = `${item.type || "output"}/${item.subfolder || ""}/${item.filename}`;
if (seen.has(key)) return;
seen.add(key);
files.push(item);
};
(state?.images || []).forEach(addFile);
getRunOutputs(state?.nodeOutputs, state?.workflow).forEach((out) => (out.images || []).forEach(addFile));
return files;
}
export function getPrimaryOutputImages(nodeOutputs, rawWorkflow) {
if (!nodeOutputs) return findImagesInOutputs(null, rawWorkflow);
const runOutputs = getRunOutputs(nodeOutputs, rawWorkflow);
@@ -554,6 +574,7 @@ export function attachDeleteConfirmation(btn, options = {}) {
isDisk = false;
btn.classList.remove("confirm-delete", "confirm-delete-disk");
btn.title = typeof idleTitle === "function" ? idleTitle() : idleTitle;
if (typeof options.onStateChange === "function") options.onStateChange(false, false);
if (timer) {
clearTimeout(timer);
timer = null;
@@ -570,6 +591,7 @@ export function attachDeleteConfirmation(btn, options = {}) {
isPending = true;
isDisk = wantsDisk;
btn.classList.add(wantsDisk ? "confirm-delete-disk" : "confirm-delete");
if (typeof options.onStateChange === "function") options.onStateChange(true, wantsDisk);
btn.title = wantsDisk
? (typeof confirmDiskTitle === "function" ? confirmDiskTitle() : confirmDiskTitle)
: (typeof confirmTitle === "function" ? confirmTitle() : confirmTitle);
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "البحث في المعرض (اسم الملف أو الموجه)",
"Search filenames or prompt metadata...": "البحث في أسماء الملفات أو بيانات الموجه...",
"Type to load saved workflow...": "اكتب لتحميل سير عمل محفوظ...",
"No matching workflows": "لا توجد مسارات عمل مطابقة"
}
"No matching workflows": "لا توجد مسارات عمل مطابقة",
"Move to Outputs": "نقل إلى المخرجات",
"Move selected image to Outputs (Ctrl+Click)": "انقل الصورة المحددة إلى المخرجات (Ctrl+نقرة)",
"Moved selected image to Outputs.": "تم نقل الصورة المحددة إلى المخرجات.",
"Failed to move image to Outputs.": "تعذر نقل الصورة إلى المخرجات.",
"Clear All History (also clears TEMP)": "مسح كل السجل (مع مسح TEMP أيضًا)",
"Click again to clear all history and TEMP files": "انقر مرة أخرى لمسح السجل بالكامل وملفات TEMP",
"Could not inspect the TEMP directory.": "تعذّر فحص مجلد TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "أكمل مهام سير العمل في قائمة الانتظار أو ألغِها قبل مسح السجل وTEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "تم نقل {count} من عناصر TEMP إلى سلة المحذوفات.",
"Permanently deleted {count} TEMP item(s).": "تم حذف {count} من عناصر TEMP نهائيًا.",
"Could not delete {count} TEMP item(s).": "تعذّر حذف {count} من عناصر TEMP.",
"TEMP cleanup stopped because a workflow entered the queue.": "توقّف تنظيف TEMP بسبب دخول مهمة سير عمل إلى قائمة الانتظار.",
"Click again to clear all history": "انقر مرة أخرى لمسح السجل بالكامل",
"Card size": "حجم البطاقة",
"Click again to confirm deleting this image": "انقر مرة أخرى لتأكيد حذف هذه الصورة",
"Could not scan prompts": "تعذّر فحص المطالبات",
"Delete current image": "حذف الصورة الحالية",
"Delete file": "حذف الملف",
"Find Similar Prompts": "العثور على مطالبات مشابهة",
"Group": "مجموعة",
"Next image (→)": "الصورة التالية (→)",
"No similar prompt groups found at this threshold.": "لم يتم العثور على مجموعات مطالبات مشابهة عند حدّ التشابه هذا.",
"Previous image (←)": "الصورة السابقة (←)",
"Scanning prompts...": "جارٍ فحص المطالبات...",
"Similar prompt groups": "مجموعات المطالبات المتشابهة",
"Similarity threshold": "حدّ التشابه",
"images": "صور",
"similarity": "التشابه",
"{count} groups · {scanned} PNGs scanned": "{count} مجموعة · تم فحص {scanned} صورة PNG"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "منتقي سير العمل السريع",
"tooltip": "إظهار منتقي سير العمل السريع عند إنشاء سير عمل فارغ جديد"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "إخفاء زر التشغيل على Comfy Cloud"
}
}
}
+48 -2
View File
@@ -18,7 +18,21 @@
"No nodes selected. Click a node on the canvas first to toggle ignore.": "No nodes selected. Click a node on the canvas first to toggle ignore.",
"Renumber All Nodes by Execution Order (Alt+R)": "Renumber All Nodes by Execution Order (Alt+R)",
"Clear Cancelled & Failed": "Clear Cancelled & Failed",
"Clear Temporary": "Clear Temporary",
"Clear Temporary (cards and files not saved to Outputs)": "Clear Temporary (cards and files not saved to Outputs)",
"Click again to clear {count} temporary card(s)": "Click again to clear {count} temporary card(s)",
"Cleared {count} temporary card(s).": "Cleared {count} temporary card(s).",
"Nothing temporary to clear.": "Nothing temporary to clear.",
"Could not delete {count} file(s). Their cards were kept.": "Could not delete {count} file(s). Their cards were kept.",
"Clear All History": "Clear All History",
"Clear All History (also clears TEMP)": "Clear All History (also clears TEMP)",
"Click again to clear all history and TEMP files": "Click again to clear all history and TEMP files",
"Could not inspect the TEMP directory.": "Could not inspect the TEMP directory.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Finish or cancel queued workflows before clearing history and TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "Moved {count} TEMP item(s) to Recycle Bin.",
"Permanently deleted {count} TEMP item(s).": "Permanently deleted {count} TEMP item(s).",
"Could not delete {count} TEMP item(s).": "Could not delete {count} TEMP item(s).",
"TEMP cleanup stopped because a workflow entered the queue.": "TEMP cleanup stopped because a workflow entered the queue.",
"Filter by text, images, nodes...": "Filter by text, images, nodes...",
"Clear & Close Search": "Clear & Close Search",
"Scroll to Top": "Scroll to Top",
@@ -50,6 +64,17 @@
"Click again to confirm removing output": "Click again to confirm removing output",
"Moved file to Recycle Bin.": "Moved file to Recycle Bin.",
"Permanently deleted file.": "Permanently deleted file.",
"Couldn't move the file to the Recycle Bin": "Couldn't move the file to the Recycle Bin",
"Could not move \"{filename}\" to the Recycle Bin / Trash.": "Could not move \"{filename}\" to the Recycle Bin / Trash.",
"The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:": "The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:",
"The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.": "The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.",
"Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings → Comfy Sidebar.": "Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings → Comfy Sidebar.",
"Turn on direct deletion": "Turn on direct deletion",
"Try again": "Try again",
"Cancel": "Cancel",
"Moved {count} file(s) to Recycle Bin.": "Moved {count} file(s) to Recycle Bin.",
"Permanently deleted {count} file(s).": "Permanently deleted {count} file(s).",
"Could not delete {count} file(s). The card was kept.": "Could not delete {count} file(s). The card was kept.",
"Cancelled": "Cancelled",
"Error": "Error",
"Warning": "Warning",
@@ -129,5 +154,26 @@
"Search Gallery (Filename or Prompt)": "Search Gallery (Filename or Prompt)",
"Search filenames or prompt metadata...": "Search filenames or prompt metadata...",
"Type to load saved workflow...": "Type to load saved workflow...",
"No matching workflows": "No matching workflows"
}
"No matching workflows": "No matching workflows",
"Move selected image to Outputs (Ctrl+Click)": "Move selected image to Outputs (Ctrl+Click)",
"Moved selected image to Outputs.": "Moved selected image to Outputs.",
"Failed to move image to Outputs.": "Failed to move image to Outputs.",
"Move to Outputs": "Move to Outputs",
"Click again to clear all history": "Click again to clear all history",
"Card size": "Card size",
"Click again to confirm deleting this image": "Click again to confirm deleting this image",
"Could not scan prompts": "Could not scan prompts",
"Delete current image": "Delete current image",
"Delete file": "Delete file",
"Find Similar Prompts": "Find Similar Prompts",
"Group": "Group",
"Next image (→)": "Next image (→)",
"No similar prompt groups found at this threshold.": "No similar prompt groups found at this threshold.",
"Previous image (←)": "Previous image (←)",
"Scanning prompts...": "Scanning prompts...",
"Similar prompt groups": "Similar prompt groups",
"Similarity threshold": "Similarity threshold",
"images": "images",
"similarity": "similarity",
"{count} groups · {scanned} PNGs scanned": "{count} groups · {scanned} PNGs scanned"
}
+31 -25
View File
@@ -1,66 +1,72 @@
{
"Comfy Sidebar_Grid Columns Threshold": {
"name": "Ширина в пикселях для разделения очереди на несколько колонок"
"name": "Width Threshold for Queue Columns (px)"
},
"Comfy Sidebar_Show Pending Count Only": {
"name": "Если отключено, для каждой задачи в очереди будет отдельная карточка"
"name": "If disabled, each queued job will have a separate individual card"
},
"Comfy Sidebar_Show Working Node Name": {
"name": "Показывать имя узла, который сейчас выполняется"
"name": "Shows the name of the node which is currently in the process"
},
"Comfy Sidebar_Auto Clear Interrupted": {
"name": "Автоматически очищать отменённые и неудачные задачи при новой генерации"
"name": "Auto-clear cancelled & failed jobs on new generation"
},
"Comfy Sidebar_Enable Gallery": {
"name": "Включить боковую панель галереи результатов"
"name": "Enable Output Gallery Sidebar"
},
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
"name": "Удалять файлы с диска безвозвратно (минуя Корзину)"
"name": "Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)"
},
"Comfy Sidebar_Remove Cards With Missing Files": {
"name": "Remove Queue cards whose output files no longer exist (e.g. after the temp folder is cleared)"
},
"Comfy Sidebar_Hide Junk_Assets": {
"name": "Скрыть вкладку: Ассеты"
"name": "Hide Tab: Assets"
},
"Comfy Sidebar_Hide Junk_Nodes": {
"name": "Скрыть вкладку: Узлы"
"name": "Hide Tab: Nodes"
},
"Comfy Sidebar_Hide Junk_Models": {
"name": "Скрыть вкладку: Модели"
"name": "Hide Tab: Models"
},
"Comfy Sidebar_Hide Junk_Workflows": {
"name": "Скрыть вкладку: Рабочие процессы"
"name": "Hide Tab: Workflows"
},
"Comfy Sidebar_Hide Junk_Apps": {
"name": "Скрыть вкладку: Приложения"
"name": "Hide Tab: Apps"
},
"Comfy Sidebar_Hide Junk_Templates": {
"name": "Скрыть вкладку: Шаблоны"
"name": "Hide Tab: Templates"
},
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
"name": "Заменить стандартную историю заданий на Comfy Queue"
"name": "Replace the stock Job History sidebar with Comfy Queue"
},
"Comfy Sidebar_Hide Junk_Graph Button": {
"name": "Скрыть плавающую кнопку 'Graph' (карта рабочего процесса)"
"name": "Hide floating 'Graph' (Workflow/Node Map) button"
},
"Comfy Sidebar_Hide Junk_Avatar": {
"name": "Скрыть аватар"
"name": "Hide Avatar"
},
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
"name": "Плавающие элементы управления холстом",
"name": "Floating Canvas Controls",
"options": {
"Default": "По умолчанию",
"Dock": "Закрепить",
"Hide": "Скрыть"
"Default": "Default",
"Dock": "Dock",
"Hide": "Hide"
}
},
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
"name": "Исправить нелатинские горячие клавиши (работа на любой раскладке)",
"tooltip": "Обрабатывает нелатинские буквы (например, кириллицу) как соответствующие латинские клавиши, чтобы горячие клавиши вроде Q или Ctrl+Z работали на любой раскладке. На ввод текста в полях не влияет."
"name": "Fix non-ASCII keybinds (hotkeys on any keyboard layout)",
"tooltip": "Treats non-Latin letters (e.g. Cyrillic) as the Latin key in the same physical position, so hotkeys like Q or Ctrl+Z work while another layout is active. Typing in text fields is not affected."
},
"Comfy Sidebar_Comfy Layout": {
"name": "Разместить элементы управления и открытые вкладки на единой верхней панели"
"name": "Places the controls and the open workflow tabs on a single unified top bar"
},
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Быстрый выбор рабочего процесса",
"tooltip": "Показывать быстрый выбор при создании нового пустого рабочего процесса"
"name": "Quick Workflow Picker",
"tooltip": "Show quick workflow picker when creating a new blank workflow"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Hide Run on Comfy Cloud button"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "Buscar en galería (nombre de archivo o prompt)",
"Search filenames or prompt metadata...": "Buscar nombres de archivo o metadatos de prompt...",
"Type to load saved workflow...": "Escribe para cargar un flujo guardado...",
"No matching workflows": "No hay flujos coincidentes"
}
"No matching workflows": "No hay flujos coincidentes",
"Move to Outputs": "Mover a resultados",
"Move selected image to Outputs (Ctrl+Click)": "Mover la imagen seleccionada a resultados (Ctrl+clic)",
"Moved selected image to Outputs.": "Imagen seleccionada movida a resultados.",
"Failed to move image to Outputs.": "No se pudo mover la imagen a resultados.",
"Clear All History (also clears TEMP)": "Borrar todo el historial (también TEMP)",
"Click again to clear all history and TEMP files": "Haz clic de nuevo para borrar todo el historial y los archivos TEMP",
"Could not inspect the TEMP directory.": "No se pudo inspeccionar la carpeta TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Finaliza o cancela los flujos de trabajo en cola antes de borrar el historial y TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "Se movieron {count} elementos TEMP a la papelera.",
"Permanently deleted {count} TEMP item(s).": "Se eliminaron permanentemente {count} elementos TEMP.",
"Could not delete {count} TEMP item(s).": "No se pudieron eliminar {count} elementos TEMP.",
"TEMP cleanup stopped because a workflow entered the queue.": "La limpieza de TEMP se detuvo porque se añadió un flujo de trabajo a la cola.",
"Click again to clear all history": "Haz clic de nuevo para borrar todo el historial",
"Card size": "Tamaño de tarjeta",
"Click again to confirm deleting this image": "Haz clic de nuevo para confirmar que quieres eliminar esta imagen",
"Could not scan prompts": "No se pudieron analizar los prompts",
"Delete current image": "Eliminar imagen actual",
"Delete file": "Eliminar archivo",
"Find Similar Prompts": "Buscar prompts similares",
"Group": "Grupo",
"Next image (→)": "Imagen siguiente (→)",
"No similar prompt groups found at this threshold.": "No se encontraron grupos de prompts similares con este umbral.",
"Previous image (←)": "Imagen anterior (←)",
"Scanning prompts...": "Analizando prompts...",
"Similar prompt groups": "Grupos de prompts similares",
"Similarity threshold": "Umbral de similitud",
"images": "imágenes",
"similarity": "similitud",
"{count} groups · {scanned} PNGs scanned": "{count} grupos · {scanned} archivos PNG analizados"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Selector rápido de flujos de trabajo",
"tooltip": "Mostrar el selector rápido de flujos de trabajo al crear un nuevo flujo en blanco"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Ocultar el botón Ejecutar en Comfy Cloud"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "جستجو در گالری (نام فایل یا پرامپت)",
"Search filenames or prompt metadata...": "جستجوی نام فایل‌ها یا متادیتای پرامپت...",
"Type to load saved workflow...": "برای بارگذاری گردش کار ذخیره‌شده تایپ کنید...",
"No matching workflows": "گردش کار مطابقی یافت نشد"
}
"No matching workflows": "گردش کار مطابقی یافت نشد",
"Move to Outputs": "انتقال به خروجی‌ها",
"Move selected image to Outputs (Ctrl+Click)": "انتقال تصویر انتخاب‌شده به خروجی‌ها (Ctrl+کلیک)",
"Moved selected image to Outputs.": "تصویر انتخاب‌شده به خروجی‌ها منتقل شد.",
"Failed to move image to Outputs.": "انتقال تصویر به خروجی‌ها ناموفق بود.",
"Clear All History (also clears TEMP)": "پاک کردن کل تاریخچه (همراه با TEMP)",
"Click again to clear all history and TEMP files": "برای پاک کردن کل تاریخچه و فایل‌های TEMP دوباره کلیک کنید",
"Could not inspect the TEMP directory.": "بررسی پوشه TEMP ممکن نشد.",
"Finish or cancel queued workflows before clearing history and TEMP.": "پیش از پاک کردن تاریخچه و TEMP، کارهای در صف را تمام یا لغو کنید.",
"Moved {count} TEMP item(s) to Recycle Bin.": "{count} مورد TEMP به سطل زباله منتقل شد.",
"Permanently deleted {count} TEMP item(s).": "{count} مورد TEMP برای همیشه حذف شد.",
"Could not delete {count} TEMP item(s).": "حذف {count} مورد TEMP ممکن نشد.",
"TEMP cleanup stopped because a workflow entered the queue.": "پاک‌سازی TEMP متوقف شد، چون یک گردش‌کار وارد صف شد.",
"Click again to clear all history": "برای پاک کردن کل تاریخچه دوباره کلیک کنید",
"Card size": "اندازه کارت",
"Click again to confirm deleting this image": "برای تأیید حذف این تصویر دوباره کلیک کنید",
"Could not scan prompts": "اسکن پرامپت‌ها انجام نشد",
"Delete current image": "حذف تصویر فعلی",
"Delete file": "حذف فایل",
"Find Similar Prompts": "پیدا کردن پرامپت‌های مشابه",
"Group": "گروه",
"Next image (→)": "تصویر بعدی (→)",
"No similar prompt groups found at this threshold.": "در این آستانه، گروهی از پرامپت‌های مشابه پیدا نشد.",
"Previous image (←)": "تصویر قبلی (←)",
"Scanning prompts...": "در حال اسکن پرامپت‌ها...",
"Similar prompt groups": "گروه‌های پرامپت مشابه",
"Similarity threshold": "آستانه شباهت",
"images": "تصاویر",
"similarity": "شباهت",
"{count} groups · {scanned} PNGs scanned": "{count} گروه · {scanned} فایل PNG اسکن شد"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "انتخابگر سریع گردش کار",
"tooltip": "نمایش انتخابگر سریع گردش کار هنگام ایجاد یک گردش کار خالی جدید"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "پنهان کردن دکمه اجرا در Comfy Cloud"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "Rechercher dans la galerie (nom de fichier ou prompt)",
"Search filenames or prompt metadata...": "Rechercher des noms de fichiers ou métadonnées de prompt...",
"Type to load saved workflow...": "Tapez pour charger un workflow enregistré...",
"No matching workflows": "Aucun workflow correspondant"
}
"No matching workflows": "Aucun workflow correspondant",
"Move to Outputs": "Déplacer vers les sorties",
"Move selected image to Outputs (Ctrl+Click)": "Déplacer l’image sélectionnée vers les sorties (Ctrl+clic)",
"Moved selected image to Outputs.": "Image sélectionnée déplacée vers les sorties.",
"Failed to move image to Outputs.": "Impossible de déplacer l’image vers les sorties.",
"Clear All History (also clears TEMP)": "Effacer tout l’historique (y compris TEMP)",
"Click again to clear all history and TEMP files": "Cliquez à nouveau pour effacer tout l’historique et les fichiers TEMP",
"Could not inspect the TEMP directory.": "Impossible d’inspecter le dossier TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Terminez ou annulez les workflows en attente avant d’effacer l’historique et TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "{count} élément(s) TEMP déplacé(s) dans la corbeille.",
"Permanently deleted {count} TEMP item(s).": "{count} élément(s) TEMP supprimé(s) définitivement.",
"Could not delete {count} TEMP item(s).": "Impossible de supprimer {count} élément(s) TEMP.",
"TEMP cleanup stopped because a workflow entered the queue.": "Le nettoyage de TEMP a été interrompu car un workflow a été ajouté à la file.",
"Click again to clear all history": "Cliquez à nouveau pour effacer tout l’historique",
"Card size": "Taille des cartes",
"Click again to confirm deleting this image": "Cliquez à nouveau pour confirmer la suppression de cette image",
"Could not scan prompts": "Impossible d’analyser les prompts",
"Delete current image": "Supprimer l’image actuelle",
"Delete file": "Supprimer le fichier",
"Find Similar Prompts": "Trouver des prompts similaires",
"Group": "Groupe",
"Next image (→)": "Image suivante (→)",
"No similar prompt groups found at this threshold.": "Aucun groupe de prompts similaires trouvé avec ce seuil.",
"Previous image (←)": "Image précédente (←)",
"Scanning prompts...": "Analyse des prompts...",
"Similar prompt groups": "Groupes de prompts similaires",
"Similarity threshold": "Seuil de similarité",
"images": "images",
"similarity": "similarité",
"{count} groups · {scanned} PNGs scanned": "{count} groupes · {scanned} fichiers PNG analysés"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Sélecteur rapide de workflow",
"tooltip": "Afficher le sélecteur rapide de workflow lors de la création d'un nouveau workflow vide"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Masquer le bouton Exécuter sur Comfy Cloud"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "חיפוש בגלריה (שם קובץ או פרומפט)",
"Search filenames or prompt metadata...": "חיפוש שמות קבצים או מטא-דאטה של פרומפט...",
"Type to load saved workflow...": "הקלד כדי לטעון תהליך עבודה שמור...",
"No matching workflows": "לא נמצאו תהליכי עבודה תואמים"
}
"No matching workflows": "לא נמצאו תהליכי עבודה תואמים",
"Move to Outputs": "העבר לפלט",
"Move selected image to Outputs (Ctrl+Click)": "העבר את התמונה שנבחרה לפלט (Ctrl+לחיצה)",
"Moved selected image to Outputs.": "התמונה שנבחרה הועברה לפלט.",
"Failed to move image to Outputs.": "העברת התמונה לפלט נכשלה.",
"Clear All History (also clears TEMP)": "ניקוי כל ההיסטוריה (כולל TEMP)",
"Click again to clear all history and TEMP files": "לחצו שוב כדי לנקות את כל ההיסטוריה ואת קובצי TEMP",
"Could not inspect the TEMP directory.": "לא ניתן לבדוק את תיקיית TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "יש לסיים או לבטל תהליכי עבודה שבתור לפני ניקוי ההיסטוריה ו-TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "{count} פריטי TEMP הועברו לסל המיחזור.",
"Permanently deleted {count} TEMP item(s).": "{count} פריטי TEMP נמחקו לצמיתות.",
"Could not delete {count} TEMP item(s).": "לא ניתן למחוק {count} פריטי TEMP.",
"TEMP cleanup stopped because a workflow entered the queue.": "ניקוי TEMP נעצר כי תהליך עבודה נוסף לתור.",
"Click again to clear all history": "לחצו שוב כדי לנקות את כל ההיסטוריה",
"Card size": "גודל הכרטיס",
"Click again to confirm deleting this image": "לחצו שוב כדי לאשר את מחיקת התמונה הזו",
"Could not scan prompts": "לא ניתן לסרוק את הפרומפטים",
"Delete current image": "מחיקת התמונה הנוכחית",
"Delete file": "מחיקת הקובץ",
"Find Similar Prompts": "מציאת פרומפטים דומים",
"Group": "קבוצה",
"Next image (→)": "התמונה הבאה (→)",
"No similar prompt groups found at this threshold.": "לא נמצאו קבוצות של פרומפטים דומים בסף הזה.",
"Previous image (←)": "התמונה הקודמת (←)",
"Scanning prompts...": "סורק פרומפטים...",
"Similar prompt groups": "קבוצות פרומפטים דומים",
"Similarity threshold": "סף הדמיון",
"images": "תמונות",
"similarity": "דמיון",
"{count} groups · {scanned} PNGs scanned": "{count} קבוצות · נסרקו {scanned} קובצי PNG"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "בוחר תהליכי עבודה מהיר",
"tooltip": "הצג בוחר תהליכי עבודה מהיר בעת יצירת תהליך עבודה ריק חדש"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "הסתרת כפתור ההפעלה ב-Comfy Cloud"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "Cerca nella galleria (nome file o prompt)",
"Search filenames or prompt metadata...": "Cerca nomi di file o metadati del prompt...",
"Type to load saved workflow...": "Digita per caricare un workflow salvato...",
"No matching workflows": "Nessun workflow corrispondente"
}
"No matching workflows": "Nessun workflow corrispondente",
"Move to Outputs": "Sposta negli output",
"Move selected image to Outputs (Ctrl+Click)": "Sposta l’immagine selezionata negli output (Ctrl+clic)",
"Moved selected image to Outputs.": "Immagine selezionata spostata negli output.",
"Failed to move image to Outputs.": "Impossibile spostare l’immagine negli output.",
"Clear All History (also clears TEMP)": "Cancella tutta la cronologia (anche TEMP)",
"Click again to clear all history and TEMP files": "Fai di nuovo clic per cancellare tutta la cronologia e i file TEMP",
"Could not inspect the TEMP directory.": "Impossibile esaminare la cartella TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Completa o annulla i flussi di lavoro in coda prima di cancellare la cronologia e TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "{count} elementi TEMP spostati nel Cestino.",
"Permanently deleted {count} TEMP item(s).": "{count} elementi TEMP eliminati definitivamente.",
"Could not delete {count} TEMP item(s).": "Impossibile eliminare {count} elementi TEMP.",
"TEMP cleanup stopped because a workflow entered the queue.": "Pulizia di TEMP interrotta perché è stato aggiunto un flusso di lavoro alla coda.",
"Click again to clear all history": "Fai di nuovo clic per cancellare tutta la cronologia",
"Card size": "Dimensione scheda",
"Click again to confirm deleting this image": "Fai di nuovo clic per confermare l’eliminazione di questa immagine",
"Could not scan prompts": "Impossibile analizzare i prompt",
"Delete current image": "Elimina immagine corrente",
"Delete file": "Elimina file",
"Find Similar Prompts": "Trova prompt simili",
"Group": "Gruppo",
"Next image (→)": "Immagine successiva (→)",
"No similar prompt groups found at this threshold.": "Nessun gruppo di prompt simili trovato con questa soglia.",
"Previous image (←)": "Immagine precedente (←)",
"Scanning prompts...": "Analisi dei prompt...",
"Similar prompt groups": "Gruppi di prompt simili",
"Similarity threshold": "Soglia di somiglianza",
"images": "immagini",
"similarity": "somiglianza",
"{count} groups · {scanned} PNGs scanned": "{count} gruppi · {scanned} file PNG analizzati"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Selettore rapido dei workflow",
"tooltip": "Mostra il selettore rapido dei workflow quando crei un nuovo workflow vuoto"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Nascondi il pulsante Esegui su Comfy Cloud"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "ギャラリーを検索 (ファイル名またはプロンプト)",
"Search filenames or prompt metadata...": "ファイル名またはプロンプトを検索...",
"Type to load saved workflow...": "保存済みワークフローを読み込むには入力...",
"No matching workflows": "一致するワークフローがありません"
}
"No matching workflows": "一致するワークフローがありません",
"Move to Outputs": "出力フォルダーへ移動",
"Move selected image to Outputs (Ctrl+Click)": "選択した画像を出力フォルダーへ移動 (Ctrl+クリック)",
"Moved selected image to Outputs.": "選択した画像を出力フォルダーへ移動しました。",
"Failed to move image to Outputs.": "画像を出力フォルダーへ移動できませんでした。",
"Clear All History (also clears TEMP)": "すべての履歴を消去(TEMPも消去)",
"Click again to clear all history and TEMP files": "もう一度クリックすると、すべての履歴とTEMPファイルを消去します",
"Could not inspect the TEMP directory.": "TEMPフォルダーを確認できませんでした。",
"Finish or cancel queued workflows before clearing history and TEMP.": "履歴とTEMPを消去する前に、キュー内のワークフローを完了またはキャンセルしてください。",
"Moved {count} TEMP item(s) to Recycle Bin.": "TEMP項目を{count}件ゴミ箱に移動しました。",
"Permanently deleted {count} TEMP item(s).": "TEMP項目を{count}件完全に削除しました。",
"Could not delete {count} TEMP item(s).": "TEMP項目を{count}件削除できませんでした。",
"TEMP cleanup stopped because a workflow entered the queue.": "ワークフローがキューに追加されたため、TEMPのクリーンアップを中止しました。",
"Click again to clear all history": "もう一度クリックすると、すべての履歴を消去します",
"Card size": "カードサイズ",
"Click again to confirm deleting this image": "この画像の削除を確定するには、もう一度クリックしてください",
"Could not scan prompts": "プロンプトをスキャンできませんでした",
"Delete current image": "現在の画像を削除",
"Delete file": "ファイルを削除",
"Find Similar Prompts": "類似プロンプトを検索",
"Group": "グループ",
"Next image (→)": "次の画像 (→)",
"No similar prompt groups found at this threshold.": "このしきい値では類似プロンプトのグループは見つかりませんでした。",
"Previous image (←)": "前の画像 (←)",
"Scanning prompts...": "プロンプトをスキャン中...",
"Similar prompt groups": "類似プロンプトのグループ",
"Similarity threshold": "類似度のしきい値",
"images": "枚の画像",
"similarity": "類似度",
"{count} groups · {scanned} PNGs scanned": "{count} グループ · {scanned} 件の PNG をスキャン"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "クイックワークフローピッカー",
"tooltip": "新しい空のワークフローを作成するときにクイックワークフローピッカーを表示する"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Comfy Cloudで実行ボタンを非表示"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "갤러리 검색 (파일명 또는 프롬프트)",
"Search filenames or prompt metadata...": "파일명 또는 프롬프트 메타데이터 검색...",
"Type to load saved workflow...": "저장된 워크플로우를 불러오려면 입력하세요...",
"No matching workflows": "일치하는 워크플로우가 없습니다"
}
"No matching workflows": "일치하는 워크플로우가 없습니다",
"Move to Outputs": "출력 폴더로 이동",
"Move selected image to Outputs (Ctrl+Click)": "선택한 이미지를 출력 폴더로 이동 (Ctrl+클릭)",
"Moved selected image to Outputs.": "선택한 이미지를 출력 폴더로 이동했습니다.",
"Failed to move image to Outputs.": "이미지를 출력 폴더로 이동하지 못했습니다.",
"Clear All History (also clears TEMP)": "모든 기록 지우기 (TEMP도 지움)",
"Click again to clear all history and TEMP files": "한 번 더 클릭하면 모든 기록과 TEMP 파일을 지웁니다",
"Could not inspect the TEMP directory.": "TEMP 폴더를 확인할 수 없습니다.",
"Finish or cancel queued workflows before clearing history and TEMP.": "기록과 TEMP를 지우기 전에 대기 중인 워크플로를 완료하거나 취소하세요.",
"Moved {count} TEMP item(s) to Recycle Bin.": "TEMP 항목 {count}개를 휴지통으로 이동했습니다.",
"Permanently deleted {count} TEMP item(s).": "TEMP 항목 {count}개를 영구 삭제했습니다.",
"Could not delete {count} TEMP item(s).": "TEMP 항목 {count}개를 삭제할 수 없습니다.",
"TEMP cleanup stopped because a workflow entered the queue.": "워크플로가 대기열에 추가되어 TEMP 정리를 중단했습니다.",
"Click again to clear all history": "모든 기록을 지우려면 한 번 더 클릭하세요",
"Card size": "카드 크기",
"Click again to confirm deleting this image": "이 이미지를 삭제하려면 다시 클릭하세요",
"Could not scan prompts": "프롬프트를 스캔할 수 없습니다",
"Delete current image": "현재 이미지 삭제",
"Delete file": "파일 삭제",
"Find Similar Prompts": "유사한 프롬프트 찾기",
"Group": "그룹",
"Next image (→)": "다음 이미지 (→)",
"No similar prompt groups found at this threshold.": "이 임계값에서는 유사한 프롬프트 그룹을 찾지 못했습니다.",
"Previous image (←)": "이전 이미지 (←)",
"Scanning prompts...": "프롬프트 스캔 중...",
"Similar prompt groups": "유사한 프롬프트 그룹",
"Similarity threshold": "유사도 임계값",
"images": "개 이미지",
"similarity": "유사도",
"{count} groups · {scanned} PNGs scanned": "그룹 {count}개 · PNG {scanned}개 스캔 완료"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "빠른 워크플로우 선택기",
"tooltip": "새 빈 워크플로우를 만들 때 빠른 워크플로우 선택기 표시"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Comfy Cloud에서 실행 버튼 숨기기"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "Pesquisar na galeria (nome do arquivo ou prompt)",
"Search filenames or prompt metadata...": "Pesquisar nomes de arquivos ou metadados de prompt...",
"Type to load saved workflow...": "Digite para carregar um fluxo salvo...",
"No matching workflows": "Nenhum fluxo correspondente"
}
"No matching workflows": "Nenhum fluxo correspondente",
"Move to Outputs": "Mover para Outputs",
"Move selected image to Outputs (Ctrl+Click)": "Mover a imagem selecionada para Outputs (Ctrl+clique)",
"Moved selected image to Outputs.": "Imagem selecionada movida para Outputs.",
"Failed to move image to Outputs.": "Não foi possível mover a imagem para Outputs.",
"Clear All History (also clears TEMP)": "Limpar todo o histórico (também limpa TEMP)",
"Click again to clear all history and TEMP files": "Clique novamente para limpar todo o histórico e os arquivos TEMP",
"Could not inspect the TEMP directory.": "Não foi possível verificar a pasta TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Conclua ou cancele os fluxos de trabalho na fila antes de limpar o histórico e TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "{count} item(ns) TEMP movido(s) para a Lixeira.",
"Permanently deleted {count} TEMP item(s).": "{count} item(ns) TEMP excluído(s) permanentemente.",
"Could not delete {count} TEMP item(s).": "Não foi possível excluir {count} item(ns) TEMP.",
"TEMP cleanup stopped because a workflow entered the queue.": "A limpeza de TEMP foi interrompida porque um fluxo de trabalho entrou na fila.",
"Click again to clear all history": "Clique novamente para limpar todo o histórico",
"Card size": "Tamanho do cartão",
"Click again to confirm deleting this image": "Clique novamente para confirmar a exclusão desta imagem",
"Could not scan prompts": "Não foi possível analisar os prompts",
"Delete current image": "Excluir imagem atual",
"Delete file": "Excluir arquivo",
"Find Similar Prompts": "Encontrar prompts semelhantes",
"Group": "Grupo",
"Next image (→)": "Próxima imagem (→)",
"No similar prompt groups found at this threshold.": "Nenhum grupo de prompts semelhantes encontrado neste limite.",
"Previous image (←)": "Imagem anterior (←)",
"Scanning prompts...": "Analisando prompts...",
"Similar prompt groups": "Grupos de prompts semelhantes",
"Similarity threshold": "Limite de similaridade",
"images": "imagens",
"similarity": "similaridade",
"{count} groups · {scanned} PNGs scanned": "{count} grupos · {scanned} arquivos PNG analisados"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Seletor Rápido de Fluxos",
"tooltip": "Mostrar seletor rápido de fluxos ao criar um novo fluxo em branco"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Ocultar o botão Executar no Comfy Cloud"
}
}
}
+41 -2
View File
@@ -19,6 +19,14 @@
"Renumber All Nodes by Execution Order (Alt+R)": "Перенумеровать ноды по порядку выполнения (Alt+R)",
"Clear Cancelled & Failed": "Очистить отменённые и с ошибкой",
"Clear All History": "Очистить всю историю",
"Clear All History (also clears TEMP)": "Очистить всю историю и папку TEMP",
"Click again to clear all history and TEMP files": "Нажмите ещё раз, чтобы очистить историю и файлы TEMP",
"Could not inspect the TEMP directory.": "Не удалось проверить папку TEMP.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Завершите или отмените задания в очереди перед очисткой истории и TEMP.",
"Moved {count} TEMP item(s) to Recycle Bin.": "Элементов TEMP перемещено в корзину: {count}.",
"Permanently deleted {count} TEMP item(s).": "Элементов TEMP удалено безвозвратно: {count}.",
"Could not delete {count} TEMP item(s).": "Не удалось удалить элементов TEMP: {count}.",
"TEMP cleanup stopped because a workflow entered the queue.": "Очистка TEMP остановлена: в очереди появилось задание.",
"Filter by text, images, nodes...": "Поиск по тексту, файлам, нодам...",
"Clear & Close Search": "Очистить и закрыть поиск",
"Scroll to Top": "Наверх",
@@ -50,6 +58,17 @@
"Click again to confirm removing output": "Нажмите еще раз для подтверждения удаления",
"Moved file to Recycle Bin.": "Файл перемещен в корзину.",
"Permanently deleted file.": "Файл удален навсегда.",
"Couldn't move the file to the Recycle Bin": "Не удалось переместить файл в корзину",
"Could not move \"{filename}\" to the Recycle Bin / Trash.": "Не удалось переместить «{filename}» в корзину.",
"The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:": "Пакет send2trash не установлен в окружении Python, в котором работает ComfyUI. Чтобы исправить, выполните эту команду и перезапустите ComfyUI:",
"The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.": "Системная корзина недоступна для этого файла (например, диск или сетевая папка без корзины либо сессия Linux без корзины рабочего стола). Устраните проблему и повторите попытку.",
"Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings → Comfy Sidebar.": "Прямое удаление безвозвратно удаляет файлы, минуя корзину. Позже это можно изменить в Настройки → Comfy Sidebar.",
"Turn on direct deletion": "Включить прямое удаление",
"Try again": "Повторить",
"Cancel": "Отмена",
"Moved {count} file(s) to Recycle Bin.": "Перемещено файлов в корзину: {count}.",
"Permanently deleted {count} file(s).": "Файлов удалено безвозвратно: {count}.",
"Could not delete {count} file(s). The card was kept.": "Не удалось удалить файлов: {count}. Карточка сохранена.",
"Cancelled": "Отменено",
"Error": "Ошибка",
"Warning": "Предупреждение",
@@ -129,6 +148,26 @@
"Search Gallery (Filename or Prompt)": "Поиск по галерее (имя файла или промпт)",
"Search filenames or prompt metadata...": "Поиск по именам файлов или промптам...",
"Type to load saved workflow...": "Найти сохранённый рабочий процесс...",
"No matching workflows": "Подходящие рабочие процессы не найдены"
"No matching workflows": "Подходящие рабочие процессы не найдены",
"Move to Outputs": "Переместить в Outputs",
"Move selected image to Outputs (Ctrl+Click)": "Переместить выбранное изображение в Outputs (Ctrl+щелчок)",
"Moved selected image to Outputs.": "Выбранное изображение перемещено в Outputs.",
"Failed to move image to Outputs.": "Не удалось переместить изображение в Outputs.",
"Click again to clear all history": "Нажмите ещё раз, чтобы очистить всю историю",
"Card size": "Размер карточки",
"Click again to confirm deleting this image": "Нажмите ещё раз, чтобы подтвердить удаление этого изображения",
"Could not scan prompts": "Не удалось просканировать промпты",
"Delete current image": "Удалить текущее изображение",
"Delete file": "Удалить файл",
"Find Similar Prompts": "Найти похожие промпты",
"Group": "Группа",
"Next image (→)": "Следующее изображение (→)",
"No similar prompt groups found at this threshold.": "При этом пороге похожих групп промптов не найдено.",
"Previous image (←)": "Предыдущее изображение (←)",
"Scanning prompts...": "Сканирование промптов...",
"Similar prompt groups": "Группы похожих промптов",
"Similarity threshold": "Порог сходства",
"images": "изображений",
"similarity": "сходство",
"{count} groups · {scanned} PNGs scanned": "Групп: {count} · Просканировано PNG: {scanned}"
}
+7 -1
View File
@@ -17,6 +17,9 @@
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
"name": "Удалять файлы с диска безвозвратно (минуя Корзину)"
},
"Comfy Sidebar_Remove Cards With Missing Files": {
"name": "Удалять карточки очереди, если их файлов больше нет (например, после очистки папки temp)"
},
"Comfy Sidebar_Hide Junk_Assets": {
"name": "Скрыть вкладку: Ассеты"
},
@@ -62,5 +65,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Быстрый выбор рабочего процесса",
"tooltip": "Показывать быстрый выбор при создании нового пустого рабочего процесса"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Скрыть кнопку «Запустить в Comfy Cloud»"
}
}
}
+31 -15
View File
@@ -1,17 +1,4 @@
{
"settingsCategories": {
"Comfy Sidebar": "Comfy Sidebar",
"Auto Clear Interrupted": "Kesilenleri Otomatik Temizle",
"Comfy Layout": "Klasik Düzen",
"Enable Gallery": "Galeriyi Etkinleştir",
"Grid Columns Threshold": "Izgara Sütun Eşiği",
"Hide Junk": "Gereksiz Öğeleri Gizle",
"Latin Hotkeys On Any Layout": "Her Düzende Latin Kısayol Tuşları",
"Permanent Delete on Disk Deletion": "Diskten Kalıcı Olarak Sil",
"Quick Workflow Picker": "Hızlı İş Akışı Seçici",
"Show Pending Count Only": "Yalnızca Bekleyen Sayısını Göster",
"Show Working Node Name": "Çalışan Düğüm Adını Göster"
},
"settingsCategories": {
"Comfy Sidebar": "Comfy Sidebar",
"Auto Clear Interrupted": "Kesilenleri Otomatik Temizle",
@@ -142,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "Galeride Ara (Dosya Adı veya Prompt)",
"Search filenames or prompt metadata...": "Dosya adlarını veya prompt meta verilerini ara...",
"Type to load saved workflow...": "Kayıtlı iş akışını yüklemek için yazın...",
"No matching workflows": "Eşleşen iş akışı yok"
}
"No matching workflows": "Eşleşen iş akışı yok",
"Move to Outputs": "Çıktılara taşı",
"Move selected image to Outputs (Ctrl+Click)": "Seçili görseli çıktılara taşı (Ctrl+tık)",
"Moved selected image to Outputs.": "Seçili görsel çıktılara taşındı.",
"Failed to move image to Outputs.": "Görsel çıktılara taşınamadı.",
"Clear All History (also clears TEMP)": "Tüm Geçmişi Temizle (TEMP de temizlenir)",
"Click again to clear all history and TEMP files": "Tüm geçmişi ve TEMP dosyalarını temizlemek için tekrar tıklayın",
"Could not inspect the TEMP directory.": "TEMP klasörü incelenemedi.",
"Finish or cancel queued workflows before clearing history and TEMP.": "Geçmişi ve TEMP'i temizlemeden önce sıradaki iş akışlarını tamamlayın veya iptal edin.",
"Moved {count} TEMP item(s) to Recycle Bin.": "{count} TEMP öğesi Geri Dönüşüm Kutusu'na taşındı.",
"Permanently deleted {count} TEMP item(s).": "{count} TEMP öğesi kalıcı olarak silindi.",
"Could not delete {count} TEMP item(s).": "{count} TEMP öğesi silinemedi.",
"TEMP cleanup stopped because a workflow entered the queue.": "Kuyruğa bir iş akışı eklendiği için TEMP temizliği durduruldu.",
"Click again to clear all history": "Tüm geçmişi temizlemek için tekrar tıklayın",
"Card size": "Kart boyutu",
"Click again to confirm deleting this image": "Bu görseli silmeyi onaylamak için tekrar tıklayın",
"Could not scan prompts": "İstemler taranamadı",
"Delete current image": "Geçerli görseli sil",
"Delete file": "Dosyayı sil",
"Find Similar Prompts": "Benzer istemleri bul",
"Group": "Grup",
"Next image (→)": "Sonraki görsel (→)",
"No similar prompt groups found at this threshold.": "Bu eşikte benzer istem grubu bulunamadı.",
"Previous image (←)": "Önceki görsel (←)",
"Scanning prompts...": "İstemler taranıyor...",
"Similar prompt groups": "Benzer istem grupları",
"Similarity threshold": "Benzerlik eşiği",
"images": "görsel",
"similarity": "benzerlik",
"{count} groups · {scanned} PNGs scanned": "{count} grup · {scanned} PNG tarandı"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "Hızlı İş Akışı Seçici",
"tooltip": "Yeni bir boş iş akışı oluştururken hızlı iş akışı seçiciyi göster"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "Comfy Cloud'da Çalıştır düğmesini gizle"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "搜尋圖庫 (檔案名稱或提示詞)",
"Search filenames or prompt metadata...": "搜尋檔案名稱或提示詞元資料...",
"Type to load saved workflow...": "輸入以載入已儲存的工作流程...",
"No matching workflows": "沒有符合的工作流程"
}
"No matching workflows": "沒有符合的工作流程",
"Move to Outputs": "移至輸出資料夾",
"Move selected image to Outputs (Ctrl+Click)": "將選取的圖片移至輸出資料夾 (Ctrl+點擊)",
"Moved selected image to Outputs.": "已將選取的圖片移至輸出資料夾。",
"Failed to move image to Outputs.": "無法將圖片移至輸出資料夾。",
"Clear All History (also clears TEMP)": "清除所有歷史記錄(同時清除 TEMP)",
"Click again to clear all history and TEMP files": "再次點擊以清除所有歷史記錄和 TEMP 檔案",
"Could not inspect the TEMP directory.": "無法檢查 TEMP 資料夾。",
"Finish or cancel queued workflows before clearing history and TEMP.": "清除歷史記錄和 TEMP 前,請先完成或取消佇列中的工作流程。",
"Moved {count} TEMP item(s) to Recycle Bin.": "已將 {count} 個 TEMP 項目移至資源回收筒。",
"Permanently deleted {count} TEMP item(s).": "已永久刪除 {count} 個 TEMP 項目。",
"Could not delete {count} TEMP item(s).": "無法刪除 {count} 個 TEMP 項目。",
"TEMP cleanup stopped because a workflow entered the queue.": "工作流程進入佇列,因此已停止 TEMP 清理。",
"Click again to clear all history": "再次點擊以清除所有歷史記錄",
"Card size": "卡片大小",
"Click again to confirm deleting this image": "再次點擊以確認刪除此圖片",
"Could not scan prompts": "無法掃描提示詞",
"Delete current image": "刪除目前圖片",
"Delete file": "刪除檔案",
"Find Similar Prompts": "尋找相似提示詞",
"Group": "群組",
"Next image (→)": "下一張圖片 (→)",
"No similar prompt groups found at this threshold.": "在此相似度門檻下找不到相似提示詞群組。",
"Previous image (←)": "上一張圖片 (←)",
"Scanning prompts...": "正在掃描提示詞...",
"Similar prompt groups": "相似提示詞群組",
"Similarity threshold": "相似度門檻",
"images": "張圖片",
"similarity": "相似度",
"{count} groups · {scanned} PNGs scanned": "{count} 個群組 · 已掃描 {scanned} 張 PNG"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "快速工作流程選擇器",
"tooltip": "建立新的空白工作流程時顯示快速工作流程選擇器"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "隱藏「在 Comfy Cloud 上執行」按鈕"
}
}
}
+31 -2
View File
@@ -129,5 +129,34 @@
"Search Gallery (Filename or Prompt)": "搜索图库 (文件名或提示词)",
"Search filenames or prompt metadata...": "搜索文件名或提示词元数据...",
"Type to load saved workflow...": "输入以加载已保存的工作流...",
"No matching workflows": "没有匹配的工作流"
}
"No matching workflows": "没有匹配的工作流",
"Move to Outputs": "移动到输出目录",
"Move selected image to Outputs (Ctrl+Click)": "将选中的图像移动到输出目录 (Ctrl+单击)",
"Moved selected image to Outputs.": "已将选中的图像移动到输出目录。",
"Failed to move image to Outputs.": "无法将图像移动到输出目录。",
"Clear All History (also clears TEMP)": "清除所有历史记录(同时清除 TEMP)",
"Click again to clear all history and TEMP files": "再次点击以清除所有历史记录和 TEMP 文件",
"Could not inspect the TEMP directory.": "无法检查 TEMP 文件夹。",
"Finish or cancel queued workflows before clearing history and TEMP.": "清除历史记录和 TEMP 前,请先完成或取消队列中的工作流。",
"Moved {count} TEMP item(s) to Recycle Bin.": "已将 {count} 个 TEMP 项目移至回收站。",
"Permanently deleted {count} TEMP item(s).": "已永久删除 {count} 个 TEMP 项目。",
"Could not delete {count} TEMP item(s).": "无法删除 {count} 个 TEMP 项目。",
"TEMP cleanup stopped because a workflow entered the queue.": "工作流进入队列,因此已停止 TEMP 清理。",
"Click again to clear all history": "再次点击以清除所有历史记录",
"Card size": "卡片大小",
"Click again to confirm deleting this image": "再次点击以确认删除此图像",
"Could not scan prompts": "无法扫描提示词",
"Delete current image": "删除当前图像",
"Delete file": "删除文件",
"Find Similar Prompts": "查找相似提示词",
"Group": "分组",
"Next image (→)": "下一张图片 (→)",
"No similar prompt groups found at this threshold.": "在此相似度阈值下未找到相似提示词组。",
"Previous image (←)": "上一张图片 (←)",
"Scanning prompts...": "正在扫描提示词...",
"Similar prompt groups": "相似提示词组",
"Similarity threshold": "相似度阈值",
"images": "张图片",
"similarity": "相似度",
"{count} groups · {scanned} PNGs scanned": "{count} 个分组 · 已扫描 {scanned} 张 PNG"
}
+4 -1
View File
@@ -62,5 +62,8 @@
"Comfy Sidebar_Quick Workflow Picker": {
"name": "快速工作流选择器",
"tooltip": "创建新的空白工作流时显示快速工作流选择器"
},
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
"name": "隐藏“在 Comfy Cloud 上运行”按钮"
}
}
}
+230 -9
View File
@@ -17,6 +17,9 @@ How it works
import json
import os
import re
import struct
import sys
import threading
import zlib
from collections import OrderedDict
@@ -34,7 +37,7 @@ _MAX_PROMPT_CHUNK_BYTES = 16 * 1024 * 1024
_MAX_TEXT_CHARS_PER_FILE = 50_000
_CACHE_MAX_ENTRIES = 20_000
_cache = OrderedDict() # path -> ((mtime_ns, size), lowercased prompt text)
_cache = OrderedDict() # path -> ((mtime_ns, size), lowercased prompt text, segments, (width, height))
_cache_lock = threading.Lock()
@@ -96,6 +99,25 @@ def extract_prompt_texts(prompt):
return texts
def get_prompt_segments_from_graph(prompt):
"""Return the individual lower-cased prompt strings (one per text input).
Kept separate (not joined) so callers can tell apart text that is shared
verbatim by many images, such as an LLM enhancer's meta-prompt, from the
text that is unique to one image. Strings are interned so identical
boilerplate is stored once across the whole cache.
"""
segments = []
budget = _MAX_TEXT_CHARS_PER_FILE
for text in extract_prompt_texts(prompt):
if budget <= 0:
break
text = text.lower()[:budget]
budget -= len(text)
segments.append(sys.intern(text))
return tuple(segments)
def get_prompt_search_text_from_graph(prompt):
"""Return lower-cased text-encoder prompt text from an API-format graph."""
return "\n".join(extract_prompt_texts(prompt)).lower()[:_MAX_TEXT_CHARS_PER_FILE]
@@ -131,6 +153,18 @@ def _decode_text_chunk(chunk_type, data, nul):
return body.decode("utf-8", errors="replace")
def read_png_size(fileobj):
"""Return (width, height) from the IHDR chunk of an open PNG, or (0, 0)."""
try:
fileobj.seek(0)
head = fileobj.read(24)
if len(head) == 24 and head[:8] == _PNG_SIGNATURE and head[12:16] == b"IHDR":
return struct.unpack(">II", head[16:24])
except Exception:
pass
return (0, 0)
def read_png_prompt(fileobj):
"""Return the parsed ``prompt`` JSON from an open PNG file, or None."""
if fileobj.read(8) != _PNG_SIGNATURE:
@@ -162,38 +196,225 @@ def read_png_prompt(fileobj):
# Cached per-file text
# --------------------------------------------------------------------------- #
def get_prompt_search_text(path):
"""Lower-cased prompt text of a PNG ('' if none). Cached by mtime + size."""
def _load_entry(path):
"""Return (text, segments, (width, height)) for a PNG, cached by mtime + size."""
try:
st = os.stat(path)
except OSError:
return ""
return "", (), (0, 0)
signature = (st.st_mtime_ns, st.st_size)
with _cache_lock:
hit = _cache.get(path)
if hit and hit[0] == signature:
_cache.move_to_end(path)
return hit[1]
return hit[1], hit[2], hit[3]
text = ""
text, segments, dims = "", (), (0, 0)
try:
with open(path, "rb") as f:
dims = read_png_size(f)
f.seek(0)
prompt = read_png_prompt(f)
if prompt is not None:
text = get_prompt_search_text_from_graph(prompt)
segments = get_prompt_segments_from_graph(prompt)
except Exception:
# Corrupt / truncated / non-ComfyUI PNG: treat as "no prompt".
text = ""
text, segments = "", ()
with _cache_lock:
_cache[path] = (signature, text)
_cache[path] = (signature, text, segments, dims)
_cache.move_to_end(path)
while len(_cache) > _CACHE_MAX_ENTRIES:
_cache.popitem(last=False)
return text
return text, segments, dims
def get_prompt_search_text(path):
"""Lower-cased prompt text of a PNG ('' if none). Cached by mtime + size."""
return _load_entry(path)[0]
def get_png_dimensions(path):
"""(width, height) of a PNG as read from its header, (0, 0) if unknown."""
return _load_entry(path)[2]
def get_prompt_segments(path):
"""Lower-cased prompt strings of a PNG, one per text input (() if none)."""
return _load_entry(path)[1]
def clear_cache():
with _cache_lock:
_cache.clear()
# --------------------------------------------------------------------------- #
# Similar-prompt grouping
# --------------------------------------------------------------------------- #
_BOILERPLATE_MIN_DOCS = 3
_BOILERPLATE_DISTINCT_RATIO = 0.5
def _strip_shared_boilerplate(documents):
"""Drop text that many *different* images share verbatim.
Typical case: an LLM prompt-enhancer node whose long meta-prompt is stored
in every image made with it. Counting such a string as evidence would put
all of those images in one 100% group.
A string is boilerplate when at least a few images contain it and those
images are otherwise different from each other. If they are also identical
in all their other text (a plain seed sweep of one prompt), the string is
real content and is kept, so true duplicates are still found.
Documents may carry a "segments" list (one entry per text input); documents
without it are left untouched. Returns new dicts with "prompt" rebuilt.
"""
seg_sets = []
holders = {}
for index, item in enumerate(documents):
segments = item.get("segments")
normalized = None
if segments:
normalized = frozenset(
" ".join(str(seg).split()) for seg in segments if str(seg).strip()
)
seg_sets.append(normalized)
for seg in normalized or ():
holders.setdefault(seg, []).append(index)
boilerplate = set()
for seg, indices in holders.items():
if len(indices) < _BOILERPLATE_MIN_DOCS:
continue
rests = {seg_sets[i] - {seg} for i in indices}
if len(rests) / len(indices) >= _BOILERPLATE_DISTINCT_RATIO:
boilerplate.add(seg)
if not boilerplate:
return documents
cleaned = []
for item, segs in zip(documents, seg_sets):
if segs is None:
cleaned.append(item)
continue
kept = sorted(seg for seg in segs if seg not in boilerplate)
cleaned.append({**item, "prompt": "\n".join(kept)})
return cleaned
def find_similar_prompt_groups(documents, threshold=0.55):
"""Group prompt documents by token-set Jaccard similarity.
Documents are dictionaries containing an id and prompt text. Candidate
pairs are generated through an inverted index, avoiding a full all-pairs
comparison for unrelated prompts.
"""
documents = _strip_shared_boilerplate(documents)
docs = []
for item in documents:
text = str(item.get("prompt") or "").lower()
tokens = {
token for token in re.findall(r"[a-z0-9_]+", text)
if len(token) > 2
}
if tokens:
docs.append({**item, "_tokens": tokens})
if len(docs) < 2:
return []
# Remove very common tokens: they add little evidence of a duplicate.
frequencies = {}
for doc in docs:
for token in doc["_tokens"]:
frequencies[token] = frequencies.get(token, 0) + 1
common_limit = max(3, int(len(docs) * 0.8))
for doc in docs:
doc["_tokens"] = {
token for token in doc["_tokens"]
if frequencies[token] <= common_limit
}
inverted = {}
for index, doc in enumerate(docs):
for token in doc["_tokens"]:
inverted.setdefault(token, []).append(index)
# Count shared tokens per candidate pair straight from the inverted index.
# Jaccard then needs no set intersection/union: |A∪B| = |A| + |B| - shared.
overlaps = {}
for indices in inverted.values():
if len(indices) > 500:
continue
for offset, left in enumerate(indices):
for right in indices[offset + 1:]:
key = (left, right)
overlaps[key] = overlaps.get(key, 0) + 1
parent = list(range(len(docs)))
rank = [0] * len(docs)
def find(index):
while parent[index] != index:
parent[index] = parent[parent[index]]
index = parent[index]
return index
def union(left, right):
left_root, right_root = find(left), find(right)
if left_root == right_root:
return
if rank[left_root] < rank[right_root]:
left_root, right_root = right_root, left_root
parent[right_root] = left_root
if rank[left_root] == rank[right_root]:
rank[left_root] += 1
scores = {}
sizes = [len(doc["_tokens"]) for doc in docs]
for (left, right), shared in overlaps.items():
size_a, size_b = sizes[left], sizes[right]
if not size_a or not size_b:
continue
# Jaccard can never exceed min/max of the set sizes: cheap early exit.
if min(size_a, size_b) / max(size_a, size_b) < threshold:
continue
score = shared / (size_a + size_b - shared)
if score >= threshold:
scores[(left, right)] = score
union(left, right)
groups = {}
for index in range(len(docs)):
root = find(index)
groups.setdefault(root, []).append(index)
group_scores = {}
for (left, _right), score in scores.items():
group_scores.setdefault(find(left), []).append(score)
result = []
for root, indices in groups.items():
if len(indices) < 2:
continue
items = []
for index in indices:
item = {key: value for key, value in docs[index].items() if key != "_tokens"}
items.append(item)
items.sort(key=lambda item: item.get("mtime", 0), reverse=True)
matched_scores = group_scores.get(root, [])
average_score = sum(matched_scores) / len(matched_scores) if matched_scores else 0
result.append({
"similarity": round(average_score * 100),
"items": items
})
result.sort(key=lambda group: (group["similarity"], len(group["items"])), reverse=True)
return result
+3 -2
View File
@@ -1,7 +1,7 @@
[project]
name = "comfy-sidebar"
description = "A compact and powerful layout overhaul for ComfyUI that makes generation results easier to browse, preview, compare, and manage."
version = "1.8.4"
version = "1.9.0"
license = { file = "LICENSE" }
dependencies = [
"send2trash>=1.8.0",
@@ -13,4 +13,5 @@ Repository = "https://github.com/m0rtus59/ComfyUI-ComfySidebar"
[tool.comfy]
PublisherId = "soundslikethunder"
DisplayName = "Comfy Sidebar"
Icon = "https://raw.githubusercontent.com/m0rtus59/ComfyUI-ComfySidebar/main/assets/icon.png"
Icon = "https://raw.githubusercontent.com/m0rtus59/ComfyUI-ComfySidebar/main/assets/icon.png"
Banner = "https://raw.githubusercontent.com/m0rtus59/ComfyUI-ComfySidebar/main/assets/banner.png"