Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59e69ffebe | ||
|
|
f5aacadd34 | ||
|
|
b9a0271fca | ||
|
|
b2822c6af7 | ||
|
|
1c5f0e135e | ||
|
|
9685fa53b4 | ||
|
|
eda45eaa6f | ||
|
|
ddd15259e0 | ||
|
|
2cda35562a | ||
|
|
9e6672cddd | ||
|
|
2beae3a017 | ||
|
|
ee7768120a | ||
|
|
a270c268ba | ||
|
|
c8496a0d2c | ||
|
|
9df90421c3 | ||
|
|
5354fe7854 | ||
|
|
b4b4bb2ed9 | ||
|
|
ce414d710a | ||
|
|
37569315bd | ||
|
|
867adcfc8d | ||
|
|
7d684125a6 | ||
|
|
e8873eeb83 | ||
|
|
79bd741f77 | ||
|
|
33951dd82a | ||
|
|
4aeeccb11f | ||
|
|
190f1ff999 | ||
|
|
f134976f6b | ||
|
|
f6a97a8f4d | ||
|
|
bbbd27c2f7 | ||
|
|
3d391bfff3 | ||
|
|
5b1118c962 | ||
|
|
1df1d5f47e | ||
|
|
ce2c16a4a4 | ||
|
|
3d8af78a12 | ||
|
|
ca3cc677a6 | ||
|
|
023638664c | ||
|
|
539518498e | ||
|
|
25169294ab | ||
|
|
50b804f4c6 | ||
|
|
deb7ec052b | ||
|
|
f574fe75b0 | ||
|
|
8b46e8c0eb | ||
|
|
0817beff1b | ||
|
|
f0a0e9cc4e | ||
|
|
cb65684554 | ||
|
|
6f97a9c8a5 | ||
|
|
8310c95f95 | ||
|
|
43cd6660ae | ||
|
|
99f1dcf2e4 | ||
|
|
22b2fdc748 | ||
|
|
bfa59866af | ||
|
|
b3d3750f1e | ||
|
|
2d9449a0ff | ||
|
|
fa8152c030 | ||
|
|
ebf0c0ea28 | ||
|
|
fb8f8dcf81 | ||
|
|
042b8fb35d | ||
|
|
5550aae5d7 | ||
|
|
cfac1f8d03 | ||
|
|
2a586cfa39 | ||
|
|
4a1f69f1ca | ||
|
|
fc03bf2262 | ||
|
|
6f24fdbf1a | ||
|
|
62e212ca02 | ||
|
|
0dd346bd83 | ||
|
|
a9f1fcb3f6 | ||
|
|
064b917074 | ||
|
|
a3c0621fbf | ||
|
|
438fc2820e | ||
|
|
08f7ebec51 | ||
|
|
ee1c613dab | ||
|
|
8ddc22ae7d | ||
|
|
3ae1109ca2 | ||
|
|
6d92775d6a | ||
|
|
0e3fd15987 | ||
|
|
69869fd778 | ||
|
|
d184bdb861 | ||
|
|
0adc42371f | ||
|
|
1106e366ff | ||
|
|
90aa5e3759 | ||
|
|
ac7a83ce46 | ||
|
|
425c5a1d39 | ||
|
|
3800c54a44 | ||
|
|
6e0102d59e | ||
|
|
a15c417701 | ||
|
|
326d18cadf | ||
|
|
22fd5d819d | ||
|
|
23536657e7 | ||
|
|
187d44cf36 | ||
|
|
ca7742858c | ||
|
|
384ad09107 | ||
|
|
a28b51249f | ||
|
|
fdefa9aae9 | ||
|
|
dc513a0199 | ||
|
|
4c44af1486 | ||
|
|
90ad6aac23 | ||
|
|
f681a80148 | ||
|
|
869dfcf78a | ||
|
|
9b56ff7dd0 | ||
|
|
aed377f327 | ||
|
|
92716efb26 | ||
|
|
08b911377a | ||
|
|
ef45f9266c | ||
|
|
398c8c4adc | ||
|
|
2b265aaf40 | ||
|
|
9567209ce4 | ||
|
|
a83c0f82ea | ||
|
|
a13030b96b | ||
|
|
0007ec0081 | ||
|
|
0fb27c758b | ||
|
|
cfff37e770 | ||
|
|
f85cdce3a1 | ||
|
|
b15b106d22 | ||
|
|
1802efc3c6 | ||
|
|
30d94822da | ||
|
|
a82b134326 | ||
|
|
9c5f34ed65 | ||
|
|
c077861199 | ||
|
|
d84a1f03af | ||
|
|
79f49c013c | ||
|
|
0a857144c0 | ||
|
|
96da8b9a8d | ||
|
|
455256c94f | ||
|
|
022a1e0ce1 | ||
|
|
cc2f59f508 | ||
|
|
a9de31753e | ||
|
|
2ab5879431 | ||
|
|
125302f04b | ||
|
|
feaafe0609 | ||
|
|
194c5e9530 | ||
|
|
7e400a2146 | ||
|
|
7d1b135fd4 | ||
|
|
bb0aa7b30b | ||
|
|
3d0bee2e72 | ||
|
|
32bd1c0cc6 | ||
|
|
2f13e59279 | ||
|
|
5073983790 | ||
|
|
ce5dcbace7 | ||
|
|
f81abfa7cf | ||
|
|
1ab93d2e8a | ||
|
|
77ddd4ff49 | ||
|
|
15ed5c11ab | ||
|
|
f872b3bf02 | ||
|
|
257e43e82c | ||
|
|
4c52f0e915 | ||
|
|
a60ff98618 | ||
|
|
d1eb10812f | ||
|
|
ab11e82554 | ||
|
|
9853e82174 | ||
|
|
668c14b52e | ||
|
|
2ea065e54c | ||
|
|
6de1d36f5e | ||
|
|
efc408b3f2 | ||
|
|
dc2e1a1373 | ||
|
|
ea7acc0962 | ||
|
|
0310096066 | ||
|
|
fd830f2236 | ||
|
|
1d3e317d5c | ||
|
|
a0c93d1fbb | ||
|
|
72466f5512 | ||
|
|
b70a188f61 | ||
|
|
5c5558dc9b | ||
|
|
e14d6588bc | ||
|
|
0d6c594589 | ||
|
|
877dff6fc7 | ||
|
|
77fbe6cf98 | ||
|
|
6e918fae79 | ||
|
|
5ba50a29c8 | ||
|
|
82322f2e73 | ||
|
|
0524ae0d87 | ||
|
|
2e237f500f | ||
|
|
91c929fde0 | ||
|
|
fd8389df94 | ||
|
|
8fe8f5ab07 | ||
|
|
411bb83fe2 | ||
|
|
a3d67f9433 | ||
|
|
bd80d4dde7 | ||
|
|
e3c9270879 | ||
|
|
c50e0dbca6 | ||
|
|
b01a60b03a | ||
|
|
e0b248b02e | ||
|
|
2af0b1d69b | ||
|
|
d31a0592dd | ||
|
|
4f5786744e | ||
|
|
e46da79bbf | ||
|
|
02872fa2a9 | ||
|
|
d18757b77c | ||
|
|
7f0c74aa01 | ||
|
|
832f24e04c | ||
|
|
cfed7ad464 | ||
|
|
a463bbec8a | ||
|
|
a9382dc969 | ||
|
|
cb1823f216 | ||
|
|
fcf31d2f4f | ||
|
|
66df393360 | ||
|
|
eae77b683d | ||
|
|
3852b71e0c | ||
|
|
9c949edc7b | ||
|
|
ae0d068e08 | ||
|
|
16e321d19a | ||
|
|
6bb94886b3 | ||
|
|
5e04a25b23 | ||
|
|
ce58fff869 | ||
|
|
501d34a36d | ||
|
|
dd6652c5fd | ||
|
|
24a0ae5ae8 | ||
|
|
d1d6739764 | ||
|
|
9134a59aa1 | ||
|
|
abbb7866b2 | ||
|
|
914cf661b3 | ||
|
|
34977f26a1 | ||
|
|
0a0fcd580d | ||
|
|
2a6a3fcabb | ||
|
|
0563af7123 | ||
|
|
944fa74601 | ||
|
|
cd8bc7a201 | ||
|
|
ec13f830f2 | ||
|
|
cf137b84f5 | ||
|
|
36ab9e1946 | ||
|
|
2db8592267 | ||
|
|
9cb8f7faba | ||
|
|
a95d2ca1b7 | ||
|
|
f5f5016346 | ||
|
|
e9c7205e25 | ||
|
|
6b06b18bca | ||
|
|
1c6886712a | ||
|
|
2286083b9b | ||
|
|
a23ba4fae2 | ||
|
|
09677772c6 | ||
|
|
37522e484a | ||
|
|
270616a744 | ||
|
|
2941e48879 | ||
|
|
f7436011c4 | ||
|
|
e783422e7c | ||
|
|
41d2e38f2f | ||
|
|
56247cfa8b | ||
|
|
328915a7ee | ||
|
|
543e9e999a | ||
|
|
421361edb8 | ||
|
|
647c95a5df | ||
|
|
7421dfa756 | ||
|
|
60883fdf63 | ||
|
|
b6143a3abf | ||
|
|
828d510891 | ||
|
|
024309c050 | ||
|
|
2e09cf3963 | ||
|
|
ef424be4b1 | ||
|
|
a1fa872e2e | ||
|
|
d31852e5ab | ||
|
|
bb98171982 | ||
|
|
004744e8e2 | ||
|
|
94933a0246 | ||
|
|
c942976c02 | ||
|
|
0d19394c8f | ||
|
|
4bca1435a6 | ||
|
|
4eb67f25f0 | ||
|
|
40a9cf3db9 | ||
|
|
ff0466957e | ||
|
|
294e610eb1 | ||
|
|
a33052141a | ||
|
|
e2a3c0c596 | ||
|
|
557d910ab4 | ||
|
|
be5c8c41c9 | ||
|
|
408517273a | ||
|
|
e8b6622919 | ||
|
|
4001848e37 | ||
|
|
0733d001f3 | ||
|
|
33878502af | ||
|
|
2c9ded2cbf | ||
|
|
1a848e2b00 | ||
|
|
700b85408c | ||
|
|
6a0b0cd71a | ||
|
|
56452eb855 | ||
|
|
81d98f908b | ||
|
|
cad4098496 | ||
|
|
6c3422e5c0 |
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
__pycache__/
|
||||
*.pyc
|
||||
Thumbs.db
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
desktop.ini
|
||||
# Local test suite (kept out of the repository)
|
||||
tests/
|
||||
|
||||
@@ -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.
|
||||
@@ -6,23 +10,31 @@ A compact and powerful layout overhaul for ComfyUI that makes generation results
|
||||
|
||||
* **Compact, information-dense layout** with visual previews that let you see what is happening at a glance. Optional UI elements and sidebar tabs can be hidden when you don't need them.
|
||||
|
||||
<img src="assets/layout.png" alt="ComfySidebar layout" width="100%">
|
||||
<img src="assets/layout.png" alt="ComfySidebar layout">
|
||||
|
||||
* **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" width="100%">
|
||||
<img src="assets/controls.png" alt="ComfySidebar controls overview">
|
||||
|
||||
* **Built-in comparison tool** for quickly comparing two generated results side by side.
|
||||
|
||||
<img src="assets/compare.png" alt="ComfySidebar compare" width="100%">
|
||||
<img src="assets/compare.png" alt="ComfySidebar compare">
|
||||
|
||||
* **[NEW] 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, prompt metadata search across subfolders, and persistent sorting.
|
||||
* **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.
|
||||
|
||||
<img src="assets/runtime.png" alt="ComfySidebar runtime mode" width="100%">
|
||||
<img src="assets/runtime.png" alt="ComfySidebar runtime mode">
|
||||
|
||||
* **[NEW] Quick Workflow Picker** Allows you to quickly find and load an existing workflow from your collection by pressing `+` button on the workflow tab.
|
||||
|
||||
<img src="assets/picker.png" alt="ComfySidebar quick picker">
|
||||
|
||||
## 🛠️ Installation
|
||||
|
||||
@@ -61,24 +73,27 @@ Open **Settings → Comfy Sidebar** to configure:
|
||||
* Unified top bar layout
|
||||
* Permanent deletion behavior
|
||||
* Output Gallery sidebar toggle
|
||||
* Fix non-ASCII keybinds (hotkeys on any keyboard layout)
|
||||
|
||||
## ⌨️ Controls
|
||||
|
||||
| Shortcut | Action |
|
||||
| ------------- | ---------------------------------------------- |
|
||||
| `Q` | Toggle ComfySidebar |
|
||||
| `Ctrl+Q` | Exclude the selected node from sidebar results |
|
||||
| `Alt+R` | Renumber nodes in execution order |
|
||||
| `Q` | Toggle ComfySidebar* |
|
||||
| `Ctrl+Q` | Exclude the selected node from sidebar results* |
|
||||
| `Alt+R` | Renumber nodes in execution order* |
|
||||
| `Click` | Open result preview |
|
||||
| `Shift+Click` | Compare another result |
|
||||
| `Ctrl+Click` | Open the file location / alternative action |
|
||||
|
||||
You can also use the available actions from result cards, the sidebar header, and the node/canvas context menus.
|
||||
*You can see and change keybindings in **Settings → Keybinding**.
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
ComfySidebar integrates with the ComfyUI frontend and depends on parts of its UI structure. Frontend changes in ComfyUI may require updates to this extension.
|
||||
|
||||
**Keyboard layouts:** the *Fix non-ASCII keybinds* option only re-maps keys that produce a non-ASCII character, so QWERTY, AZERTY and Dvorak users are not affected. It cannot help with layouts that type a *different ASCII* symbol on a key (for example, `+` where a US layout has `=`). ComfyUI's "edit keybinding" dialog still records the typed character, so switch to an English layout while rebinding a key.
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE](LICENSE).
|
||||
|
||||
|
After Width: | Height: | Size: 181 KiB |
|
Before Width: | Height: | Size: 789 KiB After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 25 KiB |
@@ -1,5 +1,6 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import { SettingIds } from "../core/constants.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
|
||||
export function findOriginalPropertiesButton() {
|
||||
const byTestId = document.querySelector('[data-testid="properties-panel-toggle"]');
|
||||
@@ -71,6 +72,11 @@ export function findPropertiesPanel() {
|
||||
}
|
||||
|
||||
export function isPropertiesPanelOpen() {
|
||||
const modernOpen = getSetting("Comfy.RightSidePanel.IsOpen");
|
||||
if (typeof modernOpen === "boolean") {
|
||||
return modernOpen;
|
||||
}
|
||||
|
||||
const panel = findPropertiesPanel();
|
||||
if (panel) return true;
|
||||
|
||||
@@ -140,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() {
|
||||
@@ -278,11 +282,9 @@ export function applySidebarOverride() {
|
||||
|
||||
try {
|
||||
const overrideStock = (
|
||||
app.extensionManager?.setting?.get?.(SettingIds.OVERRIDE_STOCK_HISTORY) ??
|
||||
app.ui?.settings?.getSettingValue?.(SettingIds.OVERRIDE_STOCK_HISTORY) ??
|
||||
app.ui?.settings?.getSettingValue?.("Comfy Sidebar.Hide Junk.Override Stock Job History Tab") ??
|
||||
app.ui?.settings?.getSettingValue?.("Comfy Sidebar.Override Stock History") ??
|
||||
false
|
||||
getSetting(SettingIds.OVERRIDE_STOCK_HISTORY) ??
|
||||
getSetting("Comfy Sidebar.Hide Junk.Override Stock Job History Tab") ??
|
||||
getSetting("Comfy Sidebar.Override Stock History", false)
|
||||
);
|
||||
const stdBtn = findStandardQueueButton();
|
||||
const ourBtn = findOurSidebarButton();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import {
|
||||
findOriginalPropertiesButton,
|
||||
findTopbarContainer,
|
||||
@@ -11,6 +10,7 @@ import {
|
||||
} from "./adapter.js";
|
||||
import { SettingIds } from "../core/constants.js";
|
||||
import { isRuntimePreviewEnabled, setRuntimePreviewEnabled, setRuntimePreviewStateListener } from "../utils/comparison.js";
|
||||
import { getSetting, setSetting } from "../core/settings.js";
|
||||
|
||||
// Listen for runtime preview state changes to keep button UI in sync
|
||||
setRuntimePreviewStateListener(() => {
|
||||
@@ -88,20 +88,11 @@ div:has(> [class*="actionbar"]):not(header):not(.topbar):not(.actionbar-containe
|
||||
export function syncStockHistoryAndProgressSettings(enable) {
|
||||
const dockedVal = !!enable;
|
||||
const progressVal = !enable;
|
||||
const QPOV2_ID = "Comfy.Queue.QPOV2";
|
||||
const progressKey = "Comfy.Queue.ShowRunProgressBar";
|
||||
const QPOV2_ID = SettingIds.DOCK_QUEUE || "Comfy.Queue.QPOV2";
|
||||
const progressKey = SettingIds.SHOW_PROGRESS_BAR || "Comfy.Queue.ShowRunProgressBar";
|
||||
|
||||
if (app.extensionManager?.setting) {
|
||||
try { app.extensionManager.setting.set(QPOV2_ID, dockedVal); } catch (e) {}
|
||||
try { app.extensionManager.setting.set(progressKey, progressVal); } catch (e) {}
|
||||
} else if (app.ui?.settings) {
|
||||
try { app.ui.settings.setSettingValue(QPOV2_ID, dockedVal); } catch (e) {}
|
||||
try { app.ui.settings.setSettingValue(progressKey, progressVal); } catch (e) {}
|
||||
}
|
||||
|
||||
try { localStorage.setItem(QPOV2_ID, JSON.stringify(dockedVal)); } catch (e) {}
|
||||
try { localStorage.setItem(progressKey, JSON.stringify(progressVal)); } catch (e) {}
|
||||
try { window.dispatchEvent(new Event("storage")); } catch (e) {}
|
||||
setSetting(QPOV2_ID, dockedVal);
|
||||
setSetting(progressKey, progressVal);
|
||||
}
|
||||
|
||||
let savedButtonData = null;
|
||||
@@ -128,6 +119,11 @@ function setupSidebarTopObserver() {
|
||||
}
|
||||
|
||||
function isSidebarOnLeft() {
|
||||
const location = getSetting("Comfy.Sidebar.Location");
|
||||
if (location === "left" || location === "right") {
|
||||
return location === "left";
|
||||
}
|
||||
|
||||
const sidebar = document.querySelector('.comfyui-sidebar, .comfy-sidebar, .sidebar, [class*="sidebar-nav"], [class*="sidebar"]');
|
||||
if (!sidebar) return false;
|
||||
return sidebar.getBoundingClientRect().left < window.innerWidth / 2;
|
||||
@@ -366,9 +362,9 @@ function setupCanvasMenuPopoverRelocator() {
|
||||
const sidebar = document.querySelector('.comfyui-sidebar, .comfy-sidebar, .sidebar, [class*="sidebar-nav"], [class*="sidebar"]');
|
||||
if (!sidebar || !popovers.length) return;
|
||||
|
||||
const sidebarRect = sidebar.getBoundingClientRect();
|
||||
const btnRect = btn.getBoundingClientRect();
|
||||
const onLeft = sidebarRect.left < window.innerWidth / 2;
|
||||
const sidebarRect = sidebar.getBoundingClientRect();
|
||||
const onLeft = isSidebarOnLeft();
|
||||
|
||||
popovers.forEach((pop) => {
|
||||
if (pop.style.display !== "none" && !pop.classList.contains("p-overlay-hidden")) {
|
||||
@@ -425,11 +421,7 @@ export function applyClassicLayout(enable, updateSetting = false) {
|
||||
|
||||
if (enable) {
|
||||
if (updateSetting) {
|
||||
if (app.extensionManager?.setting) {
|
||||
app.extensionManager.setting.set("Comfy.Workflow.WorkflowTabsPosition", "Topbar");
|
||||
} else if (app.ui?.settings) {
|
||||
app.ui.settings.setSettingValue("Comfy.Workflow.WorkflowTabsPosition", "Topbar");
|
||||
}
|
||||
setSetting("Comfy.Workflow.WorkflowTabsPosition", "Topbar");
|
||||
}
|
||||
if (!styleEl) {
|
||||
styleEl = document.createElement("style");
|
||||
@@ -453,7 +445,7 @@ export function applyClassicLayout(enable, updateSetting = false) {
|
||||
}
|
||||
|
||||
function syncAvatarVisibility() {
|
||||
const hideAvatar = app.ui?.settings?.getSettingValue("Comfy Sidebar.Hide Junk.Avatar") ?? false;
|
||||
const hideAvatar = getSetting("Comfy Sidebar.Hide Junk.Avatar", false);
|
||||
const STYLE_AVATAR_ID = "comfy-sidebar-hide-avatar-override";
|
||||
let styleEl = document.getElementById(STYLE_AVATAR_ID);
|
||||
|
||||
@@ -462,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"]),
|
||||
@@ -501,7 +497,7 @@ function updateSidebarTabsVisibility() {
|
||||
};
|
||||
|
||||
Object.entries(tabSelectors).forEach(([tab, selector]) => {
|
||||
const shouldHide = app.ui?.settings?.getSettingValue(`Comfy Sidebar.Hide Junk.${tab}`) ?? false;
|
||||
const shouldHide = getSetting(`Comfy Sidebar.Hide Junk.${tab}`, false);
|
||||
const target = sidebar.querySelector(selector);
|
||||
if (target) {
|
||||
const tabBtn = target.closest('.comfyui-sidebar-tab, button, [role="tab"], li, a, .comfyui-sidebar-item') || target;
|
||||
@@ -514,11 +510,9 @@ function updateSidebarTabsVisibility() {
|
||||
});
|
||||
|
||||
const hideStockHistory = (
|
||||
app.extensionManager?.setting?.get?.(SettingIds.OVERRIDE_STOCK_HISTORY) ??
|
||||
app.ui?.settings?.getSettingValue?.(SettingIds.OVERRIDE_STOCK_HISTORY) ??
|
||||
app.ui?.settings?.getSettingValue?.("Comfy Sidebar.Hide Junk.Override Stock Job History Tab") ??
|
||||
app.ui?.settings?.getSettingValue?.("Comfy Sidebar.Override Stock History") ??
|
||||
false
|
||||
getSetting(SettingIds.OVERRIDE_STOCK_HISTORY) ??
|
||||
getSetting("Comfy Sidebar.Hide Junk.Override Stock Job History Tab") ??
|
||||
getSetting("Comfy Sidebar.Override Stock History", false)
|
||||
);
|
||||
const historyTarget = sidebar.querySelector('[data-testid="queue-tab-button"], [data-testid="job-history-tab-button"], [class*="lucide--history"]');
|
||||
if (historyTarget) {
|
||||
@@ -558,7 +552,7 @@ function cleanHTML(html) {
|
||||
}
|
||||
|
||||
function syncGraphButton() {
|
||||
const hideGraphBtn = app.ui?.settings?.getSettingValue("Comfy Sidebar.Hide Junk.Graph Button") ?? false;
|
||||
const hideGraphBtn = getSetting("Comfy Sidebar.Hide Junk.Graph Button", false);
|
||||
const graphBtn = findGraphButton();
|
||||
if (graphBtn) {
|
||||
if (hideGraphBtn) {
|
||||
@@ -653,11 +647,17 @@ function syncPropertiesButton(isClassicLayoutEnabled) {
|
||||
customBtn.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const nativeBtn = findOriginalPropertiesButton();
|
||||
if (nativeBtn) {
|
||||
nativeBtn.click();
|
||||
|
||||
const isOpen = getSetting("Comfy.RightSidePanel.IsOpen");
|
||||
if (typeof isOpen === "boolean") {
|
||||
setSetting("Comfy.RightSidePanel.IsOpen", !isOpen);
|
||||
requestAnimationFrame(() => syncClassicLayout());
|
||||
} else {
|
||||
const nativeBtn = findOriginalPropertiesButton();
|
||||
if (nativeBtn) {
|
||||
nativeBtn.click();
|
||||
requestAnimationFrame(() => syncClassicLayout());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -674,7 +674,7 @@ function syncPropertiesButton(isClassicLayoutEnabled) {
|
||||
}
|
||||
|
||||
function syncActiveQueueIndicator(isClassicLayoutEnabled) {
|
||||
const hideQueueIndicator = app.ui?.settings?.getSettingValue("Comfy Sidebar.Hide Junk.Override Stock Job History Tab") ?? false;
|
||||
const hideQueueIndicator = getSetting("Comfy Sidebar.Hide Junk.Override Stock Job History Tab", false);
|
||||
const indicator = findActiveQueueIndicator();
|
||||
if (indicator) {
|
||||
if (isClassicLayoutEnabled && hideQueueIndicator) {
|
||||
@@ -685,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;
|
||||
@@ -693,39 +712,9 @@ export function syncRuntimePreviewButton() {
|
||||
if (!dock) {
|
||||
dock = document.createElement("div");
|
||||
dock.className = "comfy-sidebar-runtime-preview-dock";
|
||||
Object.assign(dock.style, {
|
||||
position: "sticky",
|
||||
bottom: "0px",
|
||||
left: "0px",
|
||||
width: "100%",
|
||||
padding: "8px 12px",
|
||||
boxSizing: "border-box",
|
||||
background: "var(--comfy-menu-bg, #181818)",
|
||||
borderTop: "1px solid var(--border-color, rgba(255, 255, 255, 0.12))",
|
||||
zIndex: "20",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
marginTop: "auto"
|
||||
});
|
||||
|
||||
const btn = document.createElement("button");
|
||||
btn.className = "comfy-sidebar-runtime-preview-btn";
|
||||
Object.assign(btn.style, {
|
||||
width: "100%",
|
||||
height: "34px",
|
||||
borderRadius: "6px",
|
||||
cursor: "pointer",
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: "8px",
|
||||
fontSize: "12px",
|
||||
fontWeight: "600",
|
||||
fontFamily: "sans-serif",
|
||||
transition: "all 0.15s ease",
|
||||
outline: "none"
|
||||
});
|
||||
|
||||
btn.onclick = (e) => {
|
||||
e.preventDefault();
|
||||
@@ -741,6 +730,7 @@ export function syncRuntimePreviewButton() {
|
||||
const btn = dock.querySelector(".comfy-sidebar-runtime-preview-btn");
|
||||
if (btn) {
|
||||
const active = isRuntimePreviewEnabled();
|
||||
btn.classList.toggle("active", active);
|
||||
|
||||
const lucidePlay = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink:0;"><polygon points="6 3 20 12 6 21 6 3"/></svg>`;
|
||||
const lucideEye = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="opacity:0.7;flex-shrink:0;"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>`;
|
||||
@@ -748,17 +738,9 @@ export function syncRuntimePreviewButton() {
|
||||
const lucideSquare = `<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="opacity:0.5;flex-shrink:0;"><rect width="18" height="18" x="3" y="3" rx="2"/></svg>`;
|
||||
|
||||
if (active) {
|
||||
btn.style.background = "rgba(59, 130, 246, 0.18)";
|
||||
btn.style.border = "1px solid #3b82f6";
|
||||
btn.style.color = "#93c5fd";
|
||||
btn.style.boxShadow = "0 0 8px rgba(59, 130, 246, 0.35)";
|
||||
btn.innerHTML = `<span style="display:flex;align-items:center;gap:7px;">${lucidePlay}<span>Runtime Preview</span></span>${lucideSquareCheck}`;
|
||||
btn.title = "Runtime Preview is ON (auto-tracking live generation). Click to turn OFF.";
|
||||
} else {
|
||||
btn.style.background = "rgba(255, 255, 255, 0.05)";
|
||||
btn.style.border = "1px solid var(--border-color, rgba(255, 255, 255, 0.15))";
|
||||
btn.style.color = "var(--desc-color, #aaa)";
|
||||
btn.style.boxShadow = "none";
|
||||
btn.innerHTML = `<span style="display:flex;align-items:center;gap:7px;">${lucideEye}<span>Runtime Preview</span></span>${lucideSquare}`;
|
||||
btn.title = "Click to turn ON Runtime Preview (auto-focus live generation).";
|
||||
}
|
||||
@@ -769,24 +751,19 @@ export function syncClassicLayout() {
|
||||
if (domObserver) domObserver.disconnect();
|
||||
|
||||
try {
|
||||
const isClassicLayoutEnabled = app.ui?.settings?.getSettingValue("Comfy Sidebar.Comfy Layout") ?? false;
|
||||
const tabsPos = app.extensionManager?.setting?.get?.("Comfy.Workflow.WorkflowTabsPosition") ??
|
||||
app.ui?.settings?.getSettingValue("Comfy.Workflow.WorkflowTabsPosition");
|
||||
const isClassicLayoutEnabled = getSetting("Comfy Sidebar.Comfy Layout", false);
|
||||
const tabsPos = getSetting("Comfy.Workflow.WorkflowTabsPosition");
|
||||
|
||||
// Real-time safeguard: if tabs are in Sidebar, disable Comfy Layout immediately
|
||||
if (isClassicLayoutEnabled && tabsPos === "Sidebar") {
|
||||
applyClassicLayout(false, false);
|
||||
if (app.extensionManager?.setting) {
|
||||
try { app.extensionManager.setting.set("Comfy Sidebar.Comfy Layout", false); } catch (e) {}
|
||||
} else if (app.ui?.settings) {
|
||||
try { app.ui.settings.setSettingValue("Comfy Sidebar.Comfy Layout", false); } catch (e) {}
|
||||
}
|
||||
setSetting("Comfy Sidebar.Comfy Layout", false);
|
||||
return;
|
||||
}
|
||||
|
||||
let canvasControlsMode = app.ui?.settings?.getSettingValue("Comfy Sidebar.Hide Junk.Floating Canvas Controls");
|
||||
let canvasControlsMode = getSetting("Comfy Sidebar.Hide Junk.Floating Canvas Controls");
|
||||
if (canvasControlsMode === undefined || canvasControlsMode === null) {
|
||||
const legacyDock = app.ui?.settings?.getSettingValue("Comfy Sidebar.Dock Canvas Controls");
|
||||
const legacyDock = getSetting("Comfy Sidebar.Dock Canvas Controls");
|
||||
canvasControlsMode = legacyDock ? "Dock" : "Default";
|
||||
} else if (typeof canvasControlsMode === "boolean") {
|
||||
canvasControlsMode = canvasControlsMode ? "Dock" : "Default";
|
||||
@@ -802,6 +779,7 @@ export function syncClassicLayout() {
|
||||
syncExtensionsPanel(isClassicLayoutEnabled);
|
||||
syncPropertiesButton(isClassicLayoutEnabled);
|
||||
syncActiveQueueIndicator(isClassicLayoutEnabled);
|
||||
syncRunOnComfyCloudButton();
|
||||
updateSidebarTabsVisibility();
|
||||
applySidebarOverride();
|
||||
if (!sidebarTopObserver) {
|
||||
@@ -961,14 +939,19 @@ export function setupPropertiesPanelToggleFix() {
|
||||
}
|
||||
|
||||
/* Neutralize CanvasModeSelector inner selected backgrounds so idle mode is clean and transparent */
|
||||
.comfy-sidebar-unfloated-canvas-menu [class*="bg-muted"],
|
||||
.comfy-sidebar-unfloated-canvas-menu [class*="group-hover:bg-accent"],
|
||||
.comfy-sidebar-unfloated-canvas-menu > button div,
|
||||
.comfy-sidebar-unfloated-canvas-menu > div div,
|
||||
.comfy-sidebar-unfloated-canvas-menu > div button,
|
||||
.comfy-sidebar-unfloated-canvas-menu > div [role="button"],
|
||||
.comfy-sidebar-unfloated-canvas-menu [class*="bg-interface-panel-selected-surface"],
|
||||
.comfy-sidebar-unfloated-canvas-menu [class*="group-hover:bg-interface-button-hover-surface"] {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
/* Compact CanvasModeSelector padding and chevrons to eliminate extra sidebar width and ensure full-width highlight */
|
||||
@@ -1071,7 +1054,7 @@ export function setupPropertiesPanelToggleFix() {
|
||||
|
||||
const isInternalSidebarMutation = (node) => {
|
||||
if (!node || node.nodeType !== 1) return false;
|
||||
return node.closest?.('.comfyui-sidebar, .comfy-sidebar, .comfy-sidebar-comparison-overlay') ||
|
||||
return node.closest?.('.comfyui-sidebar, .comfy-sidebar, .comfy-sidebar-comparison-overlay, .comfy-sidebar-wf-picker') ||
|
||||
node.classList?.contains('comfy-sidebar-card');
|
||||
};
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ export const SettingIds = Object.freeze({
|
||||
OVERRIDE_STOCK_HISTORY: "Comfy Sidebar.Hide Junk.Override Stock Job History Tab",
|
||||
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",
|
||||
SHOW_PROGRESS_BAR: "Comfy.Queue.ShowRunProgressBar",
|
||||
|
||||
@@ -1,14 +1,39 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
let currentLocale = "en";
|
||||
let currentSettingRaw = null;
|
||||
let loadSeq = 0;
|
||||
let translations = {};
|
||||
let fallbackTranslations = {};
|
||||
let fallbackLoaded = false;
|
||||
const localeCache = new Map();
|
||||
const localeListeners = new Set();
|
||||
|
||||
function detectRawLocale() {
|
||||
let settingVal = app?.extensionManager?.setting?.get?.("Comfy.Locale")
|
||||
|| app?.ui?.settings?.getSettingValue?.("Comfy.Locale")
|
||||
|| app?.extensionManager?.setting?.get?.("Comfy.Locale.Language")
|
||||
|| app?.ui?.settings?.getSettingValue?.("Comfy.Locale.Language");
|
||||
|
||||
if (!settingVal) {
|
||||
try {
|
||||
settingVal = localStorage.getItem("Comfy.Settings.Comfy.Locale")
|
||||
|| localStorage.getItem("Comfy.Locale");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return (settingVal || "en").toLowerCase().replace("_", "-");
|
||||
}
|
||||
|
||||
async function fetchLocaleFiles(lang) {
|
||||
if (localeCache.has(lang)) {
|
||||
return localeCache.get(lang);
|
||||
}
|
||||
|
||||
const data = {};
|
||||
for (const file of ["main.json", "settings.json"]) {
|
||||
for (const file of ["main.json"]) {
|
||||
try {
|
||||
const url = new URL(`../locales/${lang}/${file}`, import.meta.url).href;
|
||||
const url = `/comfy-sidebar/locales/${encodeURIComponent(lang)}/${file}`;
|
||||
const res = await fetch(url);
|
||||
if (res.ok) {
|
||||
const json = await res.json();
|
||||
@@ -16,53 +41,108 @@ async function fetchLocaleFiles(lang) {
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
localeCache.set(lang, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function initI18n() {
|
||||
const seq = ++loadSeq;
|
||||
try {
|
||||
let settingVal = app?.extensionManager?.setting?.get?.("Comfy.Locale")
|
||||
|| app?.ui?.settings?.getSettingValue?.("Comfy.Locale")
|
||||
|| app?.extensionManager?.setting?.get?.("Comfy.Locale.Language")
|
||||
|| app?.ui?.settings?.getSettingValue?.("Comfy.Locale.Language");
|
||||
|
||||
if (!settingVal) {
|
||||
try {
|
||||
settingVal = localStorage.getItem("Comfy.Settings.Comfy.Locale")
|
||||
|| localStorage.getItem("Comfy.Locale");
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
const raw = (settingVal || "en").toLowerCase().replace("_", "-");
|
||||
const raw = detectRawLocale();
|
||||
const candidates = [raw];
|
||||
const base = raw.split("-")[0];
|
||||
if (base !== raw) candidates.push(base);
|
||||
|
||||
currentSettingRaw = raw;
|
||||
currentLocale = candidates[0];
|
||||
console.log("[ComfySidebar] Detected locale:", currentLocale);
|
||||
|
||||
// 1. Load English fallback
|
||||
fallbackTranslations = await fetchLocaleFiles("en");
|
||||
// 1. Load English fallback once
|
||||
if (!fallbackLoaded) {
|
||||
const fb = await fetchLocaleFiles("en");
|
||||
if (seq !== loadSeq) return;
|
||||
fallbackTranslations = fb;
|
||||
fallbackLoaded = true;
|
||||
}
|
||||
|
||||
// 2. Load active locale if not English
|
||||
// 2. Load active locale if not English (and clear previous locale if switching back to English)
|
||||
let nextTranslations = {};
|
||||
if (base !== "en") {
|
||||
for (const cand of candidates) {
|
||||
const locData = await fetchLocaleFiles(cand);
|
||||
if (seq !== loadSeq) return;
|
||||
if (Object.keys(locData).length > 0) {
|
||||
translations = locData;
|
||||
console.log(`[ComfySidebar] Loaded ${cand} with ${Object.keys(translations).length} translations`);
|
||||
nextTranslations = locData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (seq !== loadSeq) return;
|
||||
translations = nextTranslations;
|
||||
} catch (e) {
|
||||
console.warn("[ComfySidebar] i18n initialization failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
export function onLocaleChange(callback) {
|
||||
if (typeof callback !== "function") return () => {};
|
||||
localeListeners.add(callback);
|
||||
return () => localeListeners.delete(callback);
|
||||
}
|
||||
|
||||
export function setupLocaleWatcher() {
|
||||
const cleanups = [];
|
||||
|
||||
const checkAndReload = () => {
|
||||
const nextRaw = detectRawLocale();
|
||||
if (nextRaw !== currentSettingRaw) {
|
||||
initI18n().then(() => {
|
||||
for (const fn of localeListeners) {
|
||||
try { fn(currentLocale); } catch (e) {}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const settingStore = app?.extensionManager?.setting?.settingStore;
|
||||
if (settingStore?.$subscribe) {
|
||||
const unsub = settingStore.$subscribe(() => {
|
||||
checkAndReload();
|
||||
});
|
||||
cleanups.push(unsub);
|
||||
}
|
||||
|
||||
for (const key of ["Comfy.Locale", "Comfy.Locale.Language"]) {
|
||||
const settingObj =
|
||||
app?.ui?.settings?.settings?.[key] ||
|
||||
app?.extensionManager?.setting?.settings?.[key];
|
||||
if (settingObj && !settingObj._comfySidebarLocaleWatched) {
|
||||
settingObj._comfySidebarLocaleWatched = true;
|
||||
const origOnChange = settingObj.onChange;
|
||||
settingObj.onChange = (val) => {
|
||||
if (origOnChange) origOnChange(val);
|
||||
checkAndReload();
|
||||
};
|
||||
cleanups.push(() => {
|
||||
settingObj.onChange = origOnChange;
|
||||
delete settingObj._comfySidebarLocaleWatched;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
cleanups.forEach(fn => {
|
||||
try { if (typeof fn === "function") fn(); } catch (e) {}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function t(key, vars = {}) {
|
||||
if (!key) return "";
|
||||
let str = translations[key] || fallbackTranslations[key] || key;
|
||||
const locVal = typeof translations[key] === "string" ? translations[key] : null;
|
||||
const fbVal = typeof fallbackTranslations[key] === "string" ? fallbackTranslations[key] : null;
|
||||
let str = locVal || fbVal || key;
|
||||
for (const [k, v] of Object.entries(vars)) {
|
||||
str = str.replaceAll(`{${k}}`, v);
|
||||
}
|
||||
|
||||
@@ -25,13 +25,19 @@ 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),
|
||||
status: state.status,
|
||||
images: cleanedImages,
|
||||
texts: state.texts || [],
|
||||
promptSearchText: state.promptSearchText,
|
||||
nodeOutputs: state.nodeOutputs || {},
|
||||
nodeTitles: state.nodeTitles || {}, // Always preserved across restarts
|
||||
workflow: includeWorkflow ? state.workflow : null,
|
||||
@@ -60,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;
|
||||
|
||||
@@ -6,6 +6,7 @@ export function createPromptState(pid, initial = {}) {
|
||||
status: initial.status || PromptStatus.PENDING,
|
||||
images: Array.isArray(initial.images) ? [...initial.images] : [],
|
||||
texts: Array.isArray(initial.texts) ? [...initial.texts] : [],
|
||||
promptSearchText: typeof initial.promptSearchText === "string" ? initial.promptSearchText : null,
|
||||
nodeOutputs: initial.nodeOutputs ? { ...initial.nodeOutputs } : {},
|
||||
nodeTitles: initial.nodeTitles ? { ...initial.nodeTitles } : {},
|
||||
progress: typeof initial.progress === "number" ? initial.progress : 0,
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Safely retrieves a setting value from ComfyUI's extension manager or legacy settings.
|
||||
*/
|
||||
export function getSetting(id, fallback = undefined) {
|
||||
const settings = app.extensionManager?.setting;
|
||||
if (settings?.get) {
|
||||
const val = settings.get(id);
|
||||
if (val !== undefined && val !== null) return val;
|
||||
}
|
||||
const legacyVal = app.ui?.settings?.getSettingValue?.(id);
|
||||
if (legacyVal !== undefined && legacyVal !== null) return legacyVal;
|
||||
return fallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely sets a setting value across modern extensionManager and legacy UI settings.
|
||||
*/
|
||||
export function setSetting(id, value) {
|
||||
const settings = app.extensionManager?.setting;
|
||||
if (settings?.set) {
|
||||
settings.set(id, value);
|
||||
return;
|
||||
}
|
||||
app.ui?.settings?.setSettingValue?.(id, value);
|
||||
}
|
||||
@@ -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,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "حد أعمدة قائمة الانتظار",
|
||||
"Width Threshold for Queue Columns (px)": "العرض بالبكسل لتقسيم القائمة إلى عدة أعمدة",
|
||||
"Show Pending Count Only": "إظهار عدد المهام المعلقة فقط",
|
||||
"If disabled, each queued job will have a separate individual card": "في حال التعطيل، ستظهر كل مهمة في القائمة ببطاقة مستقلة",
|
||||
"Show Working Node Name": "إظهار اسم العقدة النشطة",
|
||||
"Shows the name of the node which is currently in the process": "يعرض اسم العقدة التي تتم معالجتها حالياً",
|
||||
"Auto Clear Interrupted": "مسح تلقائي للمهام المقاطعة",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "مسح المهام الملغاة والفاشلة تلقائياً عند بدء توليد جديد",
|
||||
"Permanent Delete on Disk Deletion": "حذف دائم من القرص",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "حذف الملفات نهائياً عند المسح من القرص (دون نقلها لسلة المحذوفات)",
|
||||
"Hide Tab: {tab}": "إخفاء التبويب: {tab}",
|
||||
"Assets": "الأصول",
|
||||
"Nodes": "العقد",
|
||||
"Models": "النماذج",
|
||||
"Workflows": "مخططات العمل",
|
||||
"Apps": "التطبيقات",
|
||||
"Templates": "القوالب",
|
||||
"Override Stock History": "استبدال السجل الافتراضي",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "استبدال الشريط الجانبي لسجل المهام الافتراضي بـ Comfy Queue",
|
||||
"Hide Graph Button": "إخفاء زر 'المخطط'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "إخفاء الزر العائم 'المخطط' (خريطة العقد)",
|
||||
"Hide Avatar": "إخفاء الصورة الرمزية",
|
||||
"Floating Canvas Controls": "أدوات التحكم العائمة في اللوحة",
|
||||
"Classic Layout": "المظهر الكلاسيكي",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "وضع عناصر التحكم وتبويبات العمل المفتوحة في شريط علوي موحد",
|
||||
"Comfy Layout": "مظهر مدمج",
|
||||
"Hide Junk": "إخفاء العناصر غير المرغوبة",
|
||||
"Default": "افتراضي",
|
||||
"Dock": "إرساء",
|
||||
"Hide": "إخفاء",
|
||||
"Enable Output Gallery Sidebar": "تمكين الشريط الجانبي لمعرض المخرجات"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Grid Columns Threshold",
|
||||
"Width Threshold for Queue Columns (px)": "Width Threshold for Queue Columns (px)",
|
||||
"Show Pending Count Only": "Show Pending Count Only",
|
||||
"If disabled, each queued job will have a separate individual card": "If disabled, each queued job will have a separate individual card",
|
||||
"Show Working Node Name": "Show Working Node Name",
|
||||
"Shows the name of the node which is currently in the process": "Shows the name of the node which is currently in the process",
|
||||
"Auto Clear Interrupted": "Auto Clear Interrupted",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Auto-clear cancelled & failed jobs on new generation",
|
||||
"Permanent Delete on Disk Deletion": "Permanent Delete on Disk Deletion",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)",
|
||||
"Hide Tab: {tab}": "Hide Tab: {tab}",
|
||||
"Assets": "Assets",
|
||||
"Nodes": "Nodes",
|
||||
"Models": "Models",
|
||||
"Workflows": "Workflows",
|
||||
"Apps": "Apps",
|
||||
"Templates": "Templates",
|
||||
"Override Stock History": "Override Stock History",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Replace the stock Job History sidebar with Comfy Queue",
|
||||
"Hide Graph Button": "Hide Graph Button",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Hide floating 'Graph' (Workflow/Node Map) button",
|
||||
"Hide Avatar": "Hide Avatar",
|
||||
"Floating Canvas Controls": "Floating Canvas Controls",
|
||||
"Classic Layout": "Classic Layout",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Places the controls and the open workflow tabs on a single unified top bar",
|
||||
"Comfy Layout": "Comfy Layout",
|
||||
"Hide Junk": "Hide Junk",
|
||||
"Default": "Default",
|
||||
"Dock": "Dock",
|
||||
"Hide": "Hide",
|
||||
"Enable Output Gallery Sidebar": "Enable Output Gallery Sidebar"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Umbral de columnas de la cola",
|
||||
"Width Threshold for Queue Columns (px)": "Ancho en píxeles para dividir la cola en varias columnas",
|
||||
"Show Pending Count Only": "Mostrar solo total en espera",
|
||||
"If disabled, each queued job will have a separate individual card": "Si se desactiva, cada tarea en cola tendrá una tarjeta individual",
|
||||
"Show Working Node Name": "Mostrar nombre del nodo en proceso",
|
||||
"Shows the name of the node which is currently in the process": "Muestra el nombre del nodo que se está procesando actualmente",
|
||||
"Auto Clear Interrupted": "Limpieza auto de interrumpidos",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Borrar automáticamente tareas canceladas y fallidas al iniciar una nueva generación",
|
||||
"Permanent Delete on Disk Deletion": "Eliminación permanente del disco",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Eliminar permanentemente archivos al borrarlos (sin pasar por la papelera)",
|
||||
"Hide Tab: {tab}": "Ocultar pestaña: {tab}",
|
||||
"Assets": "Recursos",
|
||||
"Nodes": "Nodos",
|
||||
"Models": "Modelos",
|
||||
"Workflows": "Flujos",
|
||||
"Apps": "Apps",
|
||||
"Templates": "Plantillas",
|
||||
"Override Stock History": "Reemplazar historial estándar",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Reemplaza la barra de historial estándar con Comfy Queue",
|
||||
"Hide Graph Button": "Ocultar botón 'Grafo'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Oculta el botón flotante 'Grafo' (mapa de nodos)",
|
||||
"Hide Avatar": "Ocultar avatar",
|
||||
"Floating Canvas Controls": "Controles flotantes del lienzo",
|
||||
"Classic Layout": "Diseño clásico",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Coloca los controles y las pestañas abiertas en una barra superior unificada",
|
||||
"Comfy Layout": "Diseño compacto",
|
||||
"Hide Junk": "Ocultar elementos innecesarios",
|
||||
"Default": "Por defecto",
|
||||
"Dock": "Acoplar",
|
||||
"Hide": "Ocultar",
|
||||
"Enable Output Gallery Sidebar": "Habilitar barra lateral de galería de salidas"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "آستانه ستونهای صف",
|
||||
"Width Threshold for Queue Columns (px)": "عرض بر حسب پیکسل برای تقسیم صف به چند ستون",
|
||||
"Show Pending Count Only": "فقط نمایش تعداد در انتظار",
|
||||
"If disabled, each queued job will have a separate individual card": "در صورت غیرفعال بودن، هر کار در صف یک کارت جداگانه خواهد داشت",
|
||||
"Show Working Node Name": "نمایش نام گره در حال پردازش",
|
||||
"Shows the name of the node which is currently in the process": "نام گرهی را که در حال حاضر پردازش میشود نشان میدهد",
|
||||
"Auto Clear Interrupted": "پاکسازی خودکار متوقفشدهها",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "پاک کردن خودکار کارهای لغو شده و ناموفق در تولید جدید",
|
||||
"Permanent Delete on Disk Deletion": "حذف دائمی از دیسک",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "حذف دائمی فایلها هنگام پاک کردن از دیسک (بدون انتقال به سطل بازیافت)",
|
||||
"Hide Tab: {tab}": "پنهان کردن برگه: {tab}",
|
||||
"Assets": "داراییها",
|
||||
"Nodes": "گرهها",
|
||||
"Models": "مدلها",
|
||||
"Workflows": "جریانهای کاری",
|
||||
"Apps": "برنامهها",
|
||||
"Templates": "الگوها",
|
||||
"Override Stock History": "جایگزینی تاریخچه پیشفرض",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "نوار کناری تاریخچه کارهای پیشفرض را با Comfy Queue جایگزین میکند",
|
||||
"Hide Graph Button": "پنهان کردن دکمه 'نمودار'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "دکمه شناور 'نمودار' (نقشه گرهها) را پنهان میکند",
|
||||
"Hide Avatar": "پنهان کردن آواتار",
|
||||
"Floating Canvas Controls": "کنترلهای شناور بوم",
|
||||
"Classic Layout": "طرحبندی کلاسیک",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "کنترلها و برگههای باز جریان کار را در یک نوار بالایی یکپارچه قرار میدهد",
|
||||
"Comfy Layout": "طرحبندی فشرده",
|
||||
"Hide Junk": "پنهان کردن موارد غیرضروری",
|
||||
"Default": "پیشفرض",
|
||||
"Dock": "اتصال",
|
||||
"Hide": "پنهان",
|
||||
"Enable Output Gallery Sidebar": "فعالسازی نوار کناری گالری خروجیها"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Seuil de colonnes",
|
||||
"Width Threshold for Queue Columns (px)": "Largeur en pixels pour diviser la file en plusieurs colonnes",
|
||||
"Show Pending Count Only": "Afficher uniquement le total en attente",
|
||||
"If disabled, each queued job will have a separate individual card": "Si désactivé, chaque tâche en file aura une carte individuelle",
|
||||
"Show Working Node Name": "Afficher le nom du nœud actif",
|
||||
"Shows the name of the node which is currently in the process": "Affiche le nom du nœud en cours de traitement",
|
||||
"Auto Clear Interrupted": "Nettoyage auto des interruptions",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Effacer automatiquement les tâches annulées et échouées lors d'une nouvelle génération",
|
||||
"Permanent Delete on Disk Deletion": "Suppression définitive du disque",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Supprimer définitivement les fichiers lors de la suppression (sans passer par la corbeille)",
|
||||
"Hide Tab: {tab}": "Masquer l'onglet : {tab}",
|
||||
"Assets": "Ressources",
|
||||
"Nodes": "Nœuds",
|
||||
"Models": "Modèles",
|
||||
"Workflows": "Workflows",
|
||||
"Apps": "Applications",
|
||||
"Templates": "Modèles",
|
||||
"Override Stock History": "Remplacer l'historique par défaut",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Remplace la barre latérale d'historique par défaut par Comfy Queue",
|
||||
"Hide Graph Button": "Masquer le bouton 'Graphe'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Masque le bouton flottant 'Graphe' (carte des nœuds)",
|
||||
"Hide Avatar": "Masquer l'avatar",
|
||||
"Floating Canvas Controls": "Contrôles flottants du canevas",
|
||||
"Classic Layout": "Disposition classique",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Regroupe les contrôles et les onglets ouverts dans une barre supérieure unique",
|
||||
"Comfy Layout": "Disposition compacte",
|
||||
"Hide Junk": "Masquer les éléments inutiles",
|
||||
"Default": "Par défaut",
|
||||
"Dock": "Ancrer",
|
||||
"Hide": "Masquer",
|
||||
"Enable Output Gallery Sidebar": "Activer la barre latérale de la galerie de sorties"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "סף עמודות תור",
|
||||
"Width Threshold for Queue Columns (px)": "רוחב בפיקסלים לחלוקת התור לעמודות מרובות",
|
||||
"Show Pending Count Only": "הצג רק ספירת ממתינים",
|
||||
"If disabled, each queued job will have a separate individual card": "אם מושבת, לכל משימה בתור יהיה כרטיס נפרד",
|
||||
"Show Working Node Name": "הצג שם צומת פעיל",
|
||||
"Shows the name of the node which is currently in the process": "מציג את שם הצומת המעובד כעת",
|
||||
"Auto Clear Interrupted": "ניקוי אוטומטי של משימות שהופסקו",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "נקה אוטומטית משימות שבוטלו או נכשלו בעת יצירה חדשה",
|
||||
"Permanent Delete on Disk Deletion": "מחיקה לצמיתות מהדיסק",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "מחק קבצים לצמיתות בעת מחיקה (עוקף את סל המיחזור)",
|
||||
"Hide Tab: {tab}": "הסתר לשונית: {tab}",
|
||||
"Assets": "נכסים",
|
||||
"Nodes": "צמתים",
|
||||
"Models": "מודלים",
|
||||
"Workflows": "תהליכי עבודה",
|
||||
"Apps": "יישומים",
|
||||
"Templates": "תבניות",
|
||||
"Override Stock History": "החלף היסטוריית ברירת מחדל",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "מחליף את סרגל הצד של היסטוריית העבודות הרגילה ב-Comfy Queue",
|
||||
"Hide Graph Button": "הסתר כפתור 'גרף'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "מסתיר את הכפתור הצף 'גרף' (מפת הצמתים)",
|
||||
"Hide Avatar": "הסתר אווטאר",
|
||||
"Floating Canvas Controls": "פקדי לוח צפים",
|
||||
"Classic Layout": "פריסה קלאסית",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "ממקם את הפקדים ואת לשוניות תהליך העבודה הפתוחות בסרגל עליון מאוחד",
|
||||
"Comfy Layout": "פריסה קומפקטית",
|
||||
"Hide Junk": "הסתר פריטים מיותרים",
|
||||
"Default": "ברירת מחדל",
|
||||
"Dock": "הצמד",
|
||||
"Hide": "הסתר",
|
||||
"Enable Output Gallery Sidebar": "הפעל סרגל צד של גלריית תוצרים"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Soglia colonne coda",
|
||||
"Width Threshold for Queue Columns (px)": "Larghezza in pixel per dividere la coda in più colonne",
|
||||
"Show Pending Count Only": "Mostra solo conteggio in attesa",
|
||||
"If disabled, each queued job will have a separate individual card": "Se disabilitato, ogni task in coda avrà una scheda separata",
|
||||
"Show Working Node Name": "Mostra nome nodo in elaborazione",
|
||||
"Shows the name of the node which is currently in the process": "Mostra il nome del nodo attualmente in elaborazione",
|
||||
"Auto Clear Interrupted": "Pulizia automatica interrotti",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Cancella automaticamente i task annullati e falliti a ogni nuova generazione",
|
||||
"Permanent Delete on Disk Deletion": "Eliminazione definitiva dal disco",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Elimina definitivamente i file al momento della cancellazione (senza passare dal cestino)",
|
||||
"Hide Tab: {tab}": "Nascondi scheda: {tab}",
|
||||
"Assets": "Risorse",
|
||||
"Nodes": "Nodi",
|
||||
"Models": "Modelli",
|
||||
"Workflows": "Flussi di lavoro",
|
||||
"Apps": "Applicazioni",
|
||||
"Templates": "Modelli predefiniti",
|
||||
"Override Stock History": "Sostituisci cronologia standard",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Sostituisce la barra laterale della cronologia standard con Comfy Queue",
|
||||
"Hide Graph Button": "Nascondi pulsante 'Grafo'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Nasconde il pulsante mobile 'Grafo' (mappa dei nodi)",
|
||||
"Hide Avatar": "Nascondi avatar",
|
||||
"Floating Canvas Controls": "Controlli mobili dell'area di lavoro",
|
||||
"Classic Layout": "Layout classico",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Posiziona i controlli e le schede aperte su una barra superiore unificata",
|
||||
"Comfy Layout": "Layout compatto",
|
||||
"Hide Junk": "Nascondi elementi inutili",
|
||||
"Default": "Predefinito",
|
||||
"Dock": "Aggancia",
|
||||
"Hide": "Nascondi",
|
||||
"Enable Output Gallery Sidebar": "Abilita barra laterale galleria di output"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "列分割の幅しきい値",
|
||||
"Width Threshold for Queue Columns (px)": "キューを複数列に分割する幅のしきい値 (px)",
|
||||
"Show Pending Count Only": "待機数のみ表示",
|
||||
"If disabled, each queued job will have a separate individual card": "無効にすると、キュー内の各タスクが個別のカードとして表示されます",
|
||||
"Show Working Node Name": "処理中のノード名を表示",
|
||||
"Shows the name of the node which is currently in the process": "現在処理されているノードの名前を表示します",
|
||||
"Auto Clear Interrupted": "中断タスクの自動クリア",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "新規生成時にキャンセルおよび失敗したタスクを自動的に消去します",
|
||||
"Permanent Delete on Disk Deletion": "ディスクから完全消去",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "ディスクからの削除時にゴミ箱を経由せず完全に消去します",
|
||||
"Hide Tab: {tab}": "タブを非表示: {tab}",
|
||||
"Assets": "アセット",
|
||||
"Nodes": "ノード",
|
||||
"Models": "モデル",
|
||||
"Workflows": "ワークフロー",
|
||||
"Apps": "アプリ",
|
||||
"Templates": "テンプレート",
|
||||
"Override Stock History": "標準の履歴を置き換える",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "標準の履歴サイドバーを Comfy Queue に置き換えます",
|
||||
"Hide Graph Button": "「グラフ」ボタンを非表示",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "フローティングの「グラフ」(ノードマップ) ボタンを非表示にします",
|
||||
"Hide Avatar": "アバターを非表示",
|
||||
"Floating Canvas Controls": "フローティングキャンバス操作",
|
||||
"Classic Layout": "クラシックレイアウト",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "操作ボタンと開いているワークフロータブを統合された単一の上部バーに配置します",
|
||||
"Comfy Layout": "コンパクトレイアウト",
|
||||
"Hide Junk": "不要な項目を非表示",
|
||||
"Default": "デフォルト",
|
||||
"Dock": "ドック",
|
||||
"Hide": "非表示",
|
||||
"Enable Output Gallery Sidebar": "出力ギャラリーのサイドバーを有効化"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "열 분할 너비 기준값",
|
||||
"Width Threshold for Queue Columns (px)": "대기열을 여러 열로 나눌 너비 기준값 (px)",
|
||||
"Show Pending Count Only": "대기 수량만 표시",
|
||||
"If disabled, each queued job will have a separate individual card": "비활성화 시 대기열의 각 작업이 개별 카드로 표시됩니다",
|
||||
"Show Working Node Name": "진행 중인 노드 이름 표시",
|
||||
"Shows the name of the node which is currently in the process": "현재 처리 중인 노드의 이름을 표시합니다",
|
||||
"Auto Clear Interrupted": "중단된 작업 자동 삭제",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "새 생성 시 취소되거나 실패한 작업을 자동으로 삭제합니다",
|
||||
"Permanent Delete on Disk Deletion": "디스크에서 완전 삭제",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "디스크에서 삭제 시 휴지통을 거치지 않고 영구 삭제합니다",
|
||||
"Hide Tab: {tab}": "탭 숨기기: {tab}",
|
||||
"Assets": "에셋",
|
||||
"Nodes": "노드",
|
||||
"Models": "모델",
|
||||
"Workflows": "워크플로",
|
||||
"Apps": "앱",
|
||||
"Templates": "템플릿",
|
||||
"Override Stock History": "기본 작업 기록 대체",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "기본 작업 기록 사이드바를 Comfy Queue로 대체합니다",
|
||||
"Hide Graph Button": "'그래프' 버튼 숨기기",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "플로팅 '그래프'(워크플로 맵) 버튼을 숨깁니다",
|
||||
"Hide Avatar": "아바타 숨기기",
|
||||
"Floating Canvas Controls": "플로팅 캔버스 제어 도구",
|
||||
"Classic Layout": "클래식 레이아웃",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "제어 도구와 열린 워크플로 탭을 하나의 상단 바로 통합합니다",
|
||||
"Comfy Layout": "컴팩트 레이아웃",
|
||||
"Hide Junk": "불필요한 항목 숨기기",
|
||||
"Default": "기본값",
|
||||
"Dock": "도킹",
|
||||
"Hide": "숨기기",
|
||||
"Enable Output Gallery Sidebar": "출력 갤러리 사이드바 활성화"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Limite de colunas da fila",
|
||||
"Width Threshold for Queue Columns (px)": "Largura em pixels para dividir a fila em várias colunas",
|
||||
"Show Pending Count Only": "Mostrar apenas contagem pendente",
|
||||
"If disabled, each queued job will have a separate individual card": "Se desativado, cada tarefa na fila terá um cartão individual",
|
||||
"Show Working Node Name": "Mostrar nome do nó em execução",
|
||||
"Shows the name of the node which is currently in the process": "Mostra o nome do nó que está sendo processado no momento",
|
||||
"Auto Clear Interrupted": "Limpeza automática de interrompidos",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Limpar automaticamente tarefas canceladas e com falha ao iniciar nova geração",
|
||||
"Permanent Delete on Disk Deletion": "Exclusão permanente do disco",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Excluir arquivos permanentemente (sem passar pela Lixeira)",
|
||||
"Hide Tab: {tab}": "Ocultar aba: {tab}",
|
||||
"Assets": "Recursos",
|
||||
"Nodes": "Nós",
|
||||
"Models": "Modelos",
|
||||
"Workflows": "Fluxos de trabalho",
|
||||
"Apps": "Aplicativos",
|
||||
"Templates": "Modelos prévios",
|
||||
"Override Stock History": "Substituir histórico padrão",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Substitui a barra lateral de histórico padrão pelo Comfy Queue",
|
||||
"Hide Graph Button": "Ocultar botão 'Grafo'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Oculta o botão flutuante 'Grafo' (mapa de nós)",
|
||||
"Hide Avatar": "Ocultar avatar",
|
||||
"Floating Canvas Controls": "Controles flutuantes da tela",
|
||||
"Classic Layout": "Layout clássico",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Posiciona os controles e as abas abertas em uma barra superior unificada",
|
||||
"Comfy Layout": "Layout compacto",
|
||||
"Hide Junk": "Ocultar itens desnecessários",
|
||||
"Default": "Padrão",
|
||||
"Dock": "Fixar",
|
||||
"Hide": "Ocultar",
|
||||
"Enable Output Gallery Sidebar": "Ativar barra lateral da galeria de saídas"
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Порог колонок очереди",
|
||||
"Width Threshold for Queue Columns (px)": "Ширина в пикселях для разделения очереди на несколько колонок",
|
||||
"Show Pending Count Only": "Только количество в очереди",
|
||||
"If disabled, each queued job will have a separate individual card": "Если выключено, каждая задача в очереди будет отдельной карточкой",
|
||||
"Show Working Node Name": "Имя выполняющейся ноды",
|
||||
"Shows the name of the node which is currently in the process": "Показывать имя ноды, выполняющейся в данный момент",
|
||||
"Auto Clear Interrupted": "Автоочистка отменённых",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Автоматически очищать отменённые и неудачные задачи при новой генерации",
|
||||
"Permanent Delete on Disk Deletion": "Безвозвратное удаление с диска",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Удалять файлы навсегда при удалении с диска (минуя корзину)",
|
||||
"Hide Tab: {tab}": "Скрыть вкладку: {tab}",
|
||||
"Assets": "Ресурсы",
|
||||
"Nodes": "Ноды",
|
||||
"Models": "Модели",
|
||||
"Workflows": "Рабочие процессы",
|
||||
"Apps": "Приложения",
|
||||
"Templates": "Шаблоны",
|
||||
"Override Stock History": "Замена стандартной истории",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Заменить стандартную панель истории на Comfy Queue",
|
||||
"Hide Graph Button": "Скрыть кнопку 'Граф'",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Скрыть плавающую кнопку 'Граф' (карта нод)",
|
||||
"Hide Avatar": "Скрыть аватар",
|
||||
"Floating Canvas Controls": "Плавающие элементы управления",
|
||||
"Classic Layout": "Классический интерфейс",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Разместить элементы управления и открытые вкладки на единой верхней панели",
|
||||
"Comfy Layout": "Компактный интерфейс",
|
||||
"Classic Layout": "Компактный интерфейс",
|
||||
"Hide Junk": "Скрыть лишнее",
|
||||
"Default": "По умолчанию",
|
||||
"Dock": "Закрепить",
|
||||
"Hide": "Скрыть",
|
||||
"Enable Output Gallery Sidebar": "Включить боковую панель галереи результатов"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "Kuyruk sütun genişliği eşiği",
|
||||
"Width Threshold for Queue Columns (px)": "Kuyruğu birden fazla sütuna bölmek için piksel genişliği",
|
||||
"Show Pending Count Only": "Yalnızca bekleyen sayısını göster",
|
||||
"If disabled, each queued job will have a separate individual card": "Devre dışı bırakılırsa kuyruktaki her görev ayrı bir karta sahip olur",
|
||||
"Show Working Node Name": "Çalışan düğüm adını göster",
|
||||
"Shows the name of the node which is currently in the process": "Şu anda işlenmekte olan düğümün adını gösterir",
|
||||
"Auto Clear Interrupted": "Kesilenleri otomatik temizle",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "Yeni üretimde iptal edilen ve başarısız olan görevleri otomatik olarak temizle",
|
||||
"Permanent Delete on Disk Deletion": "Diskten kalıcı silme",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "Diskten silerken dosyaları kalıcı olarak sil (Geri Dönüşüm Kutusu'nu atlar)",
|
||||
"Hide Tab: {tab}": "Sekmeyi gizle: {tab}",
|
||||
"Assets": "Varlıklar",
|
||||
"Nodes": "Düğümler",
|
||||
"Models": "Modeller",
|
||||
"Workflows": "İş Akışları",
|
||||
"Apps": "Uygulamalar",
|
||||
"Templates": "Şablonlar",
|
||||
"Override Stock History": "Varsayılan geçmişi değiştir",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "Varsayılan Görev Geçmişi kenar çubuğunu Comfy Queue ile değiştirir",
|
||||
"Hide Graph Button": "'Grafik' düğmesini gizle",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "Kayan 'Grafik' (İş akışı haritası) düğmesini gizler",
|
||||
"Hide Avatar": "Avatarı gizle",
|
||||
"Floating Canvas Controls": "Kayan tuval kontrolleri",
|
||||
"Classic Layout": "Klasik düzen",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "Kontrolleri ve açık iş akışı sekmelerini tek bir birleşik üst çubukta toplar",
|
||||
"Comfy Layout": "Kompakt Düzen",
|
||||
"Hide Junk": "Gereksiz Öğeleri Gizle",
|
||||
"Default": "Varsayılan",
|
||||
"Dock": "Sabitle",
|
||||
"Hide": "Gizle",
|
||||
"Enable Output Gallery Sidebar": "Çıktı Galerisi Kenar Çubuğunu Etkinleştir"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "隊列欄寬閾值",
|
||||
"Width Threshold for Queue Columns (px)": "隊列顯示多欄的寬度閾值 (像素)",
|
||||
"Show Pending Count Only": "僅顯示等待數量",
|
||||
"If disabled, each queued job will have a separate individual card": "若停用,每個排隊任務將顯示為獨立卡片",
|
||||
"Show Working Node Name": "顯示執行中節點名稱",
|
||||
"Shows the name of the node which is currently in the process": "顯示目前正在處理的節點名稱",
|
||||
"Auto Clear Interrupted": "自動清除中斷任務",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "新生成時自動清除已取消與失敗的任務",
|
||||
"Permanent Delete on Disk Deletion": "從磁碟永久刪除",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "從磁碟刪除時永久刪除檔案 (略過資源回收筒)",
|
||||
"Hide Tab: {tab}": "隱藏標籤頁: {tab}",
|
||||
"Assets": "資產",
|
||||
"Nodes": "節點",
|
||||
"Models": "模型",
|
||||
"Workflows": "工作流",
|
||||
"Apps": "應用",
|
||||
"Templates": "範本",
|
||||
"Override Stock History": "取代原生任務歷史",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "使用 Comfy Queue 取代原生任務歷史側邊欄",
|
||||
"Hide Graph Button": "隱藏「圖」按鈕",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "隱藏懸浮的「圖」(工作流/節點圖) 按鈕",
|
||||
"Hide Avatar": "隱藏頭像",
|
||||
"Floating Canvas Controls": "懸浮畫布控制項",
|
||||
"Classic Layout": "經典版面配置",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "將控制項與已開啟的工作流標籤頁整合於統一的頂端列",
|
||||
"Comfy Layout": "緊湊版面配置",
|
||||
"Hide Junk": "隱藏雜項",
|
||||
"Default": "預設",
|
||||
"Dock": "停靠",
|
||||
"Hide": "隱藏",
|
||||
"Enable Output Gallery Sidebar": "啟用輸出圖庫側邊欄"
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Grid Columns Threshold": "队列列宽阈值",
|
||||
"Width Threshold for Queue Columns (px)": "队列显示多列的宽度阈值 (像素)",
|
||||
"Show Pending Count Only": "仅显示等待数量",
|
||||
"If disabled, each queued job will have a separate individual card": "如果禁用,每个排队的任务将拥有单独的卡片",
|
||||
"Show Working Node Name": "显示正在执行的节点名称",
|
||||
"Shows the name of the node which is currently in the process": "显示当前正在处理的节点名称",
|
||||
"Auto Clear Interrupted": "自动清除中断任务",
|
||||
"Auto-clear cancelled & failed jobs on new generation": "新生成时自动清除已取消和失败的任务",
|
||||
"Permanent Delete on Disk Deletion": "从磁盘永久删除",
|
||||
"Permanently delete files on disk deletion (bypasses Recycle Bin / Trash)": "从磁盘删除时永久删除文件 (绕过回收站)",
|
||||
"Hide Tab: {tab}": "隐藏标签页: {tab}",
|
||||
"Assets": "资产",
|
||||
"Nodes": "节点",
|
||||
"Models": "模型",
|
||||
"Workflows": "工作流",
|
||||
"Apps": "应用",
|
||||
"Templates": "模板",
|
||||
"Override Stock History": "替换原生任务历史",
|
||||
"Replace the stock Job History sidebar with Comfy Queue": "使用 Comfy Queue 替换原生任务历史侧边栏",
|
||||
"Hide Graph Button": "隐藏'图'按钮",
|
||||
"Hide floating 'Graph' (Workflow/Node Map) button": "隐藏悬浮的'图' (工作流/节点图) 按钮",
|
||||
"Hide Avatar": "隐藏头像",
|
||||
"Floating Canvas Controls": "悬浮画布控件",
|
||||
"Classic Layout": "经典布局",
|
||||
"Places the controls and the open workflow tabs on a single unified top bar": "将控件与已打开的工作流标签页整合在统一的顶部栏",
|
||||
"Comfy Layout": "紧凑布局",
|
||||
"Hide Junk": "隐藏杂项",
|
||||
"Default": "默认",
|
||||
"Dock": "停靠",
|
||||
"Hide": "隐藏",
|
||||
"Enable Output Gallery Sidebar": "启用输出图库侧边栏"
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
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";
|
||||
import { updateActiveComparisonPreview, isRuntimePreviewEnabled, focusRuntimePreviewTarget, getActiveComparisonViewer, showFullscreenPreview } from "../utils/comparison.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
|
||||
export function setupExecutionTracker(onTargetedProgressUpdate) {
|
||||
const onStatus = () => syncQueue();
|
||||
@@ -17,7 +18,7 @@ export function setupExecutionTracker(onTargetedProgressUpdate) {
|
||||
};
|
||||
|
||||
const onExecutionStart = (e) => {
|
||||
const autoClear = app.ui?.settings?.getSettingValue?.("Comfy Sidebar.Auto Clear Interrupted") ?? false;
|
||||
const autoClear = getSetting(SettingIds.AUTO_CLEAR_INTERRUPTED, false);
|
||||
if (autoClear) {
|
||||
clearCancelledOrFailed();
|
||||
}
|
||||
@@ -70,7 +71,7 @@ export function setupExecutionTracker(onTargetedProgressUpdate) {
|
||||
|
||||
const onExecuting = (e) => {
|
||||
const nodeId = e.detail;
|
||||
const showWorkingNode = app.ui?.settings?.getSettingValue?.("Comfy Sidebar.Show Working Node Name") ?? true;
|
||||
const showWorkingNode = getSetting(SettingIds.SHOW_WORKING_NODE_NAME, true);
|
||||
const activePid = store.ui.currentlyActivePromptId;
|
||||
|
||||
if (activePid && store.hasPrompt(activePid)) {
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -25,7 +25,8 @@ export function normalizeQueueItem(p, defaultIndex = 0) {
|
||||
pid,
|
||||
seq,
|
||||
workflow: parseWorkflow(rawWorkflow),
|
||||
outputs
|
||||
outputs,
|
||||
promptGraph: Array.isArray(p) ? (p[2] || null) : (p.prompt || null)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { api } from "/scripts/api.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
import { store } from "../core/store.js";
|
||||
import { PromptStatus, StoreEvents } from "../core/constants.js";
|
||||
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 = {};
|
||||
@@ -18,6 +19,54 @@ function extractNodeTitles(outputs, workflow, promptGraph = null) {
|
||||
return titles;
|
||||
}
|
||||
|
||||
export function extractPromptOutputs(outputs, workflow, promptGraph = null) {
|
||||
return {
|
||||
images: getPrimaryOutputImages(outputs, workflow),
|
||||
texts: findTextsInOutputs(outputs, workflow),
|
||||
nodeTitles: extractNodeTitles(outputs, workflow, promptGraph)
|
||||
};
|
||||
}
|
||||
|
||||
async function updatePromptSearchTexts(entries) {
|
||||
const pending = entries.filter(({ pid, promptGraph }) => {
|
||||
const state = store.getPrompt(pid);
|
||||
return promptGraph && typeof promptGraph === "object" && state && state.promptSearchText === null;
|
||||
});
|
||||
if (pending.length === 0) return;
|
||||
|
||||
// Keep each request comfortably below aiohttp's default 1 MB body limit.
|
||||
const batches = [];
|
||||
let batch = [];
|
||||
let batchSize = 0;
|
||||
for (const entry of pending) {
|
||||
const itemSize = JSON.stringify(entry).length * 3; // Conservative UTF-8 byte estimate
|
||||
if (batch.length > 0 && (batch.length >= 32 || batchSize + itemSize > 512 * 1024)) {
|
||||
batches.push(batch);
|
||||
batch = [];
|
||||
batchSize = 0;
|
||||
}
|
||||
batch.push(entry);
|
||||
batchSize += itemSize;
|
||||
}
|
||||
if (batch.length > 0) batches.push(batch);
|
||||
|
||||
for (const prompts of batches) {
|
||||
try {
|
||||
const response = await api.fetchApi("/comfy-sidebar/queue/prompt-search", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ prompts: prompts.map(({ pid, promptGraph }) => ({ pid, prompt: promptGraph })) })
|
||||
});
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
const data = await response.json();
|
||||
for (const [pid, text] of Object.entries(data.texts || {})) {
|
||||
if (store.hasPrompt(pid)) store.updatePrompt(pid, { promptSearchText: String(text || "") });
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("Comfy Sidebar: Failed to extract Queue prompt search text", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function syncQueue() {
|
||||
try {
|
||||
const q = await api.getQueue();
|
||||
@@ -26,29 +75,29 @@ export async function syncQueue() {
|
||||
|
||||
const runningIds = new Set();
|
||||
const pendingIds = new Set();
|
||||
const promptGraphs = [];
|
||||
|
||||
runningList.forEach((raw, idx) => {
|
||||
const item = normalizeQueueItem(raw, idx);
|
||||
if (!item.pid) return;
|
||||
|
||||
runningIds.add(item.pid);
|
||||
if (item.promptGraph) promptGraphs.push({ pid: item.pid, promptGraph: item.promptGraph });
|
||||
store.setActivePromptId(item.pid);
|
||||
|
||||
const existing = store.getPrompt(item.pid);
|
||||
const activeWorkflow = item.workflow || (app.graph?.serialize?.() || null);
|
||||
const titles = extractNodeTitles(item.outputs, activeWorkflow);
|
||||
|
||||
if (!existing) {
|
||||
const seq = store.nextSequence();
|
||||
const images = getPrimaryOutputImages(item.outputs, activeWorkflow);
|
||||
const texts = findTextsInOutputs(item.outputs, activeWorkflow);
|
||||
const { images, texts, nodeTitles } = extractPromptOutputs(item.outputs, activeWorkflow);
|
||||
|
||||
const newState = createPromptState(item.pid, {
|
||||
status: PromptStatus.ACTIVE,
|
||||
images,
|
||||
texts,
|
||||
nodeOutputs: item.outputs,
|
||||
nodeTitles: titles,
|
||||
nodeTitles,
|
||||
progress: 0,
|
||||
progressText: "Processing...",
|
||||
timestamp: seq,
|
||||
@@ -57,6 +106,7 @@ export async function syncQueue() {
|
||||
});
|
||||
store.setPrompt(item.pid, newState);
|
||||
} else {
|
||||
const titles = extractNodeTitles(item.outputs, activeWorkflow);
|
||||
if (existing.status !== PromptStatus.ACTIVE) {
|
||||
activatePrompt(existing, { workflow: activeWorkflow, nodeTitles: titles });
|
||||
store.updatePrompt(item.pid, existing);
|
||||
@@ -76,6 +126,7 @@ export async function syncQueue() {
|
||||
normalizedPending.forEach((item, index) => {
|
||||
const number = index + 1;
|
||||
pendingIds.add(item.pid);
|
||||
if (item.promptGraph) promptGraphs.push({ pid: item.pid, promptGraph: item.promptGraph });
|
||||
|
||||
const existing = store.getPrompt(item.pid);
|
||||
if (!existing) {
|
||||
@@ -100,6 +151,8 @@ export async function syncQueue() {
|
||||
}
|
||||
});
|
||||
|
||||
await updatePromptSearchTexts(promptGraphs);
|
||||
|
||||
for (const prompt of store.getAllPrompts()) {
|
||||
if (prompt.status === PromptStatus.PENDING && !pendingIds.has(prompt.pid)) {
|
||||
store.deletePrompt(prompt.pid);
|
||||
@@ -145,10 +198,10 @@ export async function concludeRun(pid, fallbackStatus = PromptStatus.CANCELLED)
|
||||
state.status = norm.status;
|
||||
|
||||
const promptGraph = hItem[key].prompt?.[2] || null;
|
||||
const titles = extractNodeTitles(state.nodeOutputs, state.workflow, promptGraph);
|
||||
await updatePromptSearchTexts([{ pid: key, promptGraph }]);
|
||||
const { images: primaryImgs, texts: fetchedTexts, nodeTitles: titles } = extractPromptOutputs(norm.outputs, state.workflow, promptGraph);
|
||||
Object.assign(state.nodeTitles, titles);
|
||||
|
||||
const primaryImgs = getPrimaryOutputImages(norm.outputs, state.workflow);
|
||||
const hasActualSavedOutputs = primaryImgs.some(img => !img.isFallback);
|
||||
|
||||
// If cancelled while sampling, do NOT overwrite with older nodes; keep the exact step preview!
|
||||
@@ -158,7 +211,6 @@ export async function concludeRun(pid, fallbackStatus = PromptStatus.CANCELLED)
|
||||
}
|
||||
}
|
||||
|
||||
const fetchedTexts = findTextsInOutputs(norm.outputs, state.workflow);
|
||||
if (fetchedTexts.length > 0) state.texts = fetchedTexts;
|
||||
break;
|
||||
}
|
||||
@@ -173,7 +225,7 @@ export async function concludeRun(pid, fallbackStatus = PromptStatus.CANCELLED)
|
||||
}
|
||||
}
|
||||
|
||||
const maxItems = app.ui?.settings?.getSettingValue?.("Comfy.Queue.MaxHistoryItems") ?? 64;
|
||||
const maxItems = getSetting(SettingIds.MAX_HISTORY_ITEMS, 64);
|
||||
store.pruneHistory(maxItems);
|
||||
store.updatePrompt(key, state);
|
||||
syncQueue();
|
||||
@@ -203,10 +255,21 @@ 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 = getPrimaryOutputImages(item.outputs, item.workflow);
|
||||
const texts = findTextsInOutputs(item.outputs, item.workflow);
|
||||
const titles = extractNodeTitles(item.outputs, item.workflow, promptGraph);
|
||||
const { images, texts, nodeTitles: titles } = extractPromptOutputs(item.outputs, item.workflow, promptGraph);
|
||||
|
||||
if (images.length === 0 && texts.length === 0 && item.status === PromptStatus.COMPLETED) {
|
||||
return;
|
||||
@@ -238,8 +301,7 @@ export async function initSessionAndHistory() {
|
||||
return;
|
||||
}
|
||||
|
||||
const seq = store.nextSequence();
|
||||
const newState = createPromptState(item.pid, {
|
||||
const stateInit = {
|
||||
status: item.status,
|
||||
images,
|
||||
texts,
|
||||
@@ -247,13 +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() }));
|
||||
});
|
||||
|
||||
const maxItems = app.ui?.settings?.getSettingValue?.("Comfy.Queue.MaxHistoryItems") ?? 64;
|
||||
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 })));
|
||||
|
||||
store.pruneHistory(maxItems);
|
||||
await syncQueue();
|
||||
} catch (err) {
|
||||
@@ -322,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,82 @@ import { app } from "/scripts/app.js";
|
||||
import { SettingIds } from "./core/constants.js";
|
||||
import { injectStyles } from "./utils/styles.js";
|
||||
import { setupDragAndDrop } from "./utils/dragdrop.js";
|
||||
import { setupLatinHotkeys } from "./utils/latinHotkeys.js";
|
||||
import { setupNewWorkflowQuickPicker } from "./utils/newWorkflowPicker.js";
|
||||
import { renumberNodesTopologically, setManualNodeId } from "./utils/nodeRenumber.js";
|
||||
import { findOurSidebarButton, applySidebarOverride } from "./comfy/adapter.js";
|
||||
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";
|
||||
import { initI18n, t } from "./core/i18n.js";
|
||||
import { initI18n, t, setupLocaleWatcher, onLocaleChange } from "./core/i18n.js";
|
||||
import { updateCardProgressTargeted, cardPool } from "./ui/cardRenderer.js";
|
||||
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 = [];
|
||||
|
||||
function setupKeydownShortcuts() {
|
||||
activeKeydownHandler = (e) => {
|
||||
const activeEl = document.activeElement;
|
||||
if (activeEl && (
|
||||
activeEl.tagName === "INPUT" ||
|
||||
activeEl.tagName === "TEXTAREA" ||
|
||||
activeEl.isContentEditable ||
|
||||
activeEl.tagName === "SELECT"
|
||||
)) return;
|
||||
|
||||
// Ctrl+Q / Cmd+Q: Toggle Ignore Selected Node
|
||||
if (e.key.toLowerCase() === "q" && (e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
toggleIgnoreActiveNode(() => renderSidebar());
|
||||
}
|
||||
|
||||
// Alt+R: Renumber all nodes in execution order
|
||||
if (e.key.toLowerCase() === "r" && e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
renumberNodesTopologically();
|
||||
}
|
||||
};
|
||||
|
||||
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,
|
||||
@@ -47,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
|
||||
@@ -130,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"),
|
||||
@@ -141,6 +202,14 @@ function registerSettings() {
|
||||
}
|
||||
});
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: SettingIds.LATIN_HOTKEYS,
|
||||
name: t("Fix non-ASCII keybinds (hotkeys on any keyboard layout)"),
|
||||
tooltip: t("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."),
|
||||
type: "boolean",
|
||||
defaultValue: true
|
||||
});
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: SettingIds.CLASSIC_LAYOUT,
|
||||
name: t("Places the controls and the open workflow tabs on a single unified top bar"),
|
||||
@@ -152,104 +221,14 @@ function registerSettings() {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setupSettingsDialogObserver() {
|
||||
const targetTexts = [
|
||||
"Grid Columns Threshold",
|
||||
"Show Pending Count Only",
|
||||
"Show Working Node Name",
|
||||
"Auto Clear Interrupted",
|
||||
"Permanent Delete on Disk Deletion",
|
||||
"Hide Junk",
|
||||
"Override Stock History",
|
||||
"Hide Graph Button",
|
||||
"Hide Avatar",
|
||||
"Floating Canvas Controls",
|
||||
"Classic Layout",
|
||||
"Comfy Layout",
|
||||
"Default",
|
||||
"Dock",
|
||||
"Hide"
|
||||
];
|
||||
|
||||
const translateDOM = (rootEl) => {
|
||||
if (!rootEl) return;
|
||||
const walker = document.createTreeWalker(
|
||||
rootEl,
|
||||
NodeFilter.SHOW_TEXT,
|
||||
{
|
||||
acceptNode(node) {
|
||||
const text = node.nodeValue?.trim();
|
||||
return targetTexts.includes(text) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const nodesToTranslate = [];
|
||||
while (walker.nextNode()) {
|
||||
nodesToTranslate.push(walker.currentNode);
|
||||
}
|
||||
|
||||
for (const textNode of nodesToTranslate) {
|
||||
const raw = textNode.nodeValue.trim();
|
||||
const translated = t(raw);
|
||||
if (translated && translated !== raw) {
|
||||
textNode.nodeValue = textNode.nodeValue.replace(raw, translated);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
// 1. Translate headers and selected value inside the Settings dialog
|
||||
const dialog = document.querySelector('.p-dialog, .comfy-settings-dialog, [role="dialog"]');
|
||||
if (dialog) {
|
||||
translateDOM(dialog);
|
||||
}
|
||||
|
||||
// 2. Translate dropdown popup menu items (floated directly on document.body)
|
||||
const overlay = document.querySelector('.p-select-overlay, .p-dropdown-panel, .p-select-list, [data-pc-name="selectoverlay"]');
|
||||
if (overlay) {
|
||||
translateDOM(overlay);
|
||||
}
|
||||
app.ui.settings.addSetting({
|
||||
id: SettingIds.QUICK_WORKFLOW_PICKER,
|
||||
name: t("Quick Workflow Picker"),
|
||||
tooltip: t("Show quick workflow picker when creating a new blank workflow"),
|
||||
type: "boolean",
|
||||
defaultValue: true
|
||||
});
|
||||
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
return () => observer.disconnect();
|
||||
}
|
||||
|
||||
function setupKeydownShortcuts() {
|
||||
activeKeydownHandler = (e) => {
|
||||
const activeEl = document.activeElement;
|
||||
if (activeEl && (
|
||||
activeEl.tagName === "INPUT" ||
|
||||
activeEl.tagName === "TEXTAREA" ||
|
||||
activeEl.isContentEditable ||
|
||||
activeEl.tagName === "SELECT"
|
||||
)) return;
|
||||
|
||||
if (e.key.toLowerCase() === "q" && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const ourBtn = findOurSidebarButton();
|
||||
if (ourBtn) ourBtn.click();
|
||||
}
|
||||
|
||||
if (e.key.toLowerCase() === "q" && (e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
toggleIgnoreActiveNode(() => renderSidebar());
|
||||
}
|
||||
|
||||
// Alt+R: Renumber all nodes in execution order
|
||||
if (e.key.toLowerCase() === "r" && e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
renumberNodesTopologically();
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener("keydown", activeKeydownHandler, true);
|
||||
}
|
||||
|
||||
function setupWorkflowTabsPositionWatcher() {
|
||||
@@ -259,15 +238,11 @@ function setupWorkflowTabsPositionWatcher() {
|
||||
const checkAndDisableIfSidebar = (val) => {
|
||||
if (isSyncing) return;
|
||||
if (val === "Sidebar") {
|
||||
const isClassicEnabled = app.ui?.settings?.getSettingValue(SettingIds.CLASSIC_LAYOUT) ?? false;
|
||||
const isClassicEnabled = getSetting(SettingIds.CLASSIC_LAYOUT, false);
|
||||
if (isClassicEnabled) {
|
||||
isSyncing = true;
|
||||
try {
|
||||
if (app.extensionManager?.setting) {
|
||||
try { app.extensionManager.setting.set(SettingIds.CLASSIC_LAYOUT, false); } catch (e) {}
|
||||
} else if (app.ui?.settings) {
|
||||
try { app.ui.settings.setSettingValue(SettingIds.CLASSIC_LAYOUT, false); } catch (e) {}
|
||||
}
|
||||
setSetting(SettingIds.CLASSIC_LAYOUT, false);
|
||||
applyClassicLayout(false, false);
|
||||
} finally {
|
||||
isSyncing = false;
|
||||
@@ -278,7 +253,6 @@ function setupWorkflowTabsPositionWatcher() {
|
||||
|
||||
const cleanups = [];
|
||||
|
||||
// 1. Hook the setting's native onChange callback directly (instant execution on click)
|
||||
const attachNativeOnChange = (settingObj) => {
|
||||
if (!settingObj || settingObj._classicWatcherAttached) return;
|
||||
settingObj._classicWatcherAttached = true;
|
||||
@@ -293,23 +267,19 @@ function setupWorkflowTabsPositionWatcher() {
|
||||
});
|
||||
};
|
||||
|
||||
// Check existing registered setting in legacy UI and modern extension manager
|
||||
attachNativeOnChange(app.ui?.settings?.settings?.[TARGET_SETTING]);
|
||||
attachNativeOnChange(app.extensionManager?.setting?.getSetting?.(TARGET_SETTING));
|
||||
attachNativeOnChange(app.extensionManager?.setting?.settings?.[TARGET_SETTING]);
|
||||
|
||||
// 2. Hook Vue/Pinia reactive store subscription if available (zero polling, synchronous)
|
||||
const settingStore = app.extensionManager?.setting?.settingStore;
|
||||
if (settingStore?.$subscribe) {
|
||||
const unsubscribe = settingStore.$subscribe(() => {
|
||||
const val = app.extensionManager?.setting?.get?.(TARGET_SETTING) ??
|
||||
app.ui?.settings?.getSettingValue(TARGET_SETTING);
|
||||
const val = getSetting(TARGET_SETTING);
|
||||
checkAndDisableIfSidebar(val);
|
||||
});
|
||||
cleanups.push(unsubscribe);
|
||||
}
|
||||
|
||||
// 3. Hook addSetting in case core registers/re-registers the setting later
|
||||
if (app.ui?.settings?.addSetting) {
|
||||
const origAdd = app.ui.settings.addSetting.bind(app.ui.settings);
|
||||
app.ui.settings.addSetting = (setting) => {
|
||||
@@ -323,7 +293,6 @@ function setupWorkflowTabsPositionWatcher() {
|
||||
});
|
||||
}
|
||||
|
||||
// 4. Hook API setters as fallback
|
||||
if (app.ui?.settings?.setSettingValue) {
|
||||
const origSetSettingValue = app.ui.settings.setSettingValue.bind(app.ui.settings);
|
||||
app.ui.settings.setSettingValue = (id, value) => {
|
||||
@@ -353,21 +322,22 @@ function setupWorkflowTabsPositionWatcher() {
|
||||
|
||||
app.registerExtension({
|
||||
name: "ComfySidebar.ClassicRestore",
|
||||
aboutPageBadges,
|
||||
|
||||
async init() {
|
||||
await initI18n();
|
||||
registerSettings();
|
||||
},
|
||||
|
||||
commands: [
|
||||
// Plain Q toggles the Queue tab through the frontend keybinding system (rebindable in Settings > Keybinding).
|
||||
keybindings: [
|
||||
{
|
||||
id: "ComfySidebar.ToggleSidebar",
|
||||
label: t("Toggle Comfy Queue Sidebar"),
|
||||
function: () => {
|
||||
const ourBtn = findOurSidebarButton();
|
||||
if (ourBtn) ourBtn.click();
|
||||
}
|
||||
},
|
||||
combo: { key: "q" },
|
||||
commandId: "Workspace.ToggleSidebarTab.classic-comfy-sidebar"
|
||||
}
|
||||
],
|
||||
|
||||
commands: [
|
||||
{
|
||||
id: "ComfySidebar.ToggleIgnoreNode",
|
||||
label: t("Toggle Ignore Selected Node(s) in Queue"),
|
||||
@@ -423,23 +393,17 @@ app.registerExtension({
|
||||
if (!app.extensionManager || !app.extensionManager.registerSidebarTab) return;
|
||||
await initI18n();
|
||||
|
||||
const tabsPos = app.extensionManager?.setting?.get?.("Comfy.Workflow.WorkflowTabsPosition") ??
|
||||
app.ui.settings.getSettingValue("Comfy.Workflow.WorkflowTabsPosition");
|
||||
let isClassicLayoutEnabled = app.ui.settings.getSettingValue(SettingIds.CLASSIC_LAYOUT) ?? false;
|
||||
const tabsPos = getSetting("Comfy.Workflow.WorkflowTabsPosition");
|
||||
let isClassicLayoutEnabled = getSetting(SettingIds.CLASSIC_LAYOUT, false);
|
||||
|
||||
// Startup safeguard: if workflows are set to Sidebar, disable Comfy Layout
|
||||
if (isClassicLayoutEnabled && tabsPos === "Sidebar") {
|
||||
isClassicLayoutEnabled = false;
|
||||
if (app.extensionManager?.setting) {
|
||||
try { app.extensionManager.setting.set(SettingIds.CLASSIC_LAYOUT, false); } catch (e) {}
|
||||
} else if (app.ui?.settings) {
|
||||
try { app.ui.settings.setSettingValue(SettingIds.CLASSIC_LAYOUT, false); } catch (e) {}
|
||||
}
|
||||
setSetting(SettingIds.CLASSIC_LAYOUT, false);
|
||||
}
|
||||
|
||||
applyClassicLayout(isClassicLayoutEnabled, false);
|
||||
|
||||
const isHistoryOverrideEnabled = app.ui.settings.getSettingValue(SettingIds.OVERRIDE_STOCK_HISTORY) ?? false;
|
||||
const isHistoryOverrideEnabled = getSetting(SettingIds.OVERRIDE_STOCK_HISTORY, false);
|
||||
if (isHistoryOverrideEnabled) {
|
||||
syncStockHistoryAndProgressSettings(true);
|
||||
}
|
||||
@@ -451,15 +415,19 @@ app.registerExtension({
|
||||
|
||||
cleanupFns.push(setupWorkflowTabsPositionWatcher());
|
||||
cleanupFns.push(setupDragAndDrop());
|
||||
cleanupFns.push(setupLatinHotkeys());
|
||||
cleanupFns.push(setupNewWorkflowQuickPicker());
|
||||
cleanupFns.push(setupLocaleWatcher());
|
||||
cleanupFns.push(onLocaleChange(() => {
|
||||
renderSidebar();
|
||||
}));
|
||||
cleanupFns.push(setupVueNodeObserver());
|
||||
cleanupFns.push(setupSettingsDialogObserver());
|
||||
|
||||
// Setup execution tracker with targeted fast-path update for active card
|
||||
cleanupFns.push(setupExecutionTracker((pid, progress, nodeName) => {
|
||||
const cardObj = cardPool.get(pid);
|
||||
const state = store.getPrompt(pid);
|
||||
if (cardObj && state) {
|
||||
const showWorkingNode = app.ui.settings.getSettingValue(SettingIds.SHOW_WORKING_NODE_NAME) ?? true;
|
||||
const showWorkingNode = getSetting(SettingIds.SHOW_WORKING_NODE_NAME, true);
|
||||
updateCardProgressTargeted(cardObj, progress, nodeName, showWorkingNode, state);
|
||||
} else {
|
||||
renderSidebar();
|
||||
@@ -469,6 +437,7 @@ app.registerExtension({
|
||||
const sidebarContainer = setupSidebarView();
|
||||
|
||||
await initSessionAndHistory();
|
||||
await sweepMissingCards();
|
||||
setupKeydownShortcuts();
|
||||
|
||||
syncAllNodeBadges();
|
||||
@@ -477,13 +446,6 @@ app.registerExtension({
|
||||
let galleryScrollPos = 0;
|
||||
let activeSidebarTab = "queue";
|
||||
|
||||
const getRealScrollEl = (childEl) => {
|
||||
if (!childEl) return null;
|
||||
return childEl.closest('.sidebar-content-container, [class*="sidebar-content-container"], [class*="overflow-y-auto"]')
|
||||
|| childEl.parentElement
|
||||
|| childEl;
|
||||
};
|
||||
|
||||
app.extensionManager.registerSidebarTab({
|
||||
id: "classic-comfy-sidebar",
|
||||
icon: "pi pi-images",
|
||||
@@ -492,45 +454,60 @@ app.registerExtension({
|
||||
type: "custom",
|
||||
render: (el) => {
|
||||
document.querySelectorAll(".comfy-sidebar-scroll-top-btn").forEach(btn => { btn.style.display = "none"; });
|
||||
const scrollParent = getRealScrollEl(el);
|
||||
const scrollParent = getScrollContainer(el);
|
||||
if (activeSidebarTab === "gallery" && scrollParent) {
|
||||
galleryScrollPos = scrollParent.scrollTop;
|
||||
}
|
||||
activeSidebarTab = "queue";
|
||||
el.replaceChildren(sidebarContainer);
|
||||
requestAnimationFrame(() => {
|
||||
const sp = getRealScrollEl(el);
|
||||
const sp = getScrollContainer(el);
|
||||
if (sp) sp.scrollTop = queueScrollPos;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
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 = getRealScrollEl(el);
|
||||
if (activeSidebarTab === "queue" && scrollParent) {
|
||||
queueScrollPos = scrollParent.scrollTop;
|
||||
}
|
||||
activeSidebarTab = "gallery";
|
||||
el.replaceChildren(galleryContainer);
|
||||
requestAnimationFrame(() => {
|
||||
const sp = getRealScrollEl(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 = app.ui.settings.getSettingValue("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();
|
||||
@@ -538,6 +515,7 @@ app.registerExtension({
|
||||
},
|
||||
|
||||
destroy() {
|
||||
syncGalleryTab = null;
|
||||
for (const fn of cleanupFns.splice(0)) {
|
||||
try { if (typeof fn === "function") fn(); } catch (e) {}
|
||||
}
|
||||
@@ -558,4 +536,4 @@ app.registerExtension({
|
||||
app.extensionManager.unregisterSidebarTab("classic-comfy-sidebar");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,10 @@
|
||||
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 } from "../utils/utils.js";
|
||||
import { getRunOutputs, extractWorkflowFromPng, isImageFormat, animateCardRemoval, downloadJson, getScrollContainer, attachDeleteConfirmation } from "../utils/utils.js";
|
||||
import { showFullscreenPreview } from "../utils/comparison.js";
|
||||
import { stopAllAudioPlayback } from "./audioController.js";
|
||||
import { deleteHistoryItem, cancelPendingTask, interruptActive } from "../queue/queueService.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;
|
||||
|
||||
@@ -100,13 +113,7 @@ export function syncCardButtonVisibility(cardObj, state) {
|
||||
alert(t("No workflow metadata found in this file."));
|
||||
return;
|
||||
}
|
||||
const blob = new Blob([JSON.stringify(wf, null, 2)], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `workflow_${state.pid || "comfy"}.json`;
|
||||
a.click();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1500);
|
||||
downloadJson(wf, `workflow_${state.pid || "comfy"}.json`);
|
||||
};
|
||||
} else {
|
||||
cardObj.btnJson.style.setProperty("display", "none", "important");
|
||||
@@ -126,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) {
|
||||
@@ -304,9 +386,7 @@ export function syncCardButtonVisibility(cardObj, state) {
|
||||
}
|
||||
}
|
||||
|
||||
const scrollEl = document.querySelector('.sidebar-content-container, [class*="sidebar-content-container"], [class*="overflow-y-auto"]')
|
||||
|| store.ui.cardStack?.parentElement
|
||||
|| store.ui.cardStack;
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) {
|
||||
store.ui.mainQueueScrollTop = scrollEl.scrollTop;
|
||||
}
|
||||
@@ -386,18 +466,18 @@ export function getOrCreateCard(state, callbacks = {}) {
|
||||
|
||||
const pt = document.createElement("div");
|
||||
Object.assign(pt.style, {
|
||||
width: "100%", height: "4px", background: "#333", borderRadius: "2px", marginTop: "8px",
|
||||
width: "100%", height: "4px", background: "var(--border, #333)", borderRadius: "2px", marginTop: "8px",
|
||||
overflow: "hidden", display: "none"
|
||||
});
|
||||
const pb = document.createElement("div");
|
||||
Object.assign(pb.style, {
|
||||
width: "0%", height: "100%", background: "#3b82f6", transition: "width 0.1s linear"
|
||||
width: "0%", height: "100%", background: "var(--primary, var(--p-primary-color, #ea580c))", transition: "width 0.1s linear"
|
||||
});
|
||||
pt.appendChild(pb);
|
||||
|
||||
const statusText = document.createElement("div");
|
||||
Object.assign(statusText.style, {
|
||||
fontSize: "11px", opacity: "0.9", color: "#3b82f6", textAlign: "center", marginTop: "6px",
|
||||
fontSize: "11px", opacity: "0.9", color: "var(--primary, var(--p-primary-color, #ea580c))", textAlign: "center", marginTop: "6px",
|
||||
display: "none", fontWeight: "bold"
|
||||
});
|
||||
|
||||
@@ -428,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, {
|
||||
@@ -442,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
|
||||
@@ -467,6 +556,7 @@ export function getOrCreateCard(state, callbacks = {}) {
|
||||
btnJson,
|
||||
btnDel,
|
||||
btnDelLabel,
|
||||
btnMove,
|
||||
canDeleteFromDisk: true,
|
||||
statusText,
|
||||
firstImgElement: null,
|
||||
@@ -503,34 +593,14 @@ export function getOrCreateCard(state, callbacks = {}) {
|
||||
}
|
||||
});
|
||||
|
||||
let deleteTimeout = null, isDeletePending = false, isDiskDelete = false;
|
||||
const resetDeleteBtn = () => {
|
||||
isDeletePending = false;
|
||||
isDiskDelete = false;
|
||||
cardObj.btnDel.classList.remove("confirm-delete", "confirm-delete-disk");
|
||||
cardObj.btnDel.title = t("Delete Card (Ctrl+Click to delete from disk)");
|
||||
if (deleteTimeout) { clearTimeout(deleteTimeout); deleteTimeout = null; }
|
||||
};
|
||||
|
||||
btnDel.onclick = async (ev) => {
|
||||
ev.stopPropagation();
|
||||
const wantsDiskDelete = (ev.ctrlKey || ev.metaKey) && cardObj.canDeleteFromDisk !== false;
|
||||
|
||||
if (!isDeletePending) {
|
||||
isDeletePending = true;
|
||||
isDiskDelete = wantsDiskDelete;
|
||||
cardObj.btnDel.classList.add(wantsDiskDelete ? "confirm-delete-disk" : "confirm-delete");
|
||||
cardObj.btnDel.title = wantsDiskDelete
|
||||
? t("Ctrl+Click again to delete file from DISK / TRASH")
|
||||
: t("Click again to confirm removing card");
|
||||
deleteTimeout = setTimeout(resetDeleteBtn, 2000);
|
||||
} else {
|
||||
const shouldDeleteFromDisk = isDiskDelete || wantsDiskDelete;
|
||||
resetDeleteBtn();
|
||||
|
||||
const liveState = store.getPrompt(state.pid) || state;
|
||||
|
||||
attachDeleteConfirmation(btnDel, {
|
||||
canDiskDelete: () => cardObj.canDeleteFromDisk !== false,
|
||||
idleTitle: () => cardObj.canDeleteFromDisk ? t("Delete Card (Hold Ctrl to delete file from disk)") : t("Delete Card"),
|
||||
confirmTitle: t("Click again to confirm removing card"),
|
||||
confirmDiskTitle: t("Ctrl+Click again to delete file from DISK / TRASH"),
|
||||
onConfirm: async (shouldDeleteFromDisk) => {
|
||||
if (shouldDeleteFromDisk) {
|
||||
const liveState = store.getPrompt(state.pid) || state;
|
||||
const filesToDelete = [];
|
||||
const seen = new Set();
|
||||
const addFile = (item) => {
|
||||
@@ -547,27 +617,16 @@ export function getOrCreateCard(state, callbacks = {}) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
||||
deleteHistoryItem(state.pid);
|
||||
animateCardRemoval(card, () => {
|
||||
deleteHistoryItem(state.pid);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
cardPool.set(state.pid, cardObj);
|
||||
return cardObj;
|
||||
@@ -643,9 +702,7 @@ export function updateCardDOM(cardObj, state, showPendingSummary = true, showWor
|
||||
} else {
|
||||
cardObj.placeholder.style.display = "none";
|
||||
renderCardImages(cardObj, state, (st) => {
|
||||
const scrollEl = document.querySelector('.sidebar-content-container, [class*="sidebar-content-container"], [class*="overflow-y-auto"]')
|
||||
|| store.ui.cardStack?.parentElement
|
||||
|| store.ui.cardStack;
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) {
|
||||
store.ui.mainQueueScrollTop = scrollEl.scrollTop;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
});
|
||||
}
|
||||
@@ -1,17 +1,33 @@
|
||||
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 { extractWorkflowFromPng, isImageFormat } from "../utils/utils.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 = "";
|
||||
let currentSearchQuery = "";
|
||||
let stickyHeaderGroupEl = null;
|
||||
let lastScrollTop = 0;
|
||||
let scrollDeltaAccumulator = 0;
|
||||
let isHeaderHidden = false;
|
||||
let galleryResizeObserver = null;
|
||||
|
||||
// Module-level so teardownGalleryView() can remove the exact same references
|
||||
const handleCtrlDown = (e) => {
|
||||
if (e.key === "Control" || e.key === "Meta") document.body.classList.add("comfy-sidebar-ctrl-active");
|
||||
};
|
||||
const handleCtrlUp = (e) => {
|
||||
if (e.key === "Control" || e.key === "Meta") document.body.classList.remove("comfy-sidebar-ctrl-active");
|
||||
};
|
||||
const handleCtrlBlur = () => document.body.classList.remove("comfy-sidebar-ctrl-active");
|
||||
|
||||
// Persistent sort order
|
||||
let sortOrder = "newest";
|
||||
@@ -33,22 +49,27 @@ function formatFileSize(bytes) {
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
||||
}
|
||||
|
||||
function getScrollContainer() {
|
||||
if (!cardStackEl) return null;
|
||||
return cardStackEl.closest('.sidebar-content-container, [class*="sidebar-content-container"], [class*="overflow-y-auto"]')
|
||||
|| cardStackEl.parentElement
|
||||
|| cardStackEl;
|
||||
}
|
||||
|
||||
function updateScrollTopVisibility() {
|
||||
if (!scrollToTopBtnEl) return;
|
||||
if (!galleryContainerEl || !galleryContainerEl.isConnected) {
|
||||
scrollToTopBtnEl.style.display = "none";
|
||||
if (scrollToTopBtnEl) scrollToTopBtnEl.style.display = "none";
|
||||
return;
|
||||
}
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(cardStackEl);
|
||||
if (scrollEl) {
|
||||
scrollToTopBtnEl.style.display = scrollEl.scrollTop > 200 ? "flex" : "none";
|
||||
const viewportEl = scrollEl.parentElement || galleryContainerEl;
|
||||
if (viewportEl && scrollToTopBtnEl && scrollToTopBtnEl.parentNode !== viewportEl) {
|
||||
if (window.getComputedStyle(viewportEl).position === "static") {
|
||||
viewportEl.style.position = "relative";
|
||||
}
|
||||
viewportEl.appendChild(scrollToTopBtnEl);
|
||||
}
|
||||
|
||||
if (scrollToTopBtnEl) {
|
||||
scrollToTopBtnEl.style.display = scrollEl.scrollTop > 200 ? "flex" : "none";
|
||||
}
|
||||
|
||||
// Handle smart scroll-up reveal for header & navigation
|
||||
handleHeaderScroll(scrollEl);
|
||||
|
||||
if (scrollEl.scrollTop + scrollEl.clientHeight >= scrollEl.scrollHeight - 300) {
|
||||
loadNextBatch();
|
||||
@@ -56,14 +77,78 @@ function updateScrollTopVisibility() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleHeaderScroll(scrollEl) {
|
||||
if (!stickyHeaderGroupEl) return;
|
||||
|
||||
const currentScroll = scrollEl.scrollTop;
|
||||
const searchContainer = stickyHeaderGroupEl.querySelector(".comfy-sidebar-search-container");
|
||||
const searchIsOpen = currentSearchQuery || (searchContainer && searchContainer.style.display !== "none");
|
||||
|
||||
// Keep the frosted surface in sync even while search forces the header to stay visible.
|
||||
stickyHeaderGroupEl.classList.toggle("is-scrolled", currentScroll > 35);
|
||||
|
||||
if (searchIsOpen) {
|
||||
lastScrollTop = currentScroll;
|
||||
scrollDeltaAccumulator = 0;
|
||||
stickyHeaderGroupEl.style.transform = "translateY(0)";
|
||||
isHeaderHidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const delta = currentScroll - lastScrollTop;
|
||||
lastScrollTop = currentScroll;
|
||||
|
||||
// Near the very top: always keep visible & transparent
|
||||
if (currentScroll <= 35) {
|
||||
stickyHeaderGroupEl.classList.remove("is-scrolled");
|
||||
if (isHeaderHidden) {
|
||||
stickyHeaderGroupEl.style.transform = "translateY(0)";
|
||||
isHeaderHidden = false;
|
||||
}
|
||||
scrollDeltaAccumulator = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
stickyHeaderGroupEl.classList.add("is-scrolled");
|
||||
|
||||
if (delta > 0) {
|
||||
// Scrolling DOWN: hide after small buffer
|
||||
if (scrollDeltaAccumulator < 0) scrollDeltaAccumulator = 0;
|
||||
scrollDeltaAccumulator += delta;
|
||||
|
||||
if (scrollDeltaAccumulator > 25 && !isHeaderHidden) {
|
||||
stickyHeaderGroupEl.style.transform = "translateY(-100%)";
|
||||
isHeaderHidden = true;
|
||||
}
|
||||
} else if (delta < 0) {
|
||||
// Scrolling UP: reveal as soon as user scrolls up a little bit (~15px)
|
||||
if (scrollDeltaAccumulator > 0) scrollDeltaAccumulator = 0;
|
||||
scrollDeltaAccumulator += delta;
|
||||
|
||||
if (scrollDeltaAccumulator < -15 && isHeaderHidden) {
|
||||
stickyHeaderGroupEl.style.transform = "translateY(0)";
|
||||
isHeaderHidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let galleryFetchController = null;
|
||||
|
||||
// Returns false only when the request was superseded by a newer one (aborted),
|
||||
// so callers can skip rendering stale results.
|
||||
async function fetchGalleryData(subfolder = "", searchQuery = "") {
|
||||
// A newer request (e.g. the next keystroke in the search box) cancels the in-flight one;
|
||||
// the server stops scanning as soon as the client disconnects.
|
||||
if (galleryFetchController) galleryFetchController.abort();
|
||||
const controller = new AbortController();
|
||||
galleryFetchController = controller;
|
||||
try {
|
||||
isLoading = true;
|
||||
const normalized = subfolder.replace(/\\/g, "/");
|
||||
const queryParams = new URLSearchParams({ subfolder: normalized });
|
||||
if (searchQuery) queryParams.set("search", searchQuery);
|
||||
|
||||
const res = await fetch(`/comfy-sidebar/gallery/list?${queryParams.toString()}`);
|
||||
const res = await fetch(`/comfy-sidebar/gallery/list?${queryParams.toString()}`, { signal: controller.signal });
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
||||
const data = await res.json();
|
||||
cachedFolders = data.folders || [];
|
||||
@@ -72,11 +157,16 @@ async function fetchGalleryData(subfolder = "", searchQuery = "") {
|
||||
applySorting();
|
||||
displayedFilesCount = 0;
|
||||
} catch (e) {
|
||||
if (e?.name === "AbortError") return false;
|
||||
console.error("[ComfySidebar] Failed to load gallery", e);
|
||||
showNotification(t("Failed to load gallery from disk."), "error");
|
||||
} finally {
|
||||
isLoading = false;
|
||||
if (galleryFetchController === controller) {
|
||||
galleryFetchController = null;
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function applySorting() {
|
||||
@@ -186,6 +276,7 @@ function createFileCard(file) {
|
||||
pid: `gallery-${file.filename}`,
|
||||
status: PromptStatus.COMPLETED,
|
||||
images: [fileAsset],
|
||||
_previewImages: cachedFiles,
|
||||
workflow: null
|
||||
});
|
||||
|
||||
@@ -232,56 +323,40 @@ function createFileCard(file) {
|
||||
alert(t("No workflow metadata found in this file."));
|
||||
return;
|
||||
}
|
||||
const blob = new Blob([JSON.stringify(wf, null, 2)], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `workflow_${file.filename.replace(/\.[^/.]+$/, "")}.json`;
|
||||
a.click();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1500);
|
||||
downloadJson(wf, `workflow_${file.filename.replace(/\.[^/.]+$/, "")}.json`);
|
||||
};
|
||||
}
|
||||
|
||||
const btnDel = document.createElement("span");
|
||||
btnDel.className = "pi pi-trash comfy-sidebar-card-action-btn comfy-sidebar-btn-del";
|
||||
btnDel.title = t("Delete file (Hold Ctrl to delete file from disk)");
|
||||
btnDel.className = "pi pi-trash comfy-sidebar-card-action-btn comfy-sidebar-btn-del comfy-sidebar-gallery-btn-del";
|
||||
const btnDelLabel = document.createElement("span");
|
||||
btnDelLabel.className = "comfy-sidebar-del-label";
|
||||
btnDelLabel.textContent = t("Delete File");
|
||||
btnDel.appendChild(btnDelLabel);
|
||||
|
||||
let isDeletePending = false, isDiskDelete = false, deleteTimeout = null;
|
||||
const resetDelete = () => {
|
||||
isDeletePending = false;
|
||||
isDiskDelete = false;
|
||||
btnDel.classList.remove("confirm-delete", "confirm-delete-disk");
|
||||
btnDel.title = t("Delete file (Hold Ctrl to delete file from disk)");
|
||||
if (deleteTimeout) { clearTimeout(deleteTimeout); deleteTimeout = null; }
|
||||
};
|
||||
|
||||
btnDel.onclick = async (ev) => {
|
||||
ev.stopPropagation();
|
||||
const wantsDiskDelete = ev.ctrlKey || ev.metaKey;
|
||||
|
||||
if (!isDeletePending) {
|
||||
isDeletePending = true;
|
||||
isDiskDelete = wantsDiskDelete;
|
||||
btnDel.classList.add(wantsDiskDelete ? "confirm-delete-disk" : "confirm-delete");
|
||||
btnDel.title = wantsDiskDelete
|
||||
? t("Ctrl+Click again to delete file from DISK / TRASH")
|
||||
: t("Click again to confirm deleting file");
|
||||
deleteTimeout = setTimeout(resetDelete, 2000);
|
||||
} else {
|
||||
resetDelete();
|
||||
attachDeleteConfirmation(btnDel, {
|
||||
idleTitle: t("Delete file (Hold Ctrl to delete file from disk)"),
|
||||
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(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);
|
||||
renderGallery();
|
||||
displayedFilesCount = Math.max(0, displayedFilesCount - 1);
|
||||
|
||||
animateCardRemoval(card, () => {
|
||||
card.remove();
|
||||
if (cachedFiles.length === 0) {
|
||||
renderGallery();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
hoverPanel.appendChild(btnDownload);
|
||||
if (btnJson) hoverPanel.appendChild(btnJson);
|
||||
@@ -330,7 +405,7 @@ function updateBreadcrumbUI() {
|
||||
|
||||
const rootBtn = document.createElement("span");
|
||||
rootBtn.className = "comfy-sidebar-breadcrumb-item";
|
||||
rootBtn.innerHTML = `<i class="pi pi-home" style="margin-right: 4px; font-size: 11px; color: var(--p-primary-color, #0ea5e9);"></i>output`;
|
||||
rootBtn.innerHTML = `<i class="pi pi-home" style="margin-right: 4px; font-size: 11px; color: var(--primary, var(--p-primary-color, var(--primary-color, #a855f7)));"></i>output`;
|
||||
rootBtn.onclick = () => navigateToSubfolder("");
|
||||
breadcrumbBar.appendChild(rootBtn);
|
||||
|
||||
@@ -408,10 +483,10 @@ export function renderGallery() {
|
||||
});
|
||||
}
|
||||
|
||||
const threshold = app.ui?.settings?.getSettingValue?.(SettingIds.GRID_COLUMNS_THRESHOLD) ?? 350;
|
||||
const threshold = getSetting(SettingIds.GRID_COLUMNS_THRESHOLD, 350);
|
||||
const containerWidth = galleryContainerEl.clientWidth || 0;
|
||||
if (containerWidth > 0) {
|
||||
currentColumnCount = Math.max(1, Math.floor(containerWidth / (threshold / 2)));
|
||||
currentColumnCount = calculateGridColumns(containerWidth, threshold);
|
||||
}
|
||||
|
||||
let columnsWrapper = cardStackEl.querySelector(".comfy-sidebar-masonry-wrapper");
|
||||
@@ -429,7 +504,7 @@ async function navigateToSubfolder(subfolder) {
|
||||
currentSubfolder = (subfolder || "").replace(/\\/g, "/");
|
||||
currentSearchQuery = "";
|
||||
await fetchGalleryData(currentSubfolder);
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(cardStackEl);
|
||||
if (scrollEl) scrollEl.scrollTop = 0;
|
||||
renderGallery();
|
||||
}
|
||||
@@ -440,7 +515,8 @@ export function setupGalleryView() {
|
||||
|
||||
Object.assign(container.style, {
|
||||
display: "flex", flexDirection: "column", height: "100%", padding: "14px", boxSizing: "border-box",
|
||||
background: "var(--comfy-menu-bg, #121212)", color: "var(--fg-color, #eee)", position: "relative"
|
||||
background: "transparent",
|
||||
color: "var(--fg-color, var(--p-text-color, #eee))", position: "relative"
|
||||
});
|
||||
|
||||
const header = document.createElement("div");
|
||||
@@ -509,13 +585,19 @@ 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");
|
||||
searchContainer.className = "comfy-sidebar-search-container";
|
||||
Object.assign(searchContainer.style, {
|
||||
display: "none", width: "100%", alignItems: "center", background: "var(--comfy-input-bg, #181818)",
|
||||
border: "1px solid var(--border-color, #555)", borderRadius: "4px", padding: "2px 8px",
|
||||
display: "none", width: "100%", alignItems: "center",
|
||||
background: "var(--card, var(--secondary, var(--comfy-input-bg, #181818)))",
|
||||
border: "1px solid var(--border, var(--border-color, #555))", borderRadius: "4px", padding: "2px 8px",
|
||||
boxSizing: "border-box", height: "26px"
|
||||
});
|
||||
const sIcon = document.createElement("span");
|
||||
@@ -534,23 +616,45 @@ export function setupGalleryView() {
|
||||
|
||||
searchContainer.append(sIcon, sInput, sClear);
|
||||
header.append(standardHeader, searchContainer);
|
||||
container.appendChild(header);
|
||||
|
||||
const stickyHeaderGroup = document.createElement("div");
|
||||
stickyHeaderGroup.className = "comfy-sidebar-sticky-header-group";
|
||||
stickyHeaderGroupEl = stickyHeaderGroup;
|
||||
stickyHeaderGroup.appendChild(header);
|
||||
|
||||
let scrollBeforeSearch = 0;
|
||||
|
||||
searchIcon.onclick = (e) => {
|
||||
e.stopPropagation();
|
||||
const scrollEl = getScrollContainer(cardStackEl);
|
||||
scrollBeforeSearch = scrollEl ? scrollEl.scrollTop : 0;
|
||||
standardHeader.style.display = "none";
|
||||
searchContainer.style.display = "flex";
|
||||
sInput.focus();
|
||||
};
|
||||
|
||||
let searchDebounce = null;
|
||||
let searchSeq = 0;
|
||||
const closeSearch = () => {
|
||||
const hadFilter = Boolean(currentSearchQuery || sInput.value.trim());
|
||||
sInput.value = "";
|
||||
currentSearchQuery = "";
|
||||
sIcon.className = "pi pi-search";
|
||||
searchContainer.style.display = "none";
|
||||
standardHeader.style.display = "flex";
|
||||
fetchGalleryData(currentSubfolder, "").then(() => renderGallery());
|
||||
|
||||
// If the user didn't type a search query, do NOT re-fetch or wipe cards.
|
||||
// The scroll position stays right where you are.
|
||||
if (hadFilter) {
|
||||
fetchGalleryData(currentSubfolder, "").then(() => {
|
||||
renderGallery();
|
||||
const scrollEl = getScrollContainer(cardStackEl);
|
||||
if (scrollEl && scrollBeforeSearch > 0) {
|
||||
scrollEl.scrollTop = scrollBeforeSearch;
|
||||
requestAnimationFrame(() => { scrollEl.scrollTop = scrollBeforeSearch; });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
sClear.onclick = (e) => { e.stopPropagation(); closeSearch(); };
|
||||
@@ -561,62 +665,59 @@ export function setupGalleryView() {
|
||||
|
||||
sIcon.className = "pi pi-spin pi-spinner";
|
||||
|
||||
const seq = ++searchSeq;
|
||||
searchDebounce = setTimeout(async () => {
|
||||
let applied = false;
|
||||
try {
|
||||
await fetchGalleryData(currentSubfolder, currentSearchQuery);
|
||||
renderGallery();
|
||||
applied = (await fetchGalleryData(currentSubfolder, currentSearchQuery)) !== false;
|
||||
if (applied) renderGallery();
|
||||
} finally {
|
||||
sIcon.className = "pi pi-search";
|
||||
// Only the latest search may stop the spinner
|
||||
if (seq === searchSeq) sIcon.className = "pi pi-search";
|
||||
}
|
||||
}, 350);
|
||||
};
|
||||
|
||||
const breadcrumbBar = document.createElement("div");
|
||||
breadcrumbBar.className = "comfy-sidebar-breadcrumb-bar";
|
||||
container.appendChild(breadcrumbBar);
|
||||
stickyHeaderGroup.appendChild(breadcrumbBar);
|
||||
container.appendChild(stickyHeaderGroup);
|
||||
|
||||
const cardStack = document.createElement("div");
|
||||
cardStackEl = cardStack;
|
||||
Object.assign(cardStack.style, {
|
||||
flex: "1", overflowY: "visible", display: "flex", flexDirection: "column", paddingBottom: "28px"
|
||||
flex: "1", overflowY: "visible", display: "flex", flexDirection: "column", paddingBottom: "46px"
|
||||
});
|
||||
container.appendChild(cardStack);
|
||||
|
||||
scrollToTopBtnEl = document.createElement("button");
|
||||
scrollToTopBtnEl.className = "pi pi-chevron-up comfy-sidebar-scroll-top-btn";
|
||||
scrollToTopBtnEl.title = t("Scroll to Top");
|
||||
Object.assign(scrollToTopBtnEl.style, {
|
||||
position: "sticky",
|
||||
bottom: "14px",
|
||||
marginLeft: "auto",
|
||||
zIndex: "30"
|
||||
});
|
||||
scrollToTopBtnEl.onclick = (e) => {
|
||||
e.stopPropagation();
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(cardStackEl);
|
||||
if (scrollEl) scrollEl.scrollTo({ top: 0, behavior: "smooth" });
|
||||
};
|
||||
container.appendChild(scrollToTopBtnEl);
|
||||
|
||||
const handleCtrlDown = (e) => {
|
||||
if (e.key === "Control" || e.key === "Meta") document.body.classList.add("comfy-sidebar-ctrl-active");
|
||||
};
|
||||
const handleCtrlUp = (e) => {
|
||||
if (e.key === "Control" || e.key === "Meta") document.body.classList.remove("comfy-sidebar-ctrl-active");
|
||||
};
|
||||
window.addEventListener("keydown", handleCtrlDown);
|
||||
window.addEventListener("keyup", handleCtrlUp);
|
||||
window.addEventListener("blur", handleCtrlBlur);
|
||||
|
||||
// Reveal Spotlight: track cursor position over Gallery card and folder borders
|
||||
setupSpotlightTracker(container, ".comfy-sidebar-card, .comfy-sidebar-folder-card");
|
||||
|
||||
document.addEventListener("scroll", updateScrollTopVisibility, { capture: true, passive: true });
|
||||
|
||||
new ResizeObserver((entries) => {
|
||||
const threshold = app.ui?.settings?.getSettingValue?.(SettingIds.GRID_COLUMNS_THRESHOLD) ?? 350;
|
||||
const cols = Math.max(1, Math.floor(entries[0].contentRect.width / (threshold / 2)));
|
||||
galleryResizeObserver = new ResizeObserver((entries) => {
|
||||
const threshold = getSetting(SettingIds.GRID_COLUMNS_THRESHOLD, 350);
|
||||
const cols = calculateGridColumns(entries[0].contentRect.width, threshold);
|
||||
if (cols !== currentColumnCount) {
|
||||
currentColumnCount = cols;
|
||||
renderGallery();
|
||||
}
|
||||
}).observe(container);
|
||||
});
|
||||
galleryResizeObserver.observe(container);
|
||||
|
||||
fetchGalleryData("").then(() => renderGallery());
|
||||
|
||||
@@ -625,9 +726,29 @@ export function setupGalleryView() {
|
||||
|
||||
export function teardownGalleryView() {
|
||||
document.removeEventListener("scroll", updateScrollTopVisibility, { capture: true, passive: true });
|
||||
window.removeEventListener("keydown", handleCtrlDown);
|
||||
window.removeEventListener("keyup", handleCtrlUp);
|
||||
window.removeEventListener("blur", handleCtrlBlur);
|
||||
document.body.classList.remove("comfy-sidebar-ctrl-active");
|
||||
if (galleryResizeObserver) {
|
||||
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;
|
||||
isHeaderHidden = false;
|
||||
cachedFolders = [];
|
||||
cachedFiles = [];
|
||||
stickyHeaderGroupEl = null;
|
||||
galleryContainerEl = null;
|
||||
cardStackEl = null;
|
||||
if (scrollToTopBtnEl && scrollToTopBtnEl.parentNode) {
|
||||
scrollToTopBtnEl.parentNode.removeChild(scrollToTopBtnEl);
|
||||
}
|
||||
scrollToTopBtnEl = null;
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
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 {
|
||||
const res = await fetch(src);
|
||||
@@ -24,8 +30,6 @@ export async function copyImageToClipboard(src) {
|
||||
}
|
||||
}
|
||||
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
export async function openFileOrFolder(img) {
|
||||
if (!img) return;
|
||||
|
||||
@@ -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 = app.ui?.settings?.getSettingValue?.("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,13 +255,13 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -5,17 +5,23 @@ import { t } from "../core/i18n.js";
|
||||
import { getOrCreateCard, updateCardDOM, resetAllCardHoverStates, cardPool } from "./cardRenderer.js";
|
||||
import { clearCancelledOrFailed, clearAllHistory, cancelAllPending } from "../queue/queueService.js";
|
||||
import { updateSidebarBadge, centerAndSelectCanvasNode } from "../comfy/adapter.js";
|
||||
import { matchesFilter, getRunOutputs, isImageFormat } from "../utils/utils.js";
|
||||
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;
|
||||
let renderAnimationFrameId = null;
|
||||
let activeTimerInterval = null;
|
||||
let currentColumnCount = 1;
|
||||
let stickyHeaderGroupEl = null;
|
||||
let lastScrollTop = 0;
|
||||
let scrollDeltaAccumulator = 0;
|
||||
let isHeaderHidden = false;
|
||||
|
||||
function mountCards(cardStack, fullWidthEls, cardEls, cols = 1) {
|
||||
if (!cardStack) return;
|
||||
@@ -90,11 +96,56 @@ function mountCards(cardStack, fullWidthEls, cardEls, cols = 1) {
|
||||
}
|
||||
}
|
||||
|
||||
function getScrollContainer() {
|
||||
if (!store.ui.cardStack) return null;
|
||||
return store.ui.cardStack.closest('.sidebar-content-container, [class*="sidebar-content-container"], [class*="overflow-y-auto"]')
|
||||
|| store.ui.cardStack.parentElement
|
||||
|| store.ui.cardStack;
|
||||
function handleQueueHeaderScroll(scrollEl) {
|
||||
if (!stickyHeaderGroupEl) return;
|
||||
|
||||
const currentScroll = scrollEl.scrollTop;
|
||||
const searchContainer = stickyHeaderGroupEl.querySelector(".comfy-sidebar-search-container");
|
||||
const searchIsOpen = searchContainer && searchContainer.style.display !== "none";
|
||||
|
||||
// Keep the frosted surface visible while search is open, matching Gallery.
|
||||
stickyHeaderGroupEl.classList.toggle("is-scrolled", currentScroll > 35);
|
||||
|
||||
if (searchIsOpen) {
|
||||
lastScrollTop = currentScroll;
|
||||
scrollDeltaAccumulator = 0;
|
||||
stickyHeaderGroupEl.style.transform = "translateY(0)";
|
||||
isHeaderHidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const delta = currentScroll - lastScrollTop;
|
||||
lastScrollTop = currentScroll;
|
||||
|
||||
if (currentScroll <= 35) {
|
||||
stickyHeaderGroupEl.classList.remove("is-scrolled");
|
||||
if (isHeaderHidden) {
|
||||
stickyHeaderGroupEl.style.transform = "translateY(0)";
|
||||
isHeaderHidden = false;
|
||||
}
|
||||
scrollDeltaAccumulator = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
stickyHeaderGroupEl.classList.add("is-scrolled");
|
||||
|
||||
if (delta > 0) {
|
||||
if (scrollDeltaAccumulator < 0) scrollDeltaAccumulator = 0;
|
||||
scrollDeltaAccumulator += delta;
|
||||
|
||||
if (scrollDeltaAccumulator > 25 && !isHeaderHidden) {
|
||||
stickyHeaderGroupEl.style.transform = "translateY(-100%)";
|
||||
isHeaderHidden = true;
|
||||
}
|
||||
} else if (delta < 0) {
|
||||
if (scrollDeltaAccumulator > 0) scrollDeltaAccumulator = 0;
|
||||
scrollDeltaAccumulator += delta;
|
||||
|
||||
if (scrollDeltaAccumulator < -15 && isHeaderHidden) {
|
||||
stickyHeaderGroupEl.style.transform = "translateY(0)";
|
||||
isHeaderHidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateScrollTopBtnVisibility() {
|
||||
@@ -103,7 +154,7 @@ function updateScrollTopBtnVisibility() {
|
||||
scrollToTopBtnEl.style.display = "none";
|
||||
return;
|
||||
}
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) {
|
||||
const viewportEl = scrollEl.parentElement || store.ui.sidebarContainer;
|
||||
if (viewportEl && scrollToTopBtnEl.parentNode !== viewportEl) {
|
||||
@@ -118,6 +169,8 @@ function updateScrollTopBtnVisibility() {
|
||||
} else {
|
||||
scrollToTopBtnEl.style.display = "none";
|
||||
}
|
||||
|
||||
handleQueueHeaderScroll(scrollEl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +219,8 @@ export function setupSidebarView() {
|
||||
|
||||
Object.assign(container.style, {
|
||||
display: "flex", flexDirection: "column", height: "100%", padding: "14px", boxSizing: "border-box",
|
||||
background: "var(--comfy-menu-bg, #121212)", color: "var(--fg-color, #eee)", position: "relative"
|
||||
background: "transparent",
|
||||
color: "var(--fg-color, var(--p-text-color, #eee))", position: "relative"
|
||||
});
|
||||
|
||||
const header = document.createElement("div");
|
||||
@@ -208,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;
|
||||
@@ -216,9 +272,10 @@ export function setupSidebarView() {
|
||||
let timeout = null, isPending = false;
|
||||
const reset = () => {
|
||||
isPending = false;
|
||||
btn.title = tooltip;
|
||||
Object.assign(btn.style, {
|
||||
color: "var(--desc-color, #aaa)", background: "transparent",
|
||||
borderColor: "var(--border-color, #555)", boxShadow: "none"
|
||||
color: "", background: "",
|
||||
borderColor: "", boxShadow: ""
|
||||
});
|
||||
if (timeout) { clearTimeout(timeout); timeout = null; }
|
||||
};
|
||||
@@ -226,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,
|
||||
@@ -255,13 +315,9 @@ 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-color, #444)",
|
||||
width: "1px", height: "14px", background: "var(--border, var(--border-color, #444))",
|
||||
margin: "0 2px", opacity: "0.6"
|
||||
});
|
||||
|
||||
@@ -270,23 +326,37 @@ 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);
|
||||
|
||||
const searchContainer = document.createElement("div");
|
||||
searchContainer.className = "comfy-sidebar-search-container";
|
||||
Object.assign(searchContainer.style, {
|
||||
display: "none", width: "100%", alignItems: "center", background: "var(--comfy-input-bg, #181818)",
|
||||
border: "1px solid var(--border-color, #555)", borderRadius: "4px", padding: "2px 8px",
|
||||
display: "none", width: "100%", alignItems: "center",
|
||||
background: "var(--card, var(--secondary, var(--comfy-input-bg, #181818)))",
|
||||
border: "1px solid var(--border, var(--border-color, #555))", borderRadius: "4px", padding: "2px 8px",
|
||||
boxSizing: "border-box", height: "26px"
|
||||
});
|
||||
const searchInputIcon = document.createElement("span");
|
||||
@@ -309,7 +379,12 @@ export function setupSidebarView() {
|
||||
|
||||
header.appendChild(standardHeader);
|
||||
header.appendChild(searchContainer);
|
||||
container.appendChild(header);
|
||||
|
||||
const stickyHeaderGroup = document.createElement("div");
|
||||
stickyHeaderGroup.className = "comfy-sidebar-sticky-header-group";
|
||||
stickyHeaderGroupEl = stickyHeaderGroup;
|
||||
stickyHeaderGroup.appendChild(header);
|
||||
container.appendChild(stickyHeaderGroup);
|
||||
|
||||
searchIcon.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
@@ -340,7 +415,7 @@ export function setupSidebarView() {
|
||||
overflowY: "visible",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
paddingBottom: "28px"
|
||||
paddingBottom: "46px"
|
||||
});
|
||||
container.appendChild(cardStack);
|
||||
|
||||
@@ -350,17 +425,20 @@ export function setupSidebarView() {
|
||||
|
||||
scrollToTopBtnEl.addEventListener("click", (e) => {
|
||||
e.stopPropagation();
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) scrollEl.scrollTo({ top: 0, behavior: "smooth" });
|
||||
});
|
||||
|
||||
container.appendChild(scrollToTopBtnEl);
|
||||
|
||||
// Reveal Spotlight: track cursor position over Queue card borders
|
||||
setupSpotlightTracker(container, ".comfy-sidebar-card");
|
||||
|
||||
document.addEventListener("scroll", updateScrollTopBtnVisibility, { capture: true, passive: true });
|
||||
|
||||
new ResizeObserver((entries) => {
|
||||
const threshold = app.ui?.settings?.getSettingValue?.(SettingIds.GRID_COLUMNS_THRESHOLD) ?? 350;
|
||||
const cols = Math.max(1, Math.floor(entries[0].contentRect.width / (threshold / 2)));
|
||||
const threshold = getSetting(SettingIds.GRID_COLUMNS_THRESHOLD, 350);
|
||||
const cols = calculateGridColumns(entries[0].contentRect.width, threshold);
|
||||
if (cols !== currentColumnCount) {
|
||||
currentColumnCount = cols;
|
||||
renderSidebar();
|
||||
@@ -399,8 +477,8 @@ export function renderSidebar() {
|
||||
renderAnimationFrameId = requestAnimationFrame(() => {
|
||||
if (!store.ui.sidebarContainer || !store.ui.cardStack) return;
|
||||
|
||||
const showPendingSummary = app.ui?.settings?.getSettingValue?.(SettingIds.SHOW_PENDING_COUNT_ONLY) ?? true;
|
||||
const showWorkingNode = app.ui?.settings?.getSettingValue?.(SettingIds.SHOW_WORKING_NODE_NAME) ?? true;
|
||||
const showPendingSummary = getSetting(SettingIds.SHOW_PENDING_COUNT_ONLY, true);
|
||||
const showWorkingNode = getSetting(SettingIds.SHOW_WORKING_NODE_NAME, true);
|
||||
|
||||
const headerTitle = store.ui.sidebarContainer.querySelector("h3");
|
||||
const headerSearchIcon = store.ui.sidebarContainer.querySelector(".comfy-sidebar-header-root .pi-search");
|
||||
@@ -485,81 +563,69 @@ export function renderSidebar() {
|
||||
|
||||
const btnDel = document.createElement("span");
|
||||
btnDel.className = "pi pi-trash comfy-sidebar-card-action-btn comfy-sidebar-btn-del";
|
||||
btnDel.title = t("Remove from batch (Hold Ctrl to delete file from disk)");
|
||||
const btnDelLabel = document.createElement("span");
|
||||
btnDelLabel.className = "comfy-sidebar-del-label";
|
||||
btnDelLabel.textContent = t("Delete File");
|
||||
btnDel.appendChild(btnDelLabel);
|
||||
|
||||
let isDeletePending = false, isDiskDelete = false, deleteTimeout = null;
|
||||
const resetDelete = () => {
|
||||
isDeletePending = false;
|
||||
isDiskDelete = false;
|
||||
btnDel.classList.remove("confirm-delete", "confirm-delete-disk");
|
||||
btnDel.title = t("Remove from batch (Hold Ctrl to delete file from disk)");
|
||||
if (deleteTimeout) { clearTimeout(deleteTimeout); deleteTimeout = null; }
|
||||
};
|
||||
|
||||
btnDel.onclick = async (ev) => {
|
||||
ev.stopPropagation();
|
||||
const wantsDiskDelete = ev.ctrlKey || ev.metaKey;
|
||||
|
||||
if (!isDeletePending) {
|
||||
isDeletePending = true;
|
||||
isDiskDelete = wantsDiskDelete;
|
||||
cardObj.btnDel.classList.add(wantsDiskDelete ? "confirm-delete-disk" : "confirm-delete");
|
||||
cardObj.btnDel.title = wantsDiskDelete
|
||||
? t("Ctrl+Click again to delete file from DISK / TRASH")
|
||||
: t("Click again to confirm removing from batch");
|
||||
deleteTimeout = setTimeout(resetDelete, 2000);
|
||||
} else {
|
||||
const shouldDeleteFromDisk = isDiskDelete || wantsDiskDelete;
|
||||
resetDelete();
|
||||
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) => {
|
||||
// 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) {
|
||||
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"));
|
||||
}
|
||||
if (!(await deleteFilesWithFeedback([img], t("Delete File")))) return;
|
||||
}
|
||||
|
||||
const pid = batchInfo.parentPromptId || batchInfo.pid;
|
||||
const state = store.getPrompt(pid);
|
||||
const imgIdx = batchInfo.images.indexOf(img);
|
||||
if (imgIdx > -1) batchInfo.images.splice(imgIdx, 1);
|
||||
animateCardRemoval(card, async () => {
|
||||
const pid = batchInfo.parentPromptId || batchInfo.pid;
|
||||
const state = store.getPrompt(pid);
|
||||
const imgIdx = batchInfo.images.indexOf(img);
|
||||
if (imgIdx > -1) batchInfo.images.splice(imgIdx, 1);
|
||||
|
||||
if (state) {
|
||||
if (Array.isArray(state.images)) {
|
||||
const stIdx = state.images.findIndex(i => i.filename === img.filename && (i.subfolder || "") === (img.subfolder || ""));
|
||||
if (stIdx > -1) state.images.splice(stIdx, 1);
|
||||
if (state) {
|
||||
if (Array.isArray(state.images)) {
|
||||
const stIdx = state.images.findIndex(i => i.filename === img.filename && (i.subfolder || "") === (img.subfolder || ""));
|
||||
if (stIdx > -1) state.images.splice(stIdx, 1);
|
||||
}
|
||||
if (state.nodeOutputs) {
|
||||
removeImageFromNodeOutputs(state.nodeOutputs, img);
|
||||
}
|
||||
state.rendered = false;
|
||||
store.updatePrompt(pid, state);
|
||||
}
|
||||
if (state.nodeOutputs) {
|
||||
removeImageFromNodeOutputs(state.nodeOutputs, img);
|
||||
|
||||
const mainCardObj = cardPool.get(pid);
|
||||
if (mainCardObj) {
|
||||
mainCardObj.currentImageIndex = 0;
|
||||
mainCardObj.lastImagesSignature = "";
|
||||
}
|
||||
state.rendered = false;
|
||||
store.updatePrompt(pid, state);
|
||||
}
|
||||
|
||||
const mainCardObj = cardPool.get(pid);
|
||||
if (mainCardObj) {
|
||||
mainCardObj.currentImageIndex = 0;
|
||||
mainCardObj.lastImagesSignature = "";
|
||||
}
|
||||
|
||||
if (batchInfo.images.length === 0) {
|
||||
if (batchInfo.parentPromptId) {
|
||||
store.openOutputsSubmenu(batchInfo.parentPromptId);
|
||||
} else {
|
||||
store.closeSubmenu();
|
||||
if (batchInfo.images.length === 0) {
|
||||
if (batchInfo.parentPromptId) {
|
||||
store.openOutputsSubmenu(batchInfo.parentPromptId);
|
||||
} else {
|
||||
store.closeSubmenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderSidebar();
|
||||
renderSidebar();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
hoverPanel.append(btnImg, btnDel);
|
||||
hoverPanel.append(btnImg, btnMove, btnDel);
|
||||
|
||||
const leftHoverPanel = document.createElement("div");
|
||||
leftHoverPanel.className = "comfy-sidebar-left-hover-panel";
|
||||
@@ -618,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,
|
||||
@@ -638,7 +748,7 @@ export function renderSidebar() {
|
||||
|
||||
mountCards(store.ui.cardStack, [], targetElements, currentColumnCount);
|
||||
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) scrollEl.scrollTop = 0;
|
||||
updateScrollTopBtnVisibility();
|
||||
return;
|
||||
@@ -756,70 +866,48 @@ export function renderSidebar() {
|
||||
|
||||
const btnDel = document.createElement("span");
|
||||
btnDel.className = "pi pi-trash comfy-sidebar-card-action-btn comfy-sidebar-btn-del";
|
||||
btnDel.title = t("Delete node output (Hold Ctrl to delete file from disk)");
|
||||
const btnDelLabel = document.createElement("span");
|
||||
btnDelLabel.className = "comfy-sidebar-del-label";
|
||||
btnDelLabel.textContent = t("Delete File");
|
||||
btnDel.appendChild(btnDelLabel);
|
||||
|
||||
let isDeletePending = false, isDiskDelete = false, deleteTimeout = null;
|
||||
const resetDelete = () => {
|
||||
isDeletePending = false;
|
||||
isDiskDelete = false;
|
||||
btnDel.classList.remove("confirm-delete", "confirm-delete-disk");
|
||||
btnDel.title = t("Delete node output (Hold Ctrl to delete file from disk)");
|
||||
if (deleteTimeout) { clearTimeout(deleteTimeout); deleteTimeout = null; }
|
||||
};
|
||||
|
||||
btnDel.onclick = async (ev) => {
|
||||
ev.stopPropagation();
|
||||
const wantsDiskDelete = ev.ctrlKey || ev.metaKey;
|
||||
|
||||
if (!isDeletePending) {
|
||||
isDeletePending = true;
|
||||
isDiskDelete = wantsDiskDelete;
|
||||
btnDel.classList.add(wantsDiskDelete ? "confirm-delete-disk" : "confirm-delete");
|
||||
btnDel.title = wantsDiskDelete
|
||||
? t("Ctrl+Click again to delete this node's files from DISK / TRASH")
|
||||
: t("Click again to confirm removing output");
|
||||
deleteTimeout = setTimeout(resetDelete, 2000);
|
||||
} else {
|
||||
const shouldDeleteFromDisk = isDiskDelete || wantsDiskDelete;
|
||||
resetDelete();
|
||||
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) => {
|
||||
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 (!(await deleteFilesWithFeedback(out.images))) return;
|
||||
}
|
||||
|
||||
animateCardRemoval(card, async () => {
|
||||
if (st.nodeOutputs && st.nodeOutputs[out.nodeId]) {
|
||||
delete st.nodeOutputs[out.nodeId];
|
||||
}
|
||||
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");
|
||||
|
||||
const remainingOutputs = getRunOutputs(st.nodeOutputs, st.workflow);
|
||||
if (remainingOutputs.length > 0) {
|
||||
st.images = remainingOutputs[remainingOutputs.length - 1].images || [];
|
||||
} else {
|
||||
st.images = [];
|
||||
store.closeSubmenu();
|
||||
}
|
||||
}
|
||||
|
||||
if (st.nodeOutputs && st.nodeOutputs[out.nodeId]) {
|
||||
delete st.nodeOutputs[out.nodeId];
|
||||
}
|
||||
|
||||
const remainingOutputs = getRunOutputs(st.nodeOutputs, st.workflow);
|
||||
if (remainingOutputs.length > 0) {
|
||||
st.images = remainingOutputs[remainingOutputs.length - 1].images || [];
|
||||
} else {
|
||||
st.images = [];
|
||||
store.closeSubmenu();
|
||||
}
|
||||
|
||||
store.updatePrompt(st.pid, st);
|
||||
renderSidebar();
|
||||
store.updatePrompt(st.pid, st);
|
||||
renderSidebar();
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
hoverPanel.append(btnImg, btnDel);
|
||||
hoverPanel.append(btnImg, btnMove, btnDel);
|
||||
|
||||
const leftHoverPanel = document.createElement("div");
|
||||
leftHoverPanel.className = "comfy-sidebar-left-hover-panel";
|
||||
@@ -874,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, {
|
||||
@@ -891,7 +1022,7 @@ export function renderSidebar() {
|
||||
nodeOutputs: st.nodeOutputs
|
||||
}, () => {
|
||||
// Clicking (1/N) opens batch drill-down for this specific intermediate node
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) {
|
||||
store.ui.mainQueueScrollTop = scrollEl.scrollTop;
|
||||
}
|
||||
@@ -960,18 +1091,15 @@ export function renderSidebar() {
|
||||
if (!pCard) {
|
||||
const el = document.createElement("div");
|
||||
Object.assign(el.style, {
|
||||
background: "var(--comfy-input-bg, #181818)", border: "2px solid #6c757d", borderRadius: "4px", padding: "10px",
|
||||
background: "var(--card, var(--secondary, var(--comfy-input-bg, #181818)))", border: "2px solid var(--border, #6c757d)", borderRadius: "4px", padding: "10px",
|
||||
textAlign: "center", fontSize: "12px", fontWeight: "bold",
|
||||
color: "var(--desc-color, #aaa)", display: "flex", flexDirection: "column", gap: "8px"
|
||||
color: "var(--muted-foreground, var(--desc-color, #aaa))", display: "flex", flexDirection: "column", gap: "8px"
|
||||
});
|
||||
const textDiv = document.createElement("div");
|
||||
el.appendChild(textDiv);
|
||||
const cancelBtn = document.createElement("button");
|
||||
cancelBtn.className = "comfy-sidebar-cancel-all-btn";
|
||||
cancelBtn.textContent = t("Cancel All Pending");
|
||||
Object.assign(cancelBtn.style, {
|
||||
background: "#dc3545", color: "white", border: "none", borderRadius: "3px", padding: "4px",
|
||||
cursor: "pointer", fontSize: "11px", fontWeight: "bold"
|
||||
});
|
||||
cancelBtn.onclick = async () => {
|
||||
await cancelAllPending();
|
||||
};
|
||||
@@ -985,11 +1113,8 @@ export function renderSidebar() {
|
||||
let btnCard = cardPool.get("pending-cancel-all-standalone");
|
||||
if (!btnCard) {
|
||||
const btn = document.createElement("button");
|
||||
btn.className = "comfy-sidebar-cancel-all-btn";
|
||||
btn.textContent = t("Cancel All Pending");
|
||||
Object.assign(btn.style, {
|
||||
background: "#dc3545", color: "white", border: "none", borderRadius: "3px", padding: "6px",
|
||||
cursor: "pointer", fontSize: "11px", fontWeight: "bold", width: "100%"
|
||||
});
|
||||
btn.onclick = async () => {
|
||||
await cancelAllPending();
|
||||
};
|
||||
@@ -1004,10 +1129,10 @@ export function renderSidebar() {
|
||||
activeTasks.forEach(st => cardElements.push(syncTaskCard(st)));
|
||||
completedTasks.forEach(st => cardElements.push(syncTaskCard(st)));
|
||||
|
||||
const threshold = app.ui?.settings?.getSettingValue?.(SettingIds.GRID_COLUMNS_THRESHOLD) ?? 350;
|
||||
const threshold = getSetting(SettingIds.GRID_COLUMNS_THRESHOLD, 350);
|
||||
const containerWidth = store.ui.sidebarContainer?.clientWidth || 0;
|
||||
if (containerWidth > 0) {
|
||||
currentColumnCount = Math.max(1, Math.floor(containerWidth / (threshold / 2)));
|
||||
currentColumnCount = calculateGridColumns(containerWidth, threshold);
|
||||
}
|
||||
|
||||
mountCards(store.ui.cardStack, bannerElements, cardElements, currentColumnCount);
|
||||
@@ -1015,7 +1140,7 @@ export function renderSidebar() {
|
||||
if (store.ui.mainQueueScrollTop !== null) {
|
||||
const restorePos = store.ui.mainQueueScrollTop;
|
||||
store.ui.mainQueueScrollTop = null;
|
||||
const scrollEl = getScrollContainer();
|
||||
const scrollEl = getScrollContainer(store.ui.cardStack);
|
||||
if (scrollEl) {
|
||||
scrollEl.scrollTop = restorePos;
|
||||
requestAnimationFrame(() => { scrollEl.scrollTop = restorePos; });
|
||||
@@ -1042,4 +1167,8 @@ export function teardownSidebarView() {
|
||||
renderAnimationFrameId = null;
|
||||
}
|
||||
cardPool.clear();
|
||||
if (scrollToTopBtnEl && scrollToTopBtnEl.parentNode) {
|
||||
scrollToTopBtnEl.parentNode.removeChild(scrollToTopBtnEl);
|
||||
}
|
||||
scrollToTopBtnEl = null;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
@@ -328,6 +375,7 @@ function createAudioViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = () =>
|
||||
const createMediaElement = (src, muted = false) => {
|
||||
const isVideo = isVideoFormat(src);
|
||||
const el = isVideo ? document.createElement("video") : document.createElement("img");
|
||||
el.className = "comfy-sidebar-comparison-media";
|
||||
if (isVideo) {
|
||||
el.muted = muted;
|
||||
el.playsInline = true;
|
||||
@@ -345,7 +393,10 @@ const createMediaElement = (src, muted = false) => {
|
||||
pointerEvents: isVideo ? "none" : "auto",
|
||||
userSelect: "none",
|
||||
webkitUserSelect: "none",
|
||||
display: "block"
|
||||
display: "block",
|
||||
border: "none",
|
||||
outline: "none",
|
||||
boxShadow: "none"
|
||||
});
|
||||
el.draggable = false;
|
||||
el.ondragstart = (e) => e.preventDefault();
|
||||
@@ -367,11 +418,11 @@ const setupVideoPlayback = (vid, container) => {
|
||||
Object.assign(controlBar.style, {
|
||||
position: "absolute", bottom: "16px", left: "50%",
|
||||
display: "flex", alignItems: "center", gap: "12px",
|
||||
background: "var(--comfy-input-bg, rgba(18, 18, 18, 0.9))",
|
||||
border: "1px solid var(--border-color, rgba(255, 255, 255, 0.15))",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, #181818)) 90%, transparent)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
padding: "8px 16px", borderRadius: "8px", zIndex: "40", fontSize: "11px",
|
||||
fontFamily: "monospace",
|
||||
color: "var(--fg-color, #eee)",
|
||||
color: "var(--foreground, var(--fg-color, #eee))",
|
||||
width: "80%", maxWidth: "500px",
|
||||
boxShadow: "0 4px 12px rgba(0,0,0,0.3)", transform: "translate3d(-50%, 0, 0)",
|
||||
pointerEvents: "auto"
|
||||
@@ -398,7 +449,7 @@ const setupVideoPlayback = (vid, container) => {
|
||||
position: "relative", cursor: "pointer"
|
||||
});
|
||||
const scrubberFill = document.createElement("div");
|
||||
Object.assign(scrubberFill.style, { width: "0%", height: "100%", background: "#3b82f6", borderRadius: "2px" });
|
||||
Object.assign(scrubberFill.style, { width: "0%", height: "100%", background: "var(--primary, var(--p-primary-color, #38bdf8))", borderRadius: "2px" });
|
||||
scrubberContainer.appendChild(scrubberFill);
|
||||
|
||||
const timeLabel = document.createElement("span");
|
||||
@@ -459,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);
|
||||
}
|
||||
@@ -492,12 +557,12 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
|
||||
Object.assign(header.style, {
|
||||
position: "absolute", top: "16px", left: "50%", transform: "translateX(-50%)",
|
||||
display: "flex", gap: "16px", zIndex: "30",
|
||||
color: "var(--desc-color, #aaa)",
|
||||
color: "var(--muted-foreground, var(--desc-color, #aaa))",
|
||||
fontSize: "12px",
|
||||
fontFamily: "sans-serif", pointerEvents: "none",
|
||||
background: "var(--comfy-input-bg, rgba(18, 18, 18, 0.85))",
|
||||
border: "1px solid var(--border-color, rgba(255, 255, 255, 0.15))",
|
||||
padding: "6px 14px", borderRadius: "6px", backdropFilter: "blur(6px)",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, #181818)) 90%, transparent)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
padding: "6px 14px", borderRadius: "6px", backdropFilter: "blur(8px)",
|
||||
boxShadow: "0 2px 8px rgba(0,0,0,0.3)", maxWidth: "85%", textAlign: "center"
|
||||
});
|
||||
const infoText = document.createElement("span");
|
||||
@@ -546,7 +611,7 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
<svg width="60" height="60" viewBox="0 0 24 24" fill="none" stroke="#3b82f6" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="animation: comfy-sidebar-spin 1.3s linear infinite; filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.45));">
|
||||
<svg width="60" height="60" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="color: var(--primary, var(--p-primary-color, #38bdf8)); animation: comfy-sidebar-spin 1.3s linear infinite; filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.45));">
|
||||
<path d="M21 12a9 9 0 1 1-6.219-8.56"/>
|
||||
</svg>
|
||||
`;
|
||||
@@ -571,26 +636,31 @@ 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, {
|
||||
position: "absolute", top: "0", bottom: "0", left: "50%",
|
||||
width: "2px", background: "#fff", cursor: "ew-resize",
|
||||
width: "2px",
|
||||
background: "var(--foreground, #ffffff)",
|
||||
cursor: "ew-resize",
|
||||
zIndex: "25", display: "none", pointerEvents: "auto",
|
||||
boxShadow: "0 0 8px rgba(0,0,0,0.5)"
|
||||
boxShadow: "0 0 6px rgba(0,0,0,0.6)"
|
||||
});
|
||||
const sliderButton = document.createElement("div");
|
||||
sliderButton.className = "comfy-sidebar-comparison-handle";
|
||||
Object.assign(sliderButton.style, {
|
||||
position: "absolute", top: "50%", left: "50%",
|
||||
transform: "translate(-50%, -50%)", width: "32px", height: "32px",
|
||||
borderRadius: "50%", background: "#fff", color: "#333",
|
||||
borderRadius: "50%",
|
||||
background: "var(--card, var(--secondary, rgba(30, 30, 30, 0.9)))",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
color: "var(--foreground, #eee)",
|
||||
display: "flex", alignItems: "center", justifyContent: "center",
|
||||
boxShadow: "0 2px 6px rgba(0,0,0,0.4)", pointerEvents: "auto"
|
||||
boxShadow: "0 4px 12px rgba(0,0,0,0.5)", pointerEvents: "auto",
|
||||
cursor: "ew-resize",
|
||||
transition: "background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out"
|
||||
});
|
||||
sliderButton.innerHTML = `<span class="pi pi-arrows-h" style="font-size: 12px;"></span>`;
|
||||
sliderButton.innerHTML = `<span class="pi pi-arrows-h" style="font-size: 13px; pointer-events: none;"></span>`;
|
||||
slider.appendChild(sliderButton);
|
||||
wrapper.appendChild(slider);
|
||||
|
||||
@@ -610,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);
|
||||
@@ -633,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`;
|
||||
@@ -762,7 +844,7 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
|
||||
}
|
||||
|
||||
const toggleZoom = () => {
|
||||
if (isBaseVideo) return;
|
||||
if (isBaseVideo || isRuntimePreviewActive) return;
|
||||
isZoomed = !isZoomed;
|
||||
syncImageScales();
|
||||
if (!isZoomed) {
|
||||
@@ -847,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) {
|
||||
@@ -901,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;
|
||||
|
||||
@@ -992,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;
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
import { SettingIds } from "../core/constants.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
|
||||
/**
|
||||
* Makes hotkeys work regardless of the active keyboard layout.
|
||||
*
|
||||
* ComfyUI's keybinding system matches on `KeyboardEvent.key`, which follows the active layout:
|
||||
* with a Russian layout, physical Q produces "й", so a binding on "q" never fires.
|
||||
* `KeyboardEvent.code` is the physical key ("KeyQ") and does not change with the layout.
|
||||
*
|
||||
* Strategy: in the capture phase on `window` (which runs before ComfyUI's own `keydown` listener),
|
||||
* if `key` is a single non-ASCII character, swallow the event and re-dispatch an identical one
|
||||
* whose `key` is the US-QWERTY character for that physical key. Everything downstream (keybindings,
|
||||
* LiteGraph shortcuts, other extensions) then sees plain Latin keys.
|
||||
*
|
||||
* Deliberately NOT touched:
|
||||
* - layouts that already report ASCII keys (QWERTY, AZERTY, Dvorak...), so their users keep
|
||||
* their own mapping;
|
||||
* - text fields (input / textarea / select / contenteditable / LiteGraph property values),
|
||||
* so typing in any language keeps working;
|
||||
* - IME composition;
|
||||
* - named keys such as "Enter", "Escape", "Dead".
|
||||
*/
|
||||
|
||||
// Unshifted / shifted characters of the US-QWERTY layout for non-letter keys.
|
||||
const SYMBOL_KEYS = {
|
||||
Backquote: ["`", "~"],
|
||||
Minus: ["-", "_"],
|
||||
Equal: ["=", "+"],
|
||||
BracketLeft: ["[", "{"],
|
||||
BracketRight: ["]", "}"],
|
||||
Backslash: ["\\", "|"],
|
||||
Semicolon: [";", ":"],
|
||||
Quote: ["'", "\""],
|
||||
Comma: [",", "<"],
|
||||
Period: [".", ">"],
|
||||
Slash: ["/", "?"],
|
||||
Digit1: ["1", "!"],
|
||||
Digit2: ["2", "@"],
|
||||
Digit3: ["3", "#"],
|
||||
Digit4: ["4", "$"],
|
||||
Digit5: ["5", "%"],
|
||||
Digit6: ["6", "^"],
|
||||
Digit7: ["7", "&"],
|
||||
Digit8: ["8", "*"],
|
||||
Digit9: ["9", "("],
|
||||
Digit0: ["0", ")"]
|
||||
};
|
||||
|
||||
/** Returns the US-QWERTY `key` for the physical key of this event, or null if unknown. */
|
||||
export function latinKeyFromEvent(e) {
|
||||
const letter = /^Key([A-Z])$/.exec(e.code || "");
|
||||
if (letter) return e.shiftKey ? letter[1] : letter[1].toLowerCase();
|
||||
|
||||
const pair = SYMBOL_KEYS[e.code];
|
||||
if (pair) return e.shiftKey ? pair[1] : pair[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function isSingleNonAsciiChar(key) {
|
||||
if (typeof key !== "string") return false;
|
||||
const chars = Array.from(key);
|
||||
return chars.length === 1 && chars[0].codePointAt(0) > 127;
|
||||
}
|
||||
|
||||
function isTextEntryTarget(el) {
|
||||
if (!el || el.nodeType !== 1) return false;
|
||||
const tag = el.tagName;
|
||||
return (
|
||||
tag === "INPUT" ||
|
||||
tag === "TEXTAREA" ||
|
||||
tag === "SELECT" ||
|
||||
el.isContentEditable ||
|
||||
// LiteGraph's inline value editors are spans
|
||||
(tag === "SPAN" && el.classList.contains("property_value"))
|
||||
);
|
||||
}
|
||||
|
||||
export function setupLatinHotkeys() {
|
||||
// Events we dispatched ourselves; used to avoid handling them again.
|
||||
const synthetic = new WeakSet();
|
||||
|
||||
const handler = (e) => {
|
||||
if (synthetic.has(e)) return;
|
||||
if (e.isComposing || e.keyCode === 229) return;
|
||||
if (!isSingleNonAsciiChar(e.key)) return;
|
||||
if (!getSetting(SettingIds.LATIN_HOTKEYS, true)) return;
|
||||
|
||||
const latinKey = latinKeyFromEvent(e);
|
||||
if (!latinKey) return;
|
||||
|
||||
const target = e.composedPath?.()[0] ?? e.target;
|
||||
if (isTextEntryTarget(target)) return;
|
||||
|
||||
const clone = new KeyboardEvent(e.type, {
|
||||
key: latinKey,
|
||||
code: e.code,
|
||||
location: e.location,
|
||||
repeat: e.repeat,
|
||||
ctrlKey: e.ctrlKey,
|
||||
shiftKey: e.shiftKey,
|
||||
altKey: e.altKey,
|
||||
metaKey: e.metaKey,
|
||||
keyCode: e.keyCode,
|
||||
which: e.which,
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
composed: true,
|
||||
view: window
|
||||
});
|
||||
synthetic.add(clone);
|
||||
|
||||
e.stopImmediatePropagation();
|
||||
const notPrevented = (target || document).dispatchEvent(clone);
|
||||
if (!notPrevented) e.preventDefault();
|
||||
};
|
||||
|
||||
window.addEventListener("keydown", handler, true);
|
||||
window.addEventListener("keyup", handler, true);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("keydown", handler, true);
|
||||
window.removeEventListener("keyup", handler, true);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,562 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import { api } from "/scripts/api.js";
|
||||
import { SettingIds } from "../core/constants.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
import { t } from "../core/i18n.js";
|
||||
import { setupSpotlightTracker } from "./utils.js";
|
||||
|
||||
function isTemporaryWorkflow(wf) {
|
||||
if (!wf) return false;
|
||||
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;
|
||||
|
||||
const direct = target.closest(".new-blank-workflow-button");
|
||||
if (direct) return direct;
|
||||
|
||||
const btn = target.closest('button, [role="button"]');
|
||||
if (!btn) return null;
|
||||
|
||||
const tabsContainer = btn.closest(".workflow-tabs-container, .workflow-tabs");
|
||||
if (!tabsContainer) return null;
|
||||
if (btn.closest('.workflow-tab, [role="tab"], .p-togglebutton')) return null;
|
||||
|
||||
const label = (btn.getAttribute("aria-label") || btn.getAttribute("title") || "").toLowerCase();
|
||||
if (label.includes("blank workflow") || label.includes("new workflow")) {
|
||||
return btn;
|
||||
}
|
||||
|
||||
if (btn.querySelector('.pi-plus, [class*="lucide--plus"], svg.lucide-plus')) {
|
||||
return btn;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function findFallbackAnchorRect() {
|
||||
const activeTab = document.querySelector('.workflow-tabs-container [role="tab"][data-state="active"], [role="tab"][data-state="active"]');
|
||||
if (activeTab) {
|
||||
const r = activeTab.getBoundingClientRect();
|
||||
if (r.width > 0) return { left: r.left, bottom: r.bottom };
|
||||
}
|
||||
const plusBtn = document.querySelector(".new-blank-workflow-button");
|
||||
if (plusBtn) {
|
||||
const r = plusBtn.getBoundingClientRect();
|
||||
if (r.width > 0) return { left: r.left, bottom: r.bottom };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function fetchSavedWorkflows() {
|
||||
const seen = new Set();
|
||||
const items = [];
|
||||
|
||||
const addEntry = (rawPath) => {
|
||||
if (!rawPath || typeof rawPath !== "string") return;
|
||||
let rel = rawPath.replace(/\\/g, "/").replace(/^\/+/, "");
|
||||
if (rel.startsWith("workflows/")) {
|
||||
rel = rel.slice("workflows/".length);
|
||||
}
|
||||
if (!rel.toLowerCase().endsWith(".json")) return;
|
||||
|
||||
const parts = rel.split("/");
|
||||
if (parts.some(p => !p || p.startsWith("."))) return;
|
||||
|
||||
if (seen.has(rel)) return;
|
||||
seen.add(rel);
|
||||
|
||||
const fileNameWithExt = parts[parts.length - 1];
|
||||
const displayName = fileNameWithExt.replace(/\.json$/i, "");
|
||||
const folder = parts.length > 1 ? parts.slice(0, -1).join("/") : "";
|
||||
|
||||
items.push({
|
||||
relPath: rel,
|
||||
fullPath: `workflows/${rel}`,
|
||||
displayName,
|
||||
folder,
|
||||
searchStr: rel.replace(/\.json$/i, "").toLowerCase()
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await api.fetchApi("/userdata?dir=workflows&recurse=true");
|
||||
if (res.ok) {
|
||||
const list = await res.json();
|
||||
if (Array.isArray(list)) {
|
||||
for (const entry of list) {
|
||||
if (typeof entry === "string") {
|
||||
addEntry(entry);
|
||||
} else if (entry && typeof entry.path === "string") {
|
||||
addEntry(entry.path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("[ComfySidebar] Failed to list saved workflows via API:", e);
|
||||
}
|
||||
|
||||
const wfMgr = app.extensionManager?.workflow;
|
||||
const storeList = wfMgr?.persistedWorkflows || wfMgr?.workflows || [];
|
||||
for (const wf of storeList) {
|
||||
if (wf && wf.isPersisted !== false && !wf.isTemporary && wf.path) {
|
||||
addEntry(wf.path);
|
||||
}
|
||||
}
|
||||
|
||||
items.sort((a, b) => a.displayName.localeCompare(b.displayName, undefined, { sensitivity: "base" }));
|
||||
return items;
|
||||
}
|
||||
|
||||
function filterWorkflows(allItems, rawQuery) {
|
||||
const q = rawQuery.trim().toLowerCase();
|
||||
if (!q) return [];
|
||||
|
||||
const tokens = q.split(/\s+/).filter(Boolean);
|
||||
const matches = [];
|
||||
|
||||
for (const item of allItems) {
|
||||
const nameLower = item.displayName.toLowerCase();
|
||||
if (!tokens.every(tok => item.searchStr.includes(tok))) continue;
|
||||
|
||||
let rank = 3;
|
||||
if (nameLower === q) rank = 0;
|
||||
else if (nameLower.startsWith(q)) rank = 1;
|
||||
else if (nameLower.includes(q)) rank = 2;
|
||||
|
||||
matches.push({ item, rank });
|
||||
}
|
||||
|
||||
matches.sort((a, b) => {
|
||||
if (a.rank !== b.rank) return a.rank - b.rank;
|
||||
return a.item.displayName.localeCompare(b.item.displayName, undefined, { sensitivity: "base" });
|
||||
});
|
||||
|
||||
return matches.slice(0, 30).map(m => m.item);
|
||||
}
|
||||
|
||||
export function setupNewWorkflowQuickPicker() {
|
||||
let activeTooltip = null;
|
||||
let activeCleanup = null;
|
||||
let activeSession = null;
|
||||
let isReplacing = false;
|
||||
let activeCloseCount = 0;
|
||||
let userInitiatedBlankUntil = 0;
|
||||
const promptedWorkflows = new WeakSet();
|
||||
|
||||
const closePicker = () => {
|
||||
if (activeCleanup) {
|
||||
activeCleanup();
|
||||
activeCleanup = null;
|
||||
}
|
||||
if (activeTooltip) {
|
||||
activeTooltip.remove();
|
||||
activeTooltip = null;
|
||||
}
|
||||
activeSession = null;
|
||||
};
|
||||
|
||||
const replaceUnsavedWithWorkflow = async (item, tempWf) => {
|
||||
const wfMgr = app.extensionManager?.workflow;
|
||||
const targetTemp = tempWf || (isTemporaryWorkflow(wfMgr?.activeWorkflow) ? wfMgr.activeWorkflow : null);
|
||||
|
||||
isReplacing = true;
|
||||
try {
|
||||
if (wfMgr) {
|
||||
const targetWf =
|
||||
wfMgr.getWorkflowByPath?.(item.fullPath) ||
|
||||
wfMgr.workflows?.find(w => (w.path || "").replace(/\\/g, "/") === item.fullPath);
|
||||
|
||||
if (targetWf && typeof wfMgr.openWorkflow === "function") {
|
||||
if (typeof targetWf.load === "function" && !targetWf.isLoaded) {
|
||||
try {
|
||||
await targetWf.load();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
let graphData = targetWf.changeTracker?.activeState || targetWf.activeState;
|
||||
if (!graphData) {
|
||||
const res = await api.fetchApi(`/userdata/${encodeURIComponent(item.fullPath)}`);
|
||||
if (res.ok) {
|
||||
graphData = await res.json();
|
||||
}
|
||||
}
|
||||
|
||||
const cleanGraphData = graphData ? JSON.parse(JSON.stringify(graphData)) : null;
|
||||
|
||||
const canCloseTemp =
|
||||
targetTemp &&
|
||||
targetTemp !== targetWf &&
|
||||
isTemporaryWorkflow(targetTemp) &&
|
||||
typeof wfMgr.closeWorkflow === "function";
|
||||
|
||||
await wfMgr.openWorkflow(targetWf);
|
||||
|
||||
if (canCloseTemp) {
|
||||
try {
|
||||
await wfMgr.closeWorkflow(targetTemp, { warnIfUnsaved: false });
|
||||
} catch (e) {
|
||||
console.warn("[ComfySidebar] Could not close temporary workflow tab:", e);
|
||||
}
|
||||
}
|
||||
|
||||
if (cleanGraphData) {
|
||||
await app.loadGraphData(cleanGraphData, true, true, targetWf);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const res = await api.fetchApi(`/userdata/${encodeURIComponent(item.fullPath)}`);
|
||||
if (res.ok) {
|
||||
const graphData = await res.json();
|
||||
await app.loadGraphData(graphData, true, true);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("[ComfySidebar] Failed to replace unsaved workflow:", e);
|
||||
} finally {
|
||||
isReplacing = false;
|
||||
}
|
||||
};
|
||||
|
||||
const showPicker = (anchorRect, initialTempWf = null, prevWorkflow = null) => {
|
||||
if (initialTempWf) {
|
||||
if (promptedWorkflows.has(initialTempWf)) return;
|
||||
promptedWorkflows.add(initialTempWf);
|
||||
}
|
||||
|
||||
closePicker();
|
||||
|
||||
let resolvedTempWf = initialTempWf;
|
||||
|
||||
const tooltip = document.createElement("div");
|
||||
tooltip.className = "comfy-sidebar-wf-picker";
|
||||
|
||||
const inputWrap = document.createElement("div");
|
||||
inputWrap.className = "comfy-sidebar-wf-picker-input-wrap";
|
||||
|
||||
const icon = document.createElement("i");
|
||||
icon.className = "pi pi-search comfy-sidebar-wf-picker-icon";
|
||||
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.className = "comfy-sidebar-wf-picker-input";
|
||||
input.placeholder = t("Type to load saved workflow...");
|
||||
input.autocomplete = "off";
|
||||
input.spellcheck = false;
|
||||
|
||||
inputWrap.append(icon, input);
|
||||
tooltip.appendChild(inputWrap);
|
||||
|
||||
const listEl = document.createElement("div");
|
||||
listEl.className = "comfy-sidebar-wf-picker-list";
|
||||
listEl.style.display = "none";
|
||||
setupSpotlightTracker(listEl, ".comfy-sidebar-wf-picker-item");
|
||||
tooltip.appendChild(listEl);
|
||||
|
||||
// Edge-to-edge alignment using pre-click '+' button coords (exact left edge of the new tab)
|
||||
const applyCoords = (coords) => {
|
||||
const width = tooltip.offsetWidth || 300;
|
||||
if (!coords) {
|
||||
tooltip.style.left = `${Math.round((window.innerWidth - width) / 2)}px`;
|
||||
tooltip.style.top = "52px";
|
||||
return;
|
||||
}
|
||||
const left = Math.max(12, Math.min(coords.left, window.innerWidth - width - 12));
|
||||
const top = Math.min(coords.bottom + 6, window.innerHeight - 60);
|
||||
tooltip.style.left = `${Math.round(left)}px`;
|
||||
tooltip.style.top = `${Math.round(top)}px`;
|
||||
};
|
||||
|
||||
document.body.appendChild(tooltip);
|
||||
activeTooltip = tooltip;
|
||||
applyCoords(anchorRect || findFallbackAnchorRect());
|
||||
|
||||
let cachedWorkflows = null;
|
||||
let loadingPromise = null;
|
||||
let currentMatches = [];
|
||||
let selectedIdx = -1;
|
||||
|
||||
const ensureWorkflowsLoaded = async () => {
|
||||
if (cachedWorkflows !== null) return cachedWorkflows;
|
||||
if (!loadingPromise) {
|
||||
loadingPromise = fetchSavedWorkflows().then(list => {
|
||||
cachedWorkflows = list;
|
||||
return list;
|
||||
});
|
||||
}
|
||||
return loadingPromise;
|
||||
};
|
||||
|
||||
// Pre-warm cache in the background immediately so typing 1st letter is instant
|
||||
ensureWorkflowsLoaded();
|
||||
|
||||
const updateSelectionHighlight = () => {
|
||||
const rows = listEl.querySelectorAll(".comfy-sidebar-wf-picker-item");
|
||||
rows.forEach((row, idx) => {
|
||||
row.classList.toggle("selected", idx === selectedIdx);
|
||||
});
|
||||
if (selectedIdx >= 0 && rows[selectedIdx]) {
|
||||
rows[selectedIdx].scrollIntoView({ block: "nearest" });
|
||||
}
|
||||
};
|
||||
|
||||
const resolveTargetTempWf = () => {
|
||||
if (resolvedTempWf) return resolvedTempWf;
|
||||
const active = app.extensionManager?.workflow?.activeWorkflow;
|
||||
if (active && active !== prevWorkflow && isTemporaryWorkflow(active)) {
|
||||
return active;
|
||||
}
|
||||
return isTemporaryWorkflow(active) ? active : null;
|
||||
};
|
||||
|
||||
const pickItem = async (item) => {
|
||||
const tempWf = resolveTargetTempWf();
|
||||
closePicker();
|
||||
await replaceUnsavedWithWorkflow(item, tempWf);
|
||||
};
|
||||
|
||||
const renderList = async () => {
|
||||
const query = input.value.trim();
|
||||
if (query.length < 1) {
|
||||
currentMatches = [];
|
||||
selectedIdx = -1;
|
||||
listEl.style.display = "none";
|
||||
listEl.replaceChildren();
|
||||
return;
|
||||
}
|
||||
|
||||
const all = await ensureWorkflowsLoaded();
|
||||
if (activeTooltip !== tooltip) return;
|
||||
|
||||
const latestQuery = input.value.trim();
|
||||
if (latestQuery.length < 1) {
|
||||
listEl.style.display = "none";
|
||||
listEl.replaceChildren();
|
||||
return;
|
||||
}
|
||||
|
||||
currentMatches = filterWorkflows(all, latestQuery);
|
||||
listEl.replaceChildren();
|
||||
listEl.style.display = "block";
|
||||
|
||||
if (currentMatches.length === 0) {
|
||||
selectedIdx = -1;
|
||||
const empty = document.createElement("div");
|
||||
empty.className = "comfy-sidebar-wf-picker-empty";
|
||||
empty.textContent = t("No matching workflows");
|
||||
listEl.appendChild(empty);
|
||||
return;
|
||||
}
|
||||
|
||||
selectedIdx = 0;
|
||||
currentMatches.forEach((item, idx) => {
|
||||
const row = document.createElement("button");
|
||||
row.type = "button";
|
||||
row.className = "comfy-sidebar-wf-picker-item" + (idx === 0 ? " selected" : "");
|
||||
|
||||
const nameSpan = document.createElement("span");
|
||||
nameSpan.className = "comfy-sidebar-wf-picker-name";
|
||||
nameSpan.textContent = item.displayName;
|
||||
row.appendChild(nameSpan);
|
||||
|
||||
if (item.folder) {
|
||||
const folderSpan = document.createElement("span");
|
||||
folderSpan.className = "comfy-sidebar-wf-picker-folder";
|
||||
folderSpan.textContent = item.folder;
|
||||
row.appendChild(folderSpan);
|
||||
}
|
||||
|
||||
row.addEventListener("mouseenter", () => {
|
||||
selectedIdx = idx;
|
||||
updateSelectionHighlight();
|
||||
});
|
||||
|
||||
row.addEventListener("click", (ev) => {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
pickItem(item);
|
||||
});
|
||||
|
||||
listEl.appendChild(row);
|
||||
});
|
||||
};
|
||||
|
||||
input.addEventListener("input", () => {
|
||||
renderList();
|
||||
});
|
||||
|
||||
input.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Escape") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
closePicker();
|
||||
return;
|
||||
}
|
||||
if (e.key === "ArrowDown" && currentMatches.length > 0) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
selectedIdx = (selectedIdx + 1) % currentMatches.length;
|
||||
updateSelectionHighlight();
|
||||
return;
|
||||
}
|
||||
if (e.key === "ArrowUp" && currentMatches.length > 0) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
selectedIdx = (selectedIdx - 1 + currentMatches.length) % currentMatches.length;
|
||||
updateSelectionHighlight();
|
||||
return;
|
||||
}
|
||||
if (e.key === "Enter" && currentMatches.length > 0) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const chosen = currentMatches[selectedIdx >= 0 ? selectedIdx : 0];
|
||||
if (chosen) pickItem(chosen);
|
||||
return;
|
||||
}
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
const onPointerDownOutside = (e) => {
|
||||
if (!tooltip.contains(e.target)) {
|
||||
closePicker();
|
||||
}
|
||||
};
|
||||
|
||||
const onWindowResize = () => {
|
||||
applyCoords(findFallbackAnchorRect() || anchorRect);
|
||||
};
|
||||
|
||||
document.addEventListener("pointerdown", onPointerDownOutside, true);
|
||||
window.addEventListener("resize", onWindowResize);
|
||||
|
||||
activeCleanup = () => {
|
||||
document.removeEventListener("pointerdown", onPointerDownOutside, true);
|
||||
window.removeEventListener("resize", onWindowResize);
|
||||
};
|
||||
|
||||
activeSession = {
|
||||
openedAt: Date.now(),
|
||||
attachTempWorkflow(wf) {
|
||||
if (wf && isTemporaryWorkflow(wf)) {
|
||||
resolvedTempWf = wf;
|
||||
promptedWorkflows.add(wf);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Focus immediately, and re-verify after Vue activates the new tab so focus isn't stolen
|
||||
input.focus({ preventScroll: true });
|
||||
requestAnimationFrame(() => {
|
||||
if (activeTooltip === tooltip && !tooltip.contains(document.activeElement)) {
|
||||
input.focus({ preventScroll: true });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 1. Pinia workflow store hook (attaches temp workflow to click-opened picker, or opens picker for shortcut/menu)
|
||||
let unsubWorkflowAction = null;
|
||||
const wfMgr = app.extensionManager?.workflow;
|
||||
if (wfMgr && typeof wfMgr.$onAction === "function") {
|
||||
unsubWorkflowAction = wfMgr.$onAction(({ name, args, after, onError }) => {
|
||||
if (name === "closeWorkflow") {
|
||||
activeCloseCount++;
|
||||
after(() => { activeCloseCount = Math.max(0, activeCloseCount - 1); });
|
||||
onError(() => { activeCloseCount = Math.max(0, activeCloseCount - 1); });
|
||||
return;
|
||||
}
|
||||
|
||||
if (name !== "createNewTemporary" && name !== "createTemporary") return;
|
||||
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;
|
||||
|
||||
after((createdWf) => {
|
||||
const wf = createdWf || wfMgr.activeWorkflow;
|
||||
if (!isTemporaryWorkflow(wf)) return;
|
||||
|
||||
// If click handler already opened the picker instantaneously, just attach the created workflow
|
||||
if (activeTooltip && activeSession && Date.now() - activeSession.openedAt < 1000) {
|
||||
activeSession.attachTempWorkflow(wf);
|
||||
return;
|
||||
}
|
||||
|
||||
// Triggered via hotkey or menu: wait a frame for tab DOM to render, then align edge-to-edge
|
||||
requestAnimationFrame(() => {
|
||||
if (!promptedWorkflows.has(wf)) {
|
||||
showPicker(findFallbackAnchorRect(), wf);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Command hook: catches New Blank Workflow from menus or keybindings
|
||||
let restoreCmdExecute = null;
|
||||
const cmd = app.extensionManager?.command;
|
||||
if (cmd && typeof cmd.execute === "function") {
|
||||
const origExecute = cmd.execute.bind(cmd);
|
||||
const wrappedExecute = function (commandId, ...rest) {
|
||||
if (typeof commandId === "string" && /new.*blank.*workflow|new.*workflow/i.test(commandId)) {
|
||||
userInitiatedBlankUntil = Date.now() + 1200;
|
||||
}
|
||||
return origExecute(commandId, ...rest);
|
||||
};
|
||||
cmd.execute = wrappedExecute;
|
||||
restoreCmdExecute = () => {
|
||||
if (cmd.execute === wrappedExecute) {
|
||||
cmd.execute = origExecute;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 3. UI click hook: draws popup immediately at pre-click '+' left edge (0ms delay)
|
||||
const onDocumentClick = (e) => {
|
||||
if (!getSetting(SettingIds.QUICK_WORKFLOW_PICKER, true)) return;
|
||||
|
||||
const btn = findNewWorkflowButton(e.target);
|
||||
if (!btn) return;
|
||||
|
||||
userInitiatedBlankUntil = Date.now() + 1200;
|
||||
const rect = btn.getBoundingClientRect();
|
||||
const prevWorkflow = app.extensionManager?.workflow?.activeWorkflow || null;
|
||||
|
||||
showPicker({ left: rect.left, bottom: rect.bottom }, null, prevWorkflow);
|
||||
};
|
||||
|
||||
document.addEventListener("click", onDocumentClick, true);
|
||||
|
||||
return () => {
|
||||
closePicker();
|
||||
document.removeEventListener("click", onDocumentClick, true);
|
||||
if (typeof unsubWorkflowAction === "function") unsubWorkflowAction();
|
||||
if (typeof restoreCmdExecute === "function") restoreCmdExecute();
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
@@ -83,7 +86,13 @@ export class SidebarOverlay {
|
||||
// Live observer for opening/closing panels or layout changes
|
||||
if (window.MutationObserver) {
|
||||
let updateScheduled = false;
|
||||
const mo = new MutationObserver(() => {
|
||||
const mo = new MutationObserver((mutations) => {
|
||||
// Skip mutations caused purely by the sticky header's scroll animation
|
||||
const relevant = mutations.some((m) => {
|
||||
const el = m.target.nodeType === 1 ? m.target : m.target.parentElement;
|
||||
return !el?.closest?.(".comfy-sidebar-sticky-header-group");
|
||||
});
|
||||
if (!relevant) return;
|
||||
if (!updateScheduled) {
|
||||
updateScheduled = true;
|
||||
requestAnimationFrame(() => {
|
||||
@@ -98,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);
|
||||
};
|
||||
@@ -118,6 +139,8 @@ export class SidebarOverlay {
|
||||
}
|
||||
|
||||
updateOverlayBounds() {
|
||||
// A pending rAF/ResizeObserver callback can fire after destroy(); don't re-attach observers
|
||||
if (this.destroyed) return;
|
||||
let leftOffset = 0;
|
||||
let rightOffset = 0;
|
||||
let topOffset = 0;
|
||||
@@ -126,6 +149,18 @@ export class SidebarOverlay {
|
||||
const midX = winW / 2;
|
||||
|
||||
try {
|
||||
// Dynamically detect any top header/tab bar docked to the top of the screen
|
||||
const potentialTopBars = document.querySelectorAll("header, .comfyui-header, .comfyui-menu, .comfy-menu, [class*='tab-bar'], [class*='workflow-tab'], [class*='workspace-tab'], [class*='header']");
|
||||
for (const bar of potentialTopBars) {
|
||||
// Ignore our own sliding gallery/queue header (it animates via translateY)
|
||||
if (bar.closest(".comfy-sidebar-sticky-header-group, .comfy-sidebar-header-root")) continue;
|
||||
// Must be an element sitting at the top of the viewport
|
||||
const r = bar.getBoundingClientRect();
|
||||
if (r.top <= 2 && r.bottom > 20 && r.bottom < 120 && r.width > 200) {
|
||||
topOffset = Math.max(topOffset, Math.round(r.bottom));
|
||||
}
|
||||
}
|
||||
|
||||
const { leftPanels, rightPanels } = findActiveSidebars();
|
||||
|
||||
[...leftPanels, ...rightPanels].forEach(p => this.observeElement(p));
|
||||
@@ -135,9 +170,6 @@ export class SidebarOverlay {
|
||||
if (rect.right > 0 && rect.right < midX) {
|
||||
leftOffset = Math.max(leftOffset, Math.round(rect.right));
|
||||
}
|
||||
if (rect.top > 0 && rect.top < 120) {
|
||||
topOffset = Math.max(topOffset, Math.round(rect.top));
|
||||
}
|
||||
}
|
||||
|
||||
for (const el of rightPanels) {
|
||||
@@ -145,9 +177,6 @@ export class SidebarOverlay {
|
||||
if (rect.left > midX && rect.left < winW) {
|
||||
rightOffset = Math.max(rightOffset, Math.round(winW - rect.left));
|
||||
}
|
||||
if (rect.top > 0 && rect.top < 120) {
|
||||
topOffset = Math.max(topOffset, Math.round(rect.top));
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Comfy Sidebar: Error finding active sidebars:", e);
|
||||
@@ -174,7 +203,11 @@ export class SidebarOverlay {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
document.body.classList.remove("comfy-sidebar-overlay-active");
|
||||
if (this.destroyed) return;
|
||||
this.destroyed = true;
|
||||
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) {}
|
||||
|
||||
@@ -4,21 +4,58 @@ export function injectStyles() {
|
||||
style.id = "comfy-sidebar-styles";
|
||||
style.textContent = `
|
||||
.comfy-sidebar-card {
|
||||
background: var(--comfy-input-bg, #181818);
|
||||
/* Uses the theme's main elevated surface color (matches folder background identically) */
|
||||
background: var(--card, var(--secondary, var(--p-surface-800, color-mix(in srgb, var(--bg-color, var(--comfy-menu-bg, #181818)) 85%, var(--fg-color, #fff) 15%))));
|
||||
border-radius: 4px; padding: 8px; position: relative;
|
||||
min-height: 80px; margin-bottom: 0px; break-inside: avoid;
|
||||
user-select: none; -webkit-user-select: none;
|
||||
border: 2px solid var(--border-color, #333);
|
||||
color: var(--comfy-input-color, var(--fg-color, #eee));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)));
|
||||
color: var(--foreground, var(--comfy-input-color, var(--fg-color, #eee)));
|
||||
overflow: hidden;
|
||||
}
|
||||
.comfy-sidebar-card:hover {
|
||||
border-color: var(--p-primary-color, var(--primary-color, #555)) !important;
|
||||
transition: border-color 0.2s, background-color 0.2s;
|
||||
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.1s ease-out, background-color 0.1s ease-out;
|
||||
}
|
||||
|
||||
/* Border & Frame Spotlight (Uses the theme's main hue) */
|
||||
.comfy-sidebar-card::before,
|
||||
.comfy-sidebar-folder-card::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
background: radial-gradient(
|
||||
160px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
|
||||
color-mix(in srgb, var(--primary, var(--p-primary-color, var(--primary-color, var(--accent, currentColor)))) 60%, transparent),
|
||||
transparent 70%
|
||||
);
|
||||
opacity: 0;
|
||||
/* 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;
|
||||
}
|
||||
|
||||
.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)); }
|
||||
.comfy-sidebar-card.pending { border-color: #6c757d !important; --hover-color: #adb5bd; }
|
||||
.comfy-sidebar-card.cancelled { border-color: #ffc107 !important; --hover-color: #ffe082; }
|
||||
.comfy-sidebar-card.error { border-color: #dc3545 !important; --hover-color: #f87171; }
|
||||
|
||||
/* Progress bar track & fill on active cards */
|
||||
.comfy-sidebar-card.active [class*="progress"] > div,
|
||||
.comfy-sidebar-card.active [class*="progress-fill"],
|
||||
.comfy-sidebar-card.active [class*="bar-fill"] {
|
||||
background: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
}
|
||||
.comfy-sidebar-card.active { --border-color: #3b82f6; --hover-color: #60a5fa; }
|
||||
.comfy-sidebar-card.pending { --border-color: #6c757d; --hover-color: #adb5bd; }
|
||||
.comfy-sidebar-card.cancelled { --border-color: #ffc107; --hover-color: #ffe082; }
|
||||
.comfy-sidebar-card.error { --border-color: #dc3545; --hover-color: #f87171; }
|
||||
|
||||
.comfy-sidebar-card.pending .comfy-sidebar-queue-cancel-btn,
|
||||
.comfy-sidebar-card.active .comfy-sidebar-queue-cancel-btn {
|
||||
@@ -44,25 +81,53 @@ export function injectStyles() {
|
||||
padding: 2px 4px; border-radius: 3px; pointer-events: none; z-index: 10; color: #fff;
|
||||
}
|
||||
|
||||
/* Card Cancel / Interrupt Button - matches native ComfyUI Topbar Cancel */
|
||||
.comfy-sidebar-queue-cancel-btn {
|
||||
display: none;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
width: 32px !important;
|
||||
height: 32px !important;
|
||||
background-color: #7f1d1d !important;
|
||||
color: #e2e8f0 !important;
|
||||
font-size: 11px !important;
|
||||
width: 28px !important;
|
||||
height: 28px !important;
|
||||
background: var(--destructive, var(--p-button-danger-background, #ef4444)) !important;
|
||||
color: var(--foreground, var(--fg-color, inherit)) !important;
|
||||
border: 1px solid var(--destructive-border, transparent) !important;
|
||||
font-size: 12px !important;
|
||||
border-radius: 6px !important;
|
||||
cursor: pointer !important;
|
||||
transition: background-color 0.15s ease, color 0.15s ease !important;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
|
||||
transition: background-color 0.15s ease, filter 0.15s ease !important;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
|
||||
z-index: 25 !important;
|
||||
}
|
||||
|
||||
.comfy-sidebar-queue-cancel-btn:hover {
|
||||
background-color: #991b1b !important;
|
||||
color: #ffffff !important;
|
||||
background: color-mix(in srgb, var(--destructive, var(--p-button-danger-background, #ef4444)) 88%, var(--foreground, #fff) 12%) !important;
|
||||
color: var(--foreground, var(--fg-color, inherit)) !important;
|
||||
filter: brightness(1.06);
|
||||
}
|
||||
|
||||
/* Cancel All Pending Button */
|
||||
.comfy-sidebar-cancel-all-btn {
|
||||
background: var(--destructive, var(--p-button-danger-background, #ef4444)) !important;
|
||||
color: var(--foreground, var(--fg-color, inherit)) !important;
|
||||
border: 1px solid var(--destructive-border, transparent) !important;
|
||||
border-radius: 6px !important;
|
||||
padding: 6px 12px !important;
|
||||
cursor: pointer !important;
|
||||
font-size: 11px !important;
|
||||
font-weight: bold !important;
|
||||
width: 100% !important;
|
||||
box-sizing: border-box !important;
|
||||
transition: background-color 0.15s ease, filter 0.15s ease !important;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
|
||||
}
|
||||
|
||||
.comfy-sidebar-cancel-all-btn:hover {
|
||||
background: color-mix(in srgb, var(--destructive, var(--p-button-danger-background, #ef4444)) 88%, var(--foreground, #fff) 12%) !important;
|
||||
filter: brightness(1.06);
|
||||
}
|
||||
|
||||
.comfy-sidebar-cancel-all-btn:active {
|
||||
filter: brightness(0.95);
|
||||
}
|
||||
|
||||
.comfy-sidebar-hover-panel,
|
||||
@@ -87,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);
|
||||
@@ -98,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 {
|
||||
@@ -115,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;
|
||||
@@ -126,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;
|
||||
}
|
||||
|
||||
@@ -134,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;
|
||||
@@ -155,14 +281,14 @@ export function injectStyles() {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(15, 23, 42, 0.75);
|
||||
backdrop-filter: blur(2px);
|
||||
background: color-mix(in srgb, var(--card, var(--secondary, #12071f)) 85%, transparent);
|
||||
backdrop-filter: blur(3px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
color: #38bdf8;
|
||||
color: var(--primary, var(--p-primary-color, #ea580c));
|
||||
z-index: 15;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
@@ -189,10 +315,10 @@ export function injectStyles() {
|
||||
}
|
||||
|
||||
.comfy-sidebar-header-btn {
|
||||
background: transparent;
|
||||
color: var(--desc-color, #aaa);
|
||||
border: 1px solid var(--border-color, #555);
|
||||
border-radius: 3px;
|
||||
background: var(--card, var(--secondary, var(--p-surface-800, rgba(255, 255, 255, 0.05))));
|
||||
color: var(--muted-foreground, var(--desc-color, #aaa));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)));
|
||||
border-radius: 4px;
|
||||
padding: 4px 8px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
@@ -200,19 +326,22 @@ export function injectStyles() {
|
||||
}
|
||||
|
||||
.comfy-sidebar-header-btn:hover {
|
||||
border-color: var(--fg-color, #eee);
|
||||
color: var(--fg-color, #eee);
|
||||
border-color: color-mix(in srgb, var(--border, var(--border-color, #a855f7)) 65%, var(--foreground, #fff) 35%);
|
||||
color: var(--foreground, #fff);
|
||||
background: color-mix(in srgb, var(--card, var(--secondary, rgba(255, 255, 255, 0.12))) 65%, var(--border, var(--border-color, #a855f7)) 35%);
|
||||
}
|
||||
|
||||
.comfy-sidebar-icon-btn {
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
opacity: 0.6;
|
||||
transition: opacity 0.15s ease-in-out;
|
||||
color: var(--foreground, var(--fg-color, inherit));
|
||||
transition: opacity 0.15s ease-in-out, color 0.15s ease-in-out;
|
||||
}
|
||||
|
||||
.comfy-sidebar-icon-btn:hover {
|
||||
opacity: 1;
|
||||
color: var(--primary, var(--p-primary-color, inherit));
|
||||
}
|
||||
|
||||
.comfy-sidebar-scroll-top-btn {
|
||||
@@ -222,25 +351,25 @@ export function injectStyles() {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: rgba(30, 30, 30, 0.9);
|
||||
color: #eee;
|
||||
border: 1px solid var(--border-color, #555);
|
||||
background: var(--card, var(--secondary, rgba(30, 30, 30, 0.9)));
|
||||
color: var(--foreground, #eee);
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)));
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 999;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.6);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.5);
|
||||
transition: all 0.15s ease-in-out;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.comfy-sidebar-scroll-top-btn:hover {
|
||||
opacity: 1;
|
||||
background: var(--p-primary-color, #3b82f6);
|
||||
background: var(--primary, var(--p-primary-color, #ea580c));
|
||||
color: #fff;
|
||||
border-color: var(--p-primary-color, #3b82f6);
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c));
|
||||
}
|
||||
|
||||
/* 3D Preview Cards */
|
||||
@@ -259,8 +388,8 @@ export function injectStyles() {
|
||||
}
|
||||
|
||||
.comfy-sidebar-3d-wrapper:hover {
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c));
|
||||
box-shadow: 0 0 12px color-mix(in srgb, var(--primary, #ea580c) 35%, transparent);
|
||||
}
|
||||
|
||||
.comfy-sidebar-3d-preview-img {
|
||||
@@ -454,13 +583,13 @@ export function injectStyles() {
|
||||
}
|
||||
|
||||
.comfy-sidebar-file-wrapper:hover {
|
||||
border-color: #0ea5e9;
|
||||
box-shadow: 0 0 14px rgba(14, 165, 233, 0.35);
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c));
|
||||
box-shadow: 0 0 14px color-mix(in srgb, var(--primary, #ea580c) 35%, transparent);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.comfy-sidebar-file-badge {
|
||||
background: rgba(14, 165, 233, 0.9);
|
||||
background: var(--primary, var(--p-primary-color, #ea580c));
|
||||
color: #fff;
|
||||
font-size: 9px;
|
||||
font-weight: bold;
|
||||
@@ -514,7 +643,7 @@ export function injectStyles() {
|
||||
.comfy-sidebar-text-clamp {
|
||||
font-size: 11px;
|
||||
line-height: 1.45;
|
||||
color: #cbd5e1;
|
||||
color: var(--foreground, #cbd5e1);
|
||||
max-height: 84px;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
@@ -522,17 +651,93 @@ export function injectStyles() {
|
||||
-webkit-box-orient: vertical;
|
||||
cursor: pointer;
|
||||
padding: 8px 10px;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
/* Solid theme surface that sits above the spotlight, keeping text crisp and readable */
|
||||
background: var(--card, var(--secondary, var(--p-surface-800, #181818)));
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)));
|
||||
margin-top: 18px;
|
||||
word-break: break-word;
|
||||
transition: all 0.15s ease-in-out;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.comfy-sidebar-text-clamp:hover {
|
||||
border-color: #3b82f6;
|
||||
background: rgba(59, 130, 246, 0.08);
|
||||
/* Follows the theme accent (orange) */
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c));
|
||||
background: color-mix(in srgb, var(--primary, var(--p-primary-color, #ea580c)) 6%, var(--card, var(--secondary, #181818)) 94%);
|
||||
}
|
||||
|
||||
/* Translucent theme backdrop behind Text Reader & Fullscreen Previews */
|
||||
.comfy-sidebar-comparison-overlay,
|
||||
.comfy-sidebar-overlay,
|
||||
body.comfy-sidebar-overlay-active > div[style*="position: fixed"],
|
||||
body.comfy-sidebar-overlay-active > div[style*="position:fixed"] {
|
||||
background: color-mix(in srgb, var(--background, var(--card, var(--comfy-menu-bg, #13091f))) 82%, transparent) !important;
|
||||
backdrop-filter: blur(10px) !important;
|
||||
-webkit-backdrop-filter: blur(10px) !important;
|
||||
}
|
||||
|
||||
/* Comparison Media: Ensures no borders or outlines appear on compared images */
|
||||
.comfy-sidebar-comparison-media {
|
||||
border: none !important;
|
||||
outline: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
/* Comparison Slider Line & Handle */
|
||||
.comfy-sidebar-comparison-slider {
|
||||
background: var(--foreground, #ffffff) !important;
|
||||
box-shadow: 0 0 6px rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
|
||||
.comfy-sidebar-comparison-handle {
|
||||
width: 32px !important;
|
||||
height: 32px !important;
|
||||
border-radius: 50% !important;
|
||||
background: var(--card, var(--secondary, rgba(30, 30, 30, 0.9))) !important;
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15))) !important;
|
||||
color: var(--foreground, #eee) !important;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
|
||||
cursor: ew-resize !important;
|
||||
transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out !important;
|
||||
}
|
||||
|
||||
.comfy-sidebar-comparison-handle:hover {
|
||||
background: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
/* Round (X) Close Button across all preview overlays (matches buttons, ignores images/sliders) */
|
||||
body.comfy-sidebar-overlay-active button[style*="50%"],
|
||||
body.comfy-sidebar-overlay-active [style*="border-radius: 50%"]:not(img):not(video):not(.comfy-sidebar-comparison-handle):not(.comfy-sidebar-comparison-slider):not(.comfy-sidebar-comparison-media),
|
||||
body.comfy-sidebar-overlay-active [style*="border-radius:50%"]:not(img):not(video):not(.comfy-sidebar-comparison-handle):not(.comfy-sidebar-comparison-slider):not(.comfy-sidebar-comparison-media),
|
||||
.comfy-sidebar-comparison-overlay button[style*="50%"],
|
||||
div[class*="sidebar-overlay"] button[style*="50%"] {
|
||||
background: var(--card, var(--secondary, rgba(30, 30, 30, 0.9))) !important;
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15))) !important;
|
||||
color: var(--foreground, #eee) !important;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
|
||||
transition: all 0.15s ease-in-out !important;
|
||||
}
|
||||
|
||||
body.comfy-sidebar-overlay-active button[style*="50%"]:hover,
|
||||
body.comfy-sidebar-overlay-active [style*="border-radius: 50%"]:not(img):not(video):not(.comfy-sidebar-comparison-handle):not(.comfy-sidebar-comparison-slider):not(.comfy-sidebar-comparison-media):hover,
|
||||
body.comfy-sidebar-overlay-active [style*="border-radius:50%"]:not(img):not(video):not(.comfy-sidebar-comparison-handle):not(.comfy-sidebar-comparison-slider):not(.comfy-sidebar-comparison-media):hover,
|
||||
.comfy-sidebar-comparison-overlay button[style*="50%"]:hover,
|
||||
div[class*="sidebar-overlay"] button[style*="50%"]:hover {
|
||||
color: #ffffff !important;
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
background: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
}
|
||||
|
||||
body.comfy-sidebar-overlay-active [style*="50%"] svg,
|
||||
body.comfy-sidebar-overlay-active [style*="50%"] i,
|
||||
body.comfy-sidebar-overlay-active [style*="50%"] line,
|
||||
body.comfy-sidebar-overlay-active [style*="50%"] path {
|
||||
stroke: currentColor !important;
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
/* Elevate outer sidebar dock containers above the preview overlay */
|
||||
@@ -555,9 +760,11 @@ export function injectStyles() {
|
||||
z-index: 1005 !important;
|
||||
}
|
||||
|
||||
/* Explicit card element layering so badges and [X] are ALWAYS on top of images */
|
||||
.comfy-sidebar-card .comfy-sidebar-media-wrapper {
|
||||
z-index: 1 !important;
|
||||
/* Media and text wrappers sit on z-index 2 so the spotlight shines on the border behind them */
|
||||
.comfy-sidebar-card .comfy-sidebar-media-wrapper,
|
||||
.comfy-sidebar-card .comfy-sidebar-text-clamp {
|
||||
z-index: 2 !important;
|
||||
position: relative;
|
||||
}
|
||||
.comfy-sidebar-card-timer {
|
||||
z-index: 10 !important;
|
||||
@@ -569,6 +776,20 @@ export function injectStyles() {
|
||||
z-index: 30 !important;
|
||||
}
|
||||
|
||||
/* Sidebar Tab Counter Badge (Queue count) */
|
||||
.side-tool-bar-container [class*="badge"],
|
||||
.comfyui-sidebar [class*="badge"],
|
||||
nav [class*="badge"],
|
||||
aside [class*="badge"],
|
||||
.side-tool-bar-end [class*="badge"],
|
||||
button:has(.pi-images) + span,
|
||||
button:has([class*="queue"]) + span {
|
||||
background-color: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
background: var(--primary, var(--p-primary-color, #ea580c)) !important;
|
||||
color: var(--primary-foreground, #ffffff) !important;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
|
||||
/* Slim down the Queue sidebar scrollbar so it stops colliding with the separator */
|
||||
.comfyui-sidebar ::-webkit-scrollbar,
|
||||
.comfy-sidebar ::-webkit-scrollbar,
|
||||
@@ -584,30 +805,62 @@ export function injectStyles() {
|
||||
border-radius: 3px !important;
|
||||
}
|
||||
|
||||
/* Gallery delete button only shows in the Ctrl alternative actions menu */
|
||||
.comfy-sidebar-gallery-btn-del {
|
||||
display: none !important;
|
||||
}
|
||||
body.comfy-sidebar-ctrl-active .comfy-sidebar-gallery-btn-del,
|
||||
.comfy-sidebar-gallery-btn-del.confirm-delete,
|
||||
.comfy-sidebar-gallery-btn-del.confirm-delete-disk {
|
||||
display: inline-flex !important;
|
||||
}
|
||||
|
||||
/* Sticky Header & Nav Reveal (Seamlessly transparent at rest, frosted on scroll) */
|
||||
.comfy-sidebar-sticky-header-group {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
margin: -14px -14px 6px -14px;
|
||||
padding: 14px 14px 0 14px;
|
||||
background: transparent;
|
||||
z-index: 35;
|
||||
transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, box-shadow 0.2s ease;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.comfy-sidebar-sticky-header-group.is-scrolled {
|
||||
background: color-mix(in srgb, var(--card, var(--secondary, var(--background, var(--bg-color, #181818)))) 75%, transparent);
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
|
||||
border-bottom: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.08)));
|
||||
}
|
||||
|
||||
/* Gallery Subfolders & Breadcrumb Styles */
|
||||
.comfy-sidebar-breadcrumb-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 11px;
|
||||
color: var(--desc-color, #aaa);
|
||||
color: var(--muted-foreground, var(--desc-color, #aaa));
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
padding: 4px 0 8px 0;
|
||||
border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
|
||||
border-bottom: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.08)));
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.comfy-sidebar-breadcrumb-item {
|
||||
cursor: pointer;
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
background: var(--card, var(--secondary, var(--p-surface-800, rgba(255, 255, 255, 0.05))));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.08)));
|
||||
transition: all 0.15s ease-in-out;
|
||||
color: var(--fg-color, #eee);
|
||||
color: var(--foreground, var(--fg-color, #eee));
|
||||
text-decoration: none;
|
||||
}
|
||||
.comfy-sidebar-breadcrumb-item:hover {
|
||||
background: var(--p-primary-color, rgba(59, 130, 246, 0.2));
|
||||
background: color-mix(in srgb, var(--primary, var(--p-primary-color, #38bdf8)) 25%, transparent);
|
||||
border-color: var(--primary, var(--p-primary-color, #38bdf8));
|
||||
color: #fff;
|
||||
}
|
||||
.comfy-sidebar-breadcrumb-sep {
|
||||
@@ -623,31 +876,37 @@ export function injectStyles() {
|
||||
width: 100%;
|
||||
}
|
||||
.comfy-sidebar-folder-card {
|
||||
background: var(--comfy-input-bg, #181818);
|
||||
/* Uses the theme's main elevated surface color */
|
||||
background: var(--card, var(--secondary, var(--p-surface-800, color-mix(in srgb, var(--bg-color, var(--comfy-menu-bg, #181818)) 85%, var(--fg-color, #fff) 15%))));
|
||||
border-radius: 4px;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--border-color, #333);
|
||||
color: var(--comfy-input-color, var(--fg-color, #eee));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)));
|
||||
color: var(--foreground, var(--comfy-input-color, var(--fg-color, #eee)));
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
transition: border-color 0.15s ease, background 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;
|
||||
overflow: hidden;
|
||||
}
|
||||
.comfy-sidebar-folder-card:hover {
|
||||
border-color: var(--p-primary-color, #0ea5e9) !important;
|
||||
background: rgba(14, 165, 233, 0.12);
|
||||
border-color: color-mix(in srgb, var(--border, var(--border-color, #555)) 50%, var(--foreground, var(--fg-color, #fff)) 50%);
|
||||
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%);
|
||||
}
|
||||
.comfy-sidebar-folder-icon {
|
||||
font-size: 16px;
|
||||
color: var(--p-primary-color, #0ea5e9);
|
||||
/* Keeps the accent color (orange, blue, or purple) strictly for the icon */
|
||||
color: var(--primary, var(--p-primary-color, var(--primary-color, #38bdf8)));
|
||||
flex-shrink: 0;
|
||||
}
|
||||
body.comfy-sidebar-ctrl-active .comfy-sidebar-folder-card {
|
||||
body.comfy-sidebar-ctrl-active .comfy-sidebar-folder-card:hover {
|
||||
cursor: alias !important;
|
||||
border-color: var(--p-primary-color, #0ea5e9) !important;
|
||||
border-color: var(--primary, var(--p-primary-color, var(--primary-color, #a855f7))) !important;
|
||||
box-shadow: 0 0 0 1px var(--primary, var(--p-primary-color, var(--primary-color, #a855f7))), 0 0 10px rgba(168, 85, 247, 0.3) !important;
|
||||
background: color-mix(in srgb, var(--primary, var(--p-primary-color, var(--primary-color, #a855f7))) 15%, transparent) !important;
|
||||
}
|
||||
.comfy-sidebar-folder-name {
|
||||
font-size: 11px;
|
||||
@@ -698,6 +957,211 @@ export function injectStyles() {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* Runtime Preview Dock in Properties Panel */
|
||||
.comfy-sidebar-runtime-preview-dock {
|
||||
position: sticky;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
box-sizing: border-box;
|
||||
background: color-mix(in srgb, var(--card, var(--bg-color, var(--comfy-menu-bg, #181818))) 85%, transparent);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
border-top: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)));
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.comfy-sidebar-runtime-preview-btn {
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
font-family: inherit;
|
||||
transition: all 0.15s ease-in-out;
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
background: var(--card, var(--secondary, rgba(255, 255, 255, 0.05)));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)));
|
||||
color: var(--muted-foreground, var(--desc-color, #aaa));
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.comfy-sidebar-runtime-preview-btn:hover {
|
||||
border-color: color-mix(in srgb, var(--primary, var(--p-primary-color, #ea580c)) 65%, var(--border, #666) 35%);
|
||||
color: var(--foreground, #fff);
|
||||
background: color-mix(in srgb, var(--primary, var(--p-primary-color, #ea580c)) 8%, var(--card, rgba(255, 255, 255, 0.08)) 92%);
|
||||
}
|
||||
|
||||
.comfy-sidebar-runtime-preview-btn.active {
|
||||
background: color-mix(in srgb, var(--primary, var(--p-primary-color, var(--primary-color, #ea580c))) 18%, transparent) !important;
|
||||
border: 1px solid var(--primary, var(--p-primary-color, var(--primary-color, #ea580c))) !important;
|
||||
color: var(--primary, var(--p-primary-color, var(--primary-color, #ea580c))) !important;
|
||||
box-shadow: 0 0 10px color-mix(in srgb, var(--primary, var(--p-primary-color, var(--primary-color, #ea580c))) 35%, transparent) !important;
|
||||
}
|
||||
|
||||
.comfy-sidebar-runtime-preview-btn.active:hover {
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
|
||||
/* New Workflow Quick Picker Tooltip */
|
||||
.comfy-sidebar-wf-picker {
|
||||
position: fixed;
|
||||
z-index: 10000;
|
||||
width: 300px;
|
||||
max-width: calc(100vw - 24px);
|
||||
background: color-mix(in srgb, var(--card, var(--secondary, var(--comfy-menu-bg, #181818))) 94%, transparent);
|
||||
backdrop-filter: blur(14px);
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.16)));
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
|
||||
padding: 6px;
|
||||
box-sizing: border-box;
|
||||
color: var(--foreground, var(--fg-color, #eee));
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-input-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
padding: 5px 8px;
|
||||
border-radius: 6px;
|
||||
background: var(--background, rgba(0, 0, 0, 0.25));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)));
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-input-wrap:focus-within {
|
||||
border-color: var(--primary, var(--p-primary-color, #ea580c));
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-icon {
|
||||
font-size: 12px;
|
||||
opacity: 0.65;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-input {
|
||||
width: 100%;
|
||||
border: none;
|
||||
outline: none;
|
||||
background: transparent;
|
||||
color: var(--foreground, var(--fg-color, #eee));
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-list {
|
||||
margin-top: 6px;
|
||||
max-height: 240px;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-item {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: var(--card, var(--secondary, var(--p-surface-800, color-mix(in srgb, var(--bg-color, var(--comfy-menu-bg, #181818)) 85%, var(--fg-color, #fff) 15%))));
|
||||
border: 1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)));
|
||||
color: var(--foreground, var(--comfy-input-color, var(--fg-color, #eee)));
|
||||
text-align: left;
|
||||
padding: 7px 9px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
box-sizing: border-box;
|
||||
transition: border-color 0.15s ease, background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-item::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
background: radial-gradient(
|
||||
160px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
|
||||
color-mix(in srgb, var(--primary, var(--p-primary-color, var(--primary-color, var(--accent, currentColor)))) 60%, transparent),
|
||||
transparent 70%
|
||||
);
|
||||
opacity: 0;
|
||||
transition: opacity 0.25s ease;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-item:hover::before {
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-item:hover {
|
||||
border-color: color-mix(in srgb, var(--border, var(--border-color, #555)) 50%, var(--foreground, var(--fg-color, #fff)) 50%);
|
||||
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%);
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-item.selected {
|
||||
border-color: color-mix(in srgb, var(--primary, var(--p-primary-color, #ea580c)) 70%, var(--border, #666) 30%);
|
||||
background: color-mix(in srgb, var(--primary, var(--p-primary-color, #ea580c)) 14%, var(--card, var(--secondary, #181818)) 86%);
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-name,
|
||||
.comfy-sidebar-wf-picker-folder {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-folder {
|
||||
font-size: 10px;
|
||||
opacity: 0.65;
|
||||
max-width: 100px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.comfy-sidebar-wf-picker-empty {
|
||||
padding: 8px;
|
||||
font-size: 11px;
|
||||
opacity: 0.65;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Hide stock hover tooltips while the Quick Workflow Picker is open */
|
||||
body:has(.comfy-sidebar-wf-picker) [role="tooltip"],
|
||||
body:has(.comfy-sidebar-wf-picker) [data-reka-popper-content-wrapper]:has([role="tooltip"]),
|
||||
body:has(.comfy-sidebar-wf-picker) .p-tooltip {
|
||||
opacity: 0 !important;
|
||||
visibility: hidden !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
@@ -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:#61afef;text-decoration:none;border-bottom:1px dashed #61afef;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;
|
||||
}
|
||||
@@ -91,8 +91,8 @@ function parseMarkdown(text) {
|
||||
if (inCodeBlock) {
|
||||
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:#333;color:#aaa;border:1px solid #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:#1e1e1e;padding:10px;padding-top:28px;border-radius:4px;border:1px solid #333;font-family:monospace;overflow-x:auto;margin:0;color:#85c5ec;"><code>${rCode}</code></pre></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.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();
|
||||
@@ -202,14 +202,14 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
|
||||
const readerBox = document.createElement("div");
|
||||
Object.assign(readerBox.style, {
|
||||
background: "var(--comfy-menu-bg, rgba(18, 18, 24, 0.95))",
|
||||
backdropFilter: "blur(12px)",
|
||||
border: "1px solid var(--border-color, rgba(255, 255, 255, 0.15))",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, var(--p-surface-800, #181818))) 94%, var(--background, #000) 6%)",
|
||||
backdropFilter: "blur(16px)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
borderRadius: "12px",
|
||||
padding: "20px 24px", width: "85%", maxWidth: "840px", height: "80vh",
|
||||
boxShadow: "0 12px 40px rgba(0,0,0,0.4)", display: "flex",
|
||||
boxShadow: "0 12px 40px rgba(0,0,0,0.5)", display: "flex",
|
||||
flexDirection: "column", gap: "14px", zIndex: "20",
|
||||
color: "var(--fg-color, #eee)",
|
||||
color: "var(--foreground, var(--fg-color, #eee))",
|
||||
pointerEvents: "auto"
|
||||
});
|
||||
|
||||
@@ -222,7 +222,7 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
const headerRow = document.createElement("div");
|
||||
Object.assign(headerRow.style, {
|
||||
display: "flex", alignItems: "center", justifyContent: "space-between",
|
||||
borderBottom: "1px solid rgba(255,255,255,0.1)", paddingBottom: "12px",
|
||||
borderBottom: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.12)))", paddingBottom: "12px",
|
||||
flexWrap: "wrap", gap: "10px"
|
||||
});
|
||||
|
||||
@@ -242,7 +242,9 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
|
||||
const statsBadge = document.createElement("span");
|
||||
Object.assign(statsBadge.style, {
|
||||
fontSize: "10px", color: "#94a3b8", background: "rgba(255,255,255,0.06)",
|
||||
fontSize: "10px", color: "var(--muted-foreground, #94a3b8)",
|
||||
background: "var(--secondary, rgba(255,255,255,0.06))",
|
||||
border: "1px solid var(--border, transparent)",
|
||||
padding: "3px 8px", borderRadius: "4px", fontFamily: "monospace",
|
||||
whiteSpace: "nowrap", flexShrink: "0"
|
||||
});
|
||||
@@ -254,7 +256,9 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
|
||||
const modeBtn = document.createElement("button");
|
||||
Object.assign(modeBtn.style, {
|
||||
background: "#334155", border: "1px solid #64748b", color: "#f8fafc",
|
||||
background: "var(--primary, var(--p-primary-color, #a855f7))",
|
||||
border: "1px solid var(--primary, var(--p-primary-color, #a855f7))",
|
||||
color: "#ffffff",
|
||||
borderRadius: "6px", padding: "5px 12px", fontSize: "11px", cursor: "pointer",
|
||||
display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "6px",
|
||||
whiteSpace: "nowrap", minWidth: "96px", height: "28px", boxSizing: "border-box"
|
||||
@@ -263,7 +267,9 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
|
||||
const copyBtn = document.createElement("button");
|
||||
Object.assign(copyBtn.style, {
|
||||
background: "#1e293b", border: "1px solid #475569", color: "#e2e8f0",
|
||||
background: "var(--secondary, var(--p-surface-800, #1e293b))",
|
||||
border: "1px solid var(--border, var(--border-color, #475569))",
|
||||
color: "var(--foreground, #e2e8f0)",
|
||||
borderRadius: "6px", padding: "5px 10px", fontSize: "11px", cursor: "pointer",
|
||||
display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "6px",
|
||||
whiteSpace: "nowrap", height: "28px", boxSizing: "border-box"
|
||||
@@ -272,7 +278,9 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
|
||||
const downloadBtn = document.createElement("button");
|
||||
Object.assign(downloadBtn.style, {
|
||||
background: "#1e293b", border: "1px solid #475569", color: "#e2e8f0",
|
||||
background: "var(--secondary, var(--p-surface-800, #1e293b))",
|
||||
border: "1px solid var(--border, var(--border-color, #475569))",
|
||||
color: "var(--foreground, #e2e8f0)",
|
||||
borderRadius: "6px", padding: "5px 10px", fontSize: "11px", cursor: "pointer",
|
||||
display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "6px",
|
||||
whiteSpace: "nowrap", height: "28px", boxSizing: "border-box"
|
||||
@@ -286,12 +294,12 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
Object.assign(textArea.style, {
|
||||
flex: "1", overflowY: "auto", fontSize: "13px",
|
||||
lineHeight: "1.6",
|
||||
color: "var(--fg-color, #e2e8f0)",
|
||||
color: "var(--foreground, var(--fg-color, #e2e8f0))",
|
||||
wordBreak: "break-word",
|
||||
userSelect: "text", "-webkit-user-select": "text",
|
||||
background: "var(--comfy-input-bg, rgba(0, 0, 0, 0.2))",
|
||||
background: "color-mix(in srgb, var(--background, var(--comfy-input-bg, #000)) 75%, transparent)",
|
||||
padding: "16px 20px", borderRadius: "6px",
|
||||
border: "1px solid var(--border-color, rgba(255, 255, 255, 0.08))",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.1)))",
|
||||
scrollbarWidth: "thin"
|
||||
});
|
||||
|
||||
@@ -301,15 +309,17 @@ export function createTextReader(textData, onSwitchMedia = () => {}, onDestroy =
|
||||
|
||||
if (isMarkdownMode) {
|
||||
modeBtn.innerHTML = `<i class="pi pi-code"></i><span>Markdown</span>`;
|
||||
modeBtn.style.background = "#3b82f6";
|
||||
modeBtn.style.borderColor = "#60a5fa";
|
||||
modeBtn.style.background = "var(--primary, var(--p-primary-color, #a855f7))";
|
||||
modeBtn.style.borderColor = "var(--primary, var(--p-primary-color, #a855f7))";
|
||||
modeBtn.style.color = "#ffffff";
|
||||
textArea.style.fontFamily = "sans-serif";
|
||||
textArea.style.whiteSpace = "normal";
|
||||
textArea.innerHTML = parseMarkdown(rawText);
|
||||
} else {
|
||||
modeBtn.innerHTML = `<i class="pi pi-align-left"></i><span>${t("Raw Text")}</span>`;
|
||||
modeBtn.style.background = "#334155";
|
||||
modeBtn.style.borderColor = "#64748b";
|
||||
modeBtn.style.background = "var(--secondary, #334155)";
|
||||
modeBtn.style.borderColor = "var(--border, #64748b)";
|
||||
modeBtn.style.color = "var(--muted-foreground, #f8fafc)";
|
||||
textArea.style.fontFamily = "monospace";
|
||||
textArea.style.whiteSpace = "pre-wrap";
|
||||
textArea.textContent = rawText;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import { t } from "../core/i18n.js";
|
||||
|
||||
const FILE_EXT_REGEX = /\.(safetensors|ckpt|pt|pth|bin|latent|onnx|engine|gguf|lora|zip|tar|gz|7z|json|csv|parquet|txt|yaml|yml|xml|pdf|blend|fbx|obj|glb|gltf|stl|ply|splat|spz|ksplat|png|jpg|jpeg|webp|gif|bmp|tiff|svg|mp4|webm|wav|mp3|ogg|flac|m4a|aac|opus)$/i;
|
||||
|
||||
@@ -67,17 +68,59 @@ export function parseWorkflow(workflow) {
|
||||
return null;
|
||||
}
|
||||
|
||||
export function isNodeIgnored(nodeId, rawWorkflow) {
|
||||
export function getWorkflowNodeMap(rawWorkflow) {
|
||||
const workflow = parseWorkflow(rawWorkflow);
|
||||
if (workflow && Array.isArray(workflow.nodes)) {
|
||||
const node = workflow.nodes.find(n => String(n.id) === String(nodeId));
|
||||
if (node?.properties?.ignoreInQueue !== undefined) {
|
||||
return !!node.properties.ignoreInQueue;
|
||||
if (!workflow || !Array.isArray(workflow.nodes)) return null;
|
||||
|
||||
if (workflow._nodeMap instanceof Map) {
|
||||
return workflow._nodeMap;
|
||||
}
|
||||
|
||||
const map = new Map();
|
||||
for (const node of workflow.nodes) {
|
||||
if (node && node.id !== undefined && node.id !== null) {
|
||||
map.set(String(node.id), node);
|
||||
}
|
||||
}
|
||||
|
||||
if (!workflow && app.graph) {
|
||||
const canvasNode = app.graph.getNodeById ? (app.graph.getNodeById(Number(nodeId)) || app.graph.getNodeById(String(nodeId))) : null;
|
||||
// Attach as non-enumerable so JSON.stringify and Object.keys never see it
|
||||
if (typeof workflow === "object") {
|
||||
try {
|
||||
Object.defineProperty(workflow, "_nodeMap", {
|
||||
value: map,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false
|
||||
});
|
||||
} catch (_) {
|
||||
workflow._nodeMap = map;
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
export function isNodeIgnored(nodeId, rawWorkflow) {
|
||||
const idStr = String(nodeId);
|
||||
const nodeMap = getWorkflowNodeMap(rawWorkflow);
|
||||
|
||||
if (nodeMap) {
|
||||
const node = nodeMap.get(idStr);
|
||||
if (node?.properties?.ignoreInQueue !== undefined) {
|
||||
return !!node.properties.ignoreInQueue;
|
||||
}
|
||||
} else {
|
||||
const workflow = parseWorkflow(rawWorkflow);
|
||||
if (workflow && Array.isArray(workflow.nodes)) {
|
||||
const node = workflow.nodes.find(n => String(n.id) === idStr);
|
||||
if (node?.properties?.ignoreInQueue !== undefined) {
|
||||
return !!node.properties.ignoreInQueue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (app.graph) {
|
||||
const canvasNode = app.graph.getNodeById ? (app.graph.getNodeById(Number(nodeId)) || app.graph.getNodeById(idStr)) : null;
|
||||
if (canvasNode?.properties?.ignoreInQueue !== undefined) {
|
||||
return !!canvasNode.properties.ignoreInQueue;
|
||||
}
|
||||
@@ -87,13 +130,21 @@ export function isNodeIgnored(nodeId, rawWorkflow) {
|
||||
|
||||
export function getNodeTitle(nodeId, rawWorkflow, promptGraph = null) {
|
||||
const idStr = String(nodeId);
|
||||
const nodeMap = getWorkflowNodeMap(rawWorkflow);
|
||||
|
||||
const workflow = parseWorkflow(rawWorkflow);
|
||||
if (workflow && Array.isArray(workflow.nodes)) {
|
||||
const node = workflow.nodes.find(n => String(n.id) === idStr);
|
||||
if (nodeMap) {
|
||||
const node = nodeMap.get(idStr);
|
||||
if (node) {
|
||||
return node.title || node.type || null;
|
||||
}
|
||||
} else {
|
||||
const workflow = parseWorkflow(rawWorkflow);
|
||||
if (workflow && Array.isArray(workflow.nodes)) {
|
||||
const node = workflow.nodes.find(n => String(n.id) === idStr);
|
||||
if (node) {
|
||||
return node.title || node.type || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (promptGraph && promptGraph[idStr]) {
|
||||
@@ -233,9 +284,10 @@ export function findImagesInOutputs(outputs, rawWorkflow) {
|
||||
};
|
||||
|
||||
if (outputs) {
|
||||
const nodeMap = getWorkflowNodeMap(workflow);
|
||||
for (const nodeId in outputs) {
|
||||
if (isNodeIgnored(nodeId, workflow)) continue;
|
||||
const node = workflow?.nodes?.find(n => String(n.id) === String(nodeId));
|
||||
const node = nodeMap ? nodeMap.get(String(nodeId)) : workflow?.nodes?.find(n => String(n.id) === String(nodeId));
|
||||
const nodeType = node ? (node.type || "") : "";
|
||||
scan(outputs[nodeId], "", "output", nodeType);
|
||||
}
|
||||
@@ -354,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);
|
||||
@@ -374,6 +446,7 @@ export function matchesFilter(state, query) {
|
||||
|
||||
if (state.pid && String(state.pid).toLowerCase().includes(q)) return true;
|
||||
if (state.texts && state.texts.some(t => String(t).toLowerCase().includes(q))) return true;
|
||||
if (state.promptSearchText && state.promptSearchText.includes(q)) return true;
|
||||
if (state.images && state.images.some(img => (img.filename || "").toLowerCase().includes(q))) return true;
|
||||
if (state.activeNodeName && state.activeNodeName.toLowerCase().includes(q)) return true;
|
||||
|
||||
@@ -431,4 +504,104 @@ export async function extractWorkflowFromPng(imageUrl) {
|
||||
console.warn("Comfy Sidebar: Could not extract workflow from PNG", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function animateCardRemoval(cardEl, callback, duration = 200) {
|
||||
if (!cardEl) {
|
||||
if (callback) callback();
|
||||
return;
|
||||
}
|
||||
cardEl.style.transition = `opacity ${duration}ms ease, transform ${duration}ms ease`;
|
||||
cardEl.style.opacity = "0";
|
||||
cardEl.style.transform = "scale(0.85)";
|
||||
setTimeout(() => {
|
||||
if (callback) callback();
|
||||
}, duration);
|
||||
}
|
||||
|
||||
export function getScrollContainer(element) {
|
||||
if (!element) return null;
|
||||
return element.closest('.sidebar-content-container, [class*="sidebar-content-container"], [class*="overflow-y-auto"]')
|
||||
|| element.parentElement
|
||||
|| element;
|
||||
}
|
||||
|
||||
export function calculateGridColumns(width, threshold = 350) {
|
||||
if (!width || width <= 0) return 1;
|
||||
return Math.max(1, Math.floor(width / ((threshold || 350) / 2)));
|
||||
}
|
||||
|
||||
export function downloadJson(data, filename) {
|
||||
if (!data) return;
|
||||
const blob = new Blob([JSON.stringify(data, null, 2)], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename || "workflow.json";
|
||||
a.click();
|
||||
setTimeout(() => URL.revokeObjectURL(url), 1500);
|
||||
}
|
||||
|
||||
export function setupSpotlightTracker(container, cardSelector = ".comfy-sidebar-card") {
|
||||
if (!container) return;
|
||||
container.addEventListener("pointermove", (e) => {
|
||||
const card = e.target.closest(cardSelector);
|
||||
if (card) {
|
||||
const rect = card.getBoundingClientRect();
|
||||
card.style.setProperty("--mouse-x", `${e.clientX - rect.left}px`);
|
||||
card.style.setProperty("--mouse-y", `${e.clientY - rect.top}px`);
|
||||
}
|
||||
}, { passive: true });
|
||||
}
|
||||
|
||||
export function attachDeleteConfirmation(btn, options = {}) {
|
||||
if (!btn) return () => {};
|
||||
const {
|
||||
canDiskDelete = true,
|
||||
timeout = 2000,
|
||||
idleTitle = t("Delete"),
|
||||
confirmTitle = t("Click again to confirm"),
|
||||
confirmDiskTitle = t("Ctrl+Click again to delete from disk"),
|
||||
onConfirm
|
||||
} = options;
|
||||
|
||||
let isPending = false;
|
||||
let isDisk = false;
|
||||
let timer = null;
|
||||
|
||||
const reset = () => {
|
||||
isPending = false;
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
reset();
|
||||
|
||||
btn.onclick = async (ev) => {
|
||||
ev.stopPropagation();
|
||||
const wantsDisk = (ev.ctrlKey || ev.metaKey) && (typeof canDiskDelete === "function" ? canDiskDelete() : !!canDiskDelete);
|
||||
|
||||
if (!isPending) {
|
||||
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);
|
||||
timer = setTimeout(reset, timeout);
|
||||
} else {
|
||||
const finalDisk = isDisk || wantsDisk;
|
||||
reset();
|
||||
if (onConfirm) await onConfirm(finalDisk);
|
||||
}
|
||||
};
|
||||
|
||||
return reset;
|
||||
}
|
||||
@@ -65,10 +65,14 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
const header = document.createElement("div");
|
||||
Object.assign(header.style, {
|
||||
position: "absolute", top: "16px", left: "50%", transform: "translateX(-50%)",
|
||||
display: "flex", gap: "16px", zIndex: "30", color: "#aaa", fontSize: "12px",
|
||||
fontFamily: "monospace", pointerEvents: "none", background: "rgba(10,10,10,0.75)",
|
||||
padding: "6px 14px", borderRadius: "6px", backdropFilter: "blur(4px)",
|
||||
boxShadow: "0 2px 6px rgba(0,0,0,0.4)", maxWidth: "85%", textAlign: "center"
|
||||
display: "flex", gap: "16px", zIndex: "30",
|
||||
color: "var(--muted-foreground, var(--desc-color, #aaa))",
|
||||
fontSize: "12px",
|
||||
fontFamily: "monospace", pointerEvents: "none",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, #181818)) 90%, transparent)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
padding: "6px 14px", borderRadius: "6px", backdropFilter: "blur(8px)",
|
||||
boxShadow: "0 2px 8px rgba(0,0,0,0.4)", maxWidth: "85%", textAlign: "center"
|
||||
});
|
||||
const titleText = document.createElement("span");
|
||||
titleText.textContent = getFilenameFromUrl(baseSrc) || t("3D Model");
|
||||
@@ -85,9 +89,13 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
const loadingSpinner = document.createElement("div");
|
||||
Object.assign(loadingSpinner.style, {
|
||||
position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)",
|
||||
color: "#60a5fa", fontSize: "14px", fontFamily: "sans-serif", zIndex: "20",
|
||||
background: "rgba(0,0,0,0.8)", padding: "10px 18px", borderRadius: "8px",
|
||||
display: "flex", alignItems: "center", gap: "10px"
|
||||
color: "var(--primary, var(--p-primary-color, #ea580c))",
|
||||
fontSize: "14px", fontFamily: "sans-serif", zIndex: "20",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, #181818)) 92%, transparent)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
padding: "10px 18px", borderRadius: "8px",
|
||||
display: "flex", alignItems: "center", gap: "10px",
|
||||
boxShadow: "0 8px 24px rgba(0,0,0,0.5)"
|
||||
});
|
||||
loadingSpinner.innerHTML = `<span class="pi pi-spin pi-spinner" style="font-size: 18px;"></span> ${t("Loading 3D Asset...")}`;
|
||||
overlay.container.appendChild(loadingSpinner);
|
||||
@@ -95,9 +103,13 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
const settingsPanel = document.createElement("div");
|
||||
Object.assign(settingsPanel.style, {
|
||||
position: "absolute", top: "60px", right: "20px", width: "230px",
|
||||
background: "rgba(18, 18, 24, 0.9)", backdropFilter: "blur(8px)",
|
||||
border: "1px solid rgba(255, 255, 255, 0.12)", borderRadius: "8px",
|
||||
padding: "14px", zIndex: "35", color: "#e2e8f0", fontSize: "11px",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, #181818)) 94%, transparent)",
|
||||
backdropFilter: "blur(12px)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
borderRadius: "8px",
|
||||
padding: "14px", zIndex: "35",
|
||||
color: "var(--foreground, #e2e8f0)",
|
||||
fontSize: "11px",
|
||||
boxShadow: "0 8px 24px rgba(0,0,0,0.6)", display: "none", flexDirection: "column", gap: "12px"
|
||||
});
|
||||
|
||||
@@ -106,7 +118,7 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
Object.assign(row.style, { display: "flex", flexDirection: "column", gap: "4px" });
|
||||
const lbl = document.createElement("label");
|
||||
lbl.textContent = label;
|
||||
Object.assign(lbl.style, { color: "#94a3b8", fontSize: "10px", textTransform: "uppercase", fontWeight: "bold" });
|
||||
Object.assign(lbl.style, { color: "var(--muted-foreground, #94a3b8)", fontSize: "10px", textTransform: "uppercase", fontWeight: "bold" });
|
||||
row.append(lbl, inputEl);
|
||||
return row;
|
||||
};
|
||||
@@ -114,7 +126,9 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
const createSelect = (options, value, onChange) => {
|
||||
const sel = document.createElement("select");
|
||||
Object.assign(sel.style, {
|
||||
background: "#252530", color: "#eee", border: "1px solid #444",
|
||||
background: "var(--secondary, #252530)",
|
||||
color: "var(--foreground, #eee)",
|
||||
border: "1px solid var(--border, var(--border-color, #444))",
|
||||
borderRadius: "4px", padding: "4px 6px", fontSize: "11px", outline: "none"
|
||||
});
|
||||
options.forEach(opt => {
|
||||
@@ -131,9 +145,11 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
const toolbar = document.createElement("div");
|
||||
Object.assign(toolbar.style, {
|
||||
position: "absolute", bottom: "20px", left: "50%", transform: "translateX(-50%)",
|
||||
display: "flex", gap: "8px", zIndex: "30", background: "rgba(20,20,25,0.85)",
|
||||
padding: "6px 12px", borderRadius: "8px", backdropFilter: "blur(6px)",
|
||||
boxShadow: "0 4px 12px rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)",
|
||||
display: "flex", gap: "8px", zIndex: "30",
|
||||
background: "color-mix(in srgb, var(--card, var(--secondary, #181818)) 92%, transparent)",
|
||||
padding: "6px 12px", borderRadius: "8px", backdropFilter: "blur(8px)",
|
||||
boxShadow: "0 4px 12px rgba(0,0,0,0.6)",
|
||||
border: "1px solid var(--border, var(--border-color, rgba(255, 255, 255, 0.15)))",
|
||||
alignItems: "center"
|
||||
});
|
||||
|
||||
@@ -141,19 +157,25 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
const btn = document.createElement("button");
|
||||
let active = activeDefault;
|
||||
btn.className = "comfy-sidebar-3d-tool-btn";
|
||||
|
||||
const updateBtnTheme = () => {
|
||||
btn.style.background = active ? "var(--primary, var(--p-primary-color, #ea580c))" : "transparent";
|
||||
btn.style.color = active ? "#ffffff" : "var(--muted-foreground, #aaa)";
|
||||
btn.style.borderColor = active ? "var(--primary, var(--p-primary-color, #ea580c))" : "var(--border, var(--border-color, #444))";
|
||||
};
|
||||
|
||||
Object.assign(btn.style, {
|
||||
background: active ? "#3b82f6" : "transparent", color: active ? "#fff" : "#aaa",
|
||||
border: "1px solid " + (active ? "#3b82f6" : "#444"), borderRadius: "4px",
|
||||
padding: "4px 10px", fontSize: "11px", cursor: "pointer", display: "flex",
|
||||
alignItems: "center", gap: "6px", transition: "all 0.15s ease"
|
||||
borderRadius: "4px", padding: "4px 10px", fontSize: "11px",
|
||||
cursor: "pointer", display: "flex", alignItems: "center", gap: "6px",
|
||||
transition: "all 0.15s ease", border: "1px solid"
|
||||
});
|
||||
updateBtnTheme();
|
||||
|
||||
btn.innerHTML = `<i class="${iconClass}"></i><span>${label}</span>`;
|
||||
btn.onclick = (e) => {
|
||||
e.stopPropagation();
|
||||
active = !active;
|
||||
btn.style.background = active ? "#3b82f6" : "transparent";
|
||||
btn.style.color = active ? "#fff" : "#aaa";
|
||||
btn.style.borderColor = active ? "#3b82f6" : "#444";
|
||||
updateBtnTheme();
|
||||
onClick(active);
|
||||
};
|
||||
return btn;
|
||||
@@ -321,7 +343,19 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
dirLight2.position.set(-5, -5, -5);
|
||||
scene.add(dirLight2);
|
||||
|
||||
gridHelper = new THREE.GridHelper(10, 20, 0x3b82f6, 0x22222a);
|
||||
let gridPrimaryColor = 0xea580c;
|
||||
try {
|
||||
const tempDiv = document.createElement("div");
|
||||
tempDiv.style.color = "var(--primary, var(--p-primary-color, #ea580c))";
|
||||
document.body.appendChild(tempDiv);
|
||||
const rgb = getComputedStyle(tempDiv).color.match(/\d+/g);
|
||||
tempDiv.remove();
|
||||
if (rgb && rgb.length >= 3) {
|
||||
gridPrimaryColor = (Number(rgb[0]) << 16) + (Number(rgb[1]) << 8) + Number(rgb[2]);
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
gridHelper = new THREE.GridHelper(10, 20, gridPrimaryColor, 0x22222a);
|
||||
gridHelper.position.y = 0;
|
||||
scene.add(gridHelper);
|
||||
|
||||
@@ -415,11 +449,21 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
|
||||
const btnResetCam = document.createElement("button");
|
||||
Object.assign(btnResetCam.style, {
|
||||
background: "transparent", color: "#aaa", border: "1px solid #444",
|
||||
background: "transparent",
|
||||
color: "var(--muted-foreground, #aaa)",
|
||||
border: "1px solid var(--border, var(--border-color, #444))",
|
||||
borderRadius: "4px", padding: "4px 10px", fontSize: "11px", cursor: "pointer",
|
||||
display: "flex", alignItems: "center", gap: "6px"
|
||||
display: "flex", alignItems: "center", gap: "6px", transition: "all 0.15s ease"
|
||||
});
|
||||
btnResetCam.innerHTML = `<i class="pi pi-compass"></i><span>${t("Reset View")}</span>`;
|
||||
btnResetCam.onmouseenter = () => {
|
||||
btnResetCam.style.borderColor = "var(--primary, var(--border-color, #fff))";
|
||||
btnResetCam.style.color = "var(--foreground, #fff)";
|
||||
};
|
||||
btnResetCam.onmouseleave = () => {
|
||||
btnResetCam.style.borderColor = "var(--border, var(--border-color, #444))";
|
||||
btnResetCam.style.color = "var(--muted-foreground, #aaa)";
|
||||
};
|
||||
btnResetCam.onclick = (e) => {
|
||||
e.stopPropagation();
|
||||
if (currentModel) fitCameraToObject(camera, currentModel, controls, THREE);
|
||||
@@ -440,9 +484,9 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
exportSelect.value = "";
|
||||
}
|
||||
});
|
||||
exportSelect.style.background = "#1e293b";
|
||||
exportSelect.style.borderColor = "#3b82f6";
|
||||
exportSelect.style.color = "#93c5fd";
|
||||
exportSelect.style.background = "var(--secondary, var(--card, #1e293b))";
|
||||
exportSelect.style.borderColor = "var(--primary, var(--p-primary-color, #ea580c))";
|
||||
exportSelect.style.color = "var(--foreground, #fff)";
|
||||
|
||||
toolbar.append(btnGrid, btnWire, btnRotate, btnResetCam, btnSettings, exportSelect);
|
||||
overlay.container.appendChild(toolbar);
|
||||
@@ -493,12 +537,12 @@ export function create3DViewer(baseSrc, onSwitchMedia = () => {}, onDestroy = ()
|
||||
} else if (ext === "stl" && THREE.STLLoader) {
|
||||
const loader = new THREE.STLLoader();
|
||||
const geometry = await loader.loadAsync(srcUrl);
|
||||
const material = new THREE.MeshStandardMaterial({ color: 0x90caf9, roughness: 0.4, metalness: 0.2 });
|
||||
const material = new THREE.MeshStandardMaterial({ color: 0xd1d5db, roughness: 0.4, metalness: 0.2 });
|
||||
loadedObj = new THREE.Mesh(geometry, material);
|
||||
} else if (ext === "ply" && THREE.PLYLoader) {
|
||||
const loader = new THREE.PLYLoader();
|
||||
const geometry = await loader.loadAsync(srcUrl);
|
||||
const material = new THREE.MeshStandardMaterial({ color: 0x90caf9, roughness: 0.4 });
|
||||
const material = new THREE.MeshStandardMaterial({ color: 0xd1d5db, roughness: 0.4 });
|
||||
loadedObj = new THREE.Mesh(geometry, material);
|
||||
} else if (THREE.GLTFLoader) {
|
||||
const loader = new THREE.GLTFLoader();
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "مسح المهام المتوقفة تلقائياً",
|
||||
"Comfy Layout": "التخطيط الكلاسيكي",
|
||||
"Enable Gallery": "تفعيل المعرض",
|
||||
"Grid Columns Threshold": "حد أعمدة الشبكة",
|
||||
"Hide Junk": "إخفاء العناصر الزائدة",
|
||||
"Latin Hotkeys On Any Layout": "اختصارات لاتينية على أي تخطيط لوحة مفاتيح",
|
||||
"Permanent Delete on Disk Deletion": "حذف نهائي من القرص",
|
||||
"Quick Workflow Picker": "منتقي سير العمل السريع",
|
||||
"Show Pending Count Only": "عرض عدد المهام المعلقة فقط",
|
||||
"Show Working Node Name": "إظهار اسم العقدة النشطة"
|
||||
},
|
||||
"Queue": "قائمة الانتظار",
|
||||
"Search History": "البحث في السجل",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "تجاهل/تضمين العقد المحددة (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "الترتيب: الأحدث أولاً",
|
||||
"Sort: Oldest First": "الترتيب: الأقدم أولاً",
|
||||
"Search Gallery (Filename or Prompt)": "البحث في المعرض (اسم الملف أو الموجه)",
|
||||
"Search filenames or prompt metadata...": "البحث في أسماء الملفات أو بيانات الموجه..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "البحث في أسماء الملفات أو بيانات الموجه...",
|
||||
"Type to load saved workflow...": "اكتب لتحميل سير عمل محفوظ...",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "حد العرض لأعمدة قائمة الانتظار (بكسل)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "عند التعطيل، ستظهر بطاقة منفصلة لكل مهمة في قائمة الانتظار"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "إظهار اسم العقدة قيد التشغيل حالياً"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "مسح المهام الملغاة والفاشلة تلقائياً عند بدء توليد جديد"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "تفعيل الشريط الجانبي لمعرض المخرجات"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "حذف الملفات نهائياً من القرص (تجاوز سلة المحذوفات)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "إخفاء التبويب: الأصول"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "إخفاء التبويب: العقد"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "إخفاء التبويب: النماذج"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "إخفاء التبويب: مسارات العمل"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "إخفاء التبويب: التطبيقات"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "إخفاء التبويب: القوالب"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "استبدال شريط سجل المهام الافتراضي بـ Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "إخفاء زر 'Graph' العائم (خريطة العقد/سير العمل)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "إخفاء الصورة الشخصية"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "عناصر التحكم العائمة للوحة",
|
||||
"options": {
|
||||
"Default": "افتراضي",
|
||||
"Dock": "تثبيت",
|
||||
"Hide": "إخفاء"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "إصلاح اختصارات المفاتيح غير اللاتينية على أي تخطيط لوحة مفاتيح",
|
||||
"tooltip": "يعامل الأحرف غير اللاتينية كمفاتيح لاتينية في نفس الموضع الفيزيائي، لتعمل اختصارات مثل Q و Ctrl+Z أثناء تفعيل أي لغة أخرى. لا يؤثر على الكتابة في حقول النصوص."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "وضع عناصر التحكم وتبويبات سير العمل المفتوحة في شريط علوي موحد"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "منتقي سير العمل السريع",
|
||||
"tooltip": "إظهار منتقي سير العمل السريع عند إنشاء سير عمل فارغ جديد"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "إخفاء زر التشغيل على Comfy Cloud"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,38 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Auto Clear Interrupted",
|
||||
"Comfy Layout": "Comfy Layout",
|
||||
"Enable Gallery": "Enable Gallery",
|
||||
"Grid Columns Threshold": "Grid Columns Threshold",
|
||||
"Hide Junk": "Hide Junk",
|
||||
"Latin Hotkeys On Any Layout": "Latin Hotkeys On Any Layout",
|
||||
"Permanent Delete on Disk Deletion": "Permanent Delete on Disk Deletion",
|
||||
"Quick Workflow Picker": "Quick Workflow Picker",
|
||||
"Show Pending Count Only": "Show Pending Count Only",
|
||||
"Show Working Node Name": "Show Working Node Name"
|
||||
},
|
||||
"Queue": "Queue",
|
||||
"Search History": "Search History",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)",
|
||||
"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",
|
||||
@@ -37,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",
|
||||
@@ -114,5 +152,28 @@
|
||||
"Sort: Newest First": "Sort: Newest First",
|
||||
"Sort: Oldest First": "Sort: Oldest First",
|
||||
"Search Gallery (Filename or Prompt)": "Search Gallery (Filename or Prompt)",
|
||||
"Search filenames or prompt metadata...": "Search filenames or prompt metadata..."
|
||||
}
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Width Threshold for Queue Columns (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "If disabled, each queued job will have a separate individual card"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Shows the name of the node which is currently in the process"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Auto-clear cancelled & failed jobs on new generation"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Enable Output Gallery Sidebar"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"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": "Hide Tab: Assets"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Hide Tab: Nodes"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Hide Tab: Models"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Hide Tab: Workflows"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Hide Tab: Apps"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Hide Tab: Templates"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Replace the stock Job History sidebar with Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Hide floating 'Graph' (Workflow/Node Map) button"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Hide Avatar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Floating Canvas Controls",
|
||||
"options": {
|
||||
"Default": "Default",
|
||||
"Dock": "Dock",
|
||||
"Hide": "Hide"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"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": "Places the controls and the open workflow tabs on a single unified top bar"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Limpiar interrumpidos automáticamente",
|
||||
"Comfy Layout": "Diseño clásico",
|
||||
"Enable Gallery": "Habilitar galería",
|
||||
"Grid Columns Threshold": "Umbral de columnas de cuadrícula",
|
||||
"Hide Junk": "Ocultar elementos innecesarios",
|
||||
"Latin Hotkeys On Any Layout": "Atajos latinos en cualquier distribución",
|
||||
"Permanent Delete on Disk Deletion": "Eliminación permanente del disco",
|
||||
"Quick Workflow Picker": "Selector rápido de flujos de trabajo",
|
||||
"Show Pending Count Only": "Mostrar solo cantidad pendiente",
|
||||
"Show Working Node Name": "Mostrar nombre del nodo activo"
|
||||
},
|
||||
"Queue": "Cola",
|
||||
"Search History": "Buscar en el historial",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Ignorar/Incluir nodo(s) seleccionado(s) (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "Ordenar: más recientes primero",
|
||||
"Sort: Oldest First": "Ordenar: más antiguos primero",
|
||||
"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..."
|
||||
}
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Umbral de ancho para columnas de la cola (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "Si se desactiva, cada tarea en cola tendrá su propia tarjeta individual"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Muestra el nombre del nodo que se está ejecutando actualmente"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Limpiar automáticamente tareas canceladas y fallidas al iniciar una nueva generación"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Habilitar barra lateral de galería de resultados"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Eliminar archivos permanentemente del disco (omite la Papelera)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Ocultar pestaña: Recursos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Ocultar pestaña: Nodos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Ocultar pestaña: Modelos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Ocultar pestaña: Flujos de trabajo"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Ocultar pestaña: Aplicaciones"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Ocultar pestaña: Plantillas"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Reemplazar la barra de Historial de trabajos por Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Ocultar botón flotante 'Graph' (Mapa de nodos/flujo)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Ocultar avatar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Controles flotantes del lienzo",
|
||||
"options": {
|
||||
"Default": "Predeterminado",
|
||||
"Dock": "Acoplar",
|
||||
"Hide": "Ocultar"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "Corregir atajos no ASCII (atajos en cualquier distribución de teclado)",
|
||||
"tooltip": "Trata las letras no latinas como la tecla latina en la misma posición física para que atajos como Q o Ctrl+Z funcionen en cualquier idioma. No afecta a la escritura en campos de texto."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "Coloca los controles y las pestañas de flujos abiertos en una única barra superior"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "پاکسازی خودکار کارهای متوقفشده",
|
||||
"Comfy Layout": "چیدمان کلاسیک",
|
||||
"Enable Gallery": "فعالسازی گالری",
|
||||
"Grid Columns Threshold": "آستانه ستونهای شبکه",
|
||||
"Hide Junk": "پنهان کردن موارد اضافی",
|
||||
"Latin Hotkeys On Any Layout": "کلیدهای میانبر لاتین در هر چیدمان",
|
||||
"Permanent Delete on Disk Deletion": "حذف دائمی از دیسک",
|
||||
"Quick Workflow Picker": "انتخابگر سریع گردش کار",
|
||||
"Show Pending Count Only": "نمایش فقط تعداد در انتظار",
|
||||
"Show Working Node Name": "نمایش نام گره در حال اجرا"
|
||||
},
|
||||
"Queue": "صف",
|
||||
"Search History": "جستجو در تاریخچه",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "نادیده گرفتن گرههای انتخابی در صف (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "مرتبسازی: جدیدترینها در ابتدا",
|
||||
"Sort: Oldest First": "مرتبسازی: قدیمیترینها در ابتدا",
|
||||
"Search Gallery (Filename or Prompt)": "جستجو در گالری (نام فایل یا پرامپت)",
|
||||
"Search filenames or prompt metadata...": "جستجوی نام فایلها یا متادیتای پرامپت..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "جستجوی نام فایلها یا متادیتای پرامپت...",
|
||||
"Type to load saved workflow...": "برای بارگذاری گردش کار ذخیرهشده تایپ کنید...",
|
||||
"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 اسکن شد"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "آستانه عرض برای ستونهای صف (پیکسل)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "در صورت غیرفعال شدن، هر کار در صف یک کارت جداگانه خواهد داشت"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "نمایش نام گرهای که در حال حاضر در حال اجرا است"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "پاکسازی خودکار کارهای لغوشده و ناموفق هنگام تولید جدید"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "فعالسازی نوار کناری گالری خروجیها"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "حذف دائمی فایلها از دیسک (بدون انتقال به سطل زباله)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "پنهان کردن زبانه: داراییها"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "پنهان کردن زبانه: گرهها"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "پنهان کردن زبانه: مدلها"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "پنهان کردن زبانه: گردشهای کار"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "پنهان کردن زبانه: برنامهها"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "پنهان کردن زبانه: قالبها"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "جایگزینی نوار کناری تاریخچه پیشفرض با Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "پنهان کردن دکمه شناور 'Graph' (نقشه گرهها)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "پنهان کردن آواتار"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "کنترلهای شناور بوم",
|
||||
"options": {
|
||||
"Default": "پیشفرض",
|
||||
"Dock": "چسباندن",
|
||||
"Hide": "پنهان"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "اصلاح کلیدهای میانبر غیرلاتین در هر چیدمان صفحهکلید",
|
||||
"tooltip": "حروف غیرلاتین را معادل کلید لاتین در همان موقعیت فیزیکی در نظر میگیرد تا میانبرهایی مانند Q یا Ctrl+Z در هر زبانی کار کنند. تایپ در فیلدهای متنی تحت تأثیر قرار نمیگیرد."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "قرار دادن کنترلها و زبانههای گردش کار باز در یک نوار بالایی یکپارچه"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "انتخابگر سریع گردش کار",
|
||||
"tooltip": "نمایش انتخابگر سریع گردش کار هنگام ایجاد یک گردش کار خالی جدید"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "پنهان کردن دکمه اجرا در Comfy Cloud"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Nettoyage auto des tâches interrompues",
|
||||
"Comfy Layout": "Disposition classique",
|
||||
"Enable Gallery": "Activer la galerie",
|
||||
"Grid Columns Threshold": "Seuil des colonnes de la grille",
|
||||
"Hide Junk": "Masquer les éléments superflus",
|
||||
"Latin Hotkeys On Any Layout": "Raccourcis latins sur toute disposition",
|
||||
"Permanent Delete on Disk Deletion": "Suppression définitive du disque",
|
||||
"Quick Workflow Picker": "Sélecteur rapide de workflow",
|
||||
"Show Pending Count Only": "Afficher uniquement le nombre en attente",
|
||||
"Show Working Node Name": "Afficher le nom du nœud actif"
|
||||
},
|
||||
"Queue": "File d'attente",
|
||||
"Search History": "Rechercher dans l'historique",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Ignorer/Activer les nœuds sélectionnés (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "Trier : Plus récents d'abord",
|
||||
"Sort: Oldest First": "Trier : Plus anciens d'abord",
|
||||
"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..."
|
||||
}
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Seuil de largeur pour les colonnes de la file (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "Si désactivé, chaque tâche en attente aura sa propre carte"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Affiche le nom du nœud en cours d'exécution"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Nettoyer automatiquement les tâches annulées et échouées à chaque nouvelle génération"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Activer le panneau latéral Galerie des sorties"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Supprimer définitivement les fichiers du disque (contourne la Corbeille)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Masquer l'onglet : Ressources"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Masquer l'onglet : Nœuds"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Masquer l'onglet : Modèles"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Masquer l'onglet : Workflows"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Masquer l'onglet : Applications"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Masquer l'onglet : Modèles de workflow"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Remplacer l'historique des tâches par défaut par Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Masquer le bouton flottant 'Graph' (carte du workflow)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Masquer l'avatar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Contrôles flottants du canevas",
|
||||
"options": {
|
||||
"Default": "Par défaut",
|
||||
"Dock": "Ancrer",
|
||||
"Hide": "Masquer"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "Corriger les raccourcis non-ASCII (quelle que soit la disposition du clavier)",
|
||||
"tooltip": "Interprète les touches non latines comme la touche latine à la même position physique afin que Q ou Ctrl+Z fonctionnent dans toute disposition. La saisie dans les champs texte n'est pas affectée."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "Place les contrôles et les onglets de workflows ouverts sur une seule barre supérieure"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "ניקוי אוטומטי של משימות שהופסקו",
|
||||
"Comfy Layout": "פריסה קלאסית",
|
||||
"Enable Gallery": "הפעל גלריה",
|
||||
"Grid Columns Threshold": "סף עמודות רשת",
|
||||
"Hide Junk": "הסתר פריטים מיותרים",
|
||||
"Latin Hotkeys On Any Layout": "קיצורי מקשים לטיניים בכל פריסה",
|
||||
"Permanent Delete on Disk Deletion": "מחיקה לצמיתות מהדיסק",
|
||||
"Quick Workflow Picker": "בוחר תהליכי עבודה מהיר",
|
||||
"Show Pending Count Only": "הצג רק מספר משימות בהמתנה",
|
||||
"Show Working Node Name": "הצג שם צומת פעיל"
|
||||
},
|
||||
"Queue": "תור",
|
||||
"Search History": "חיפוש בהיסטוריה",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "התעלם/כלול צמתים נבחרים בתור (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "מיון: החדשים ביותר קודם",
|
||||
"Sort: Oldest First": "מיון: הישנים ביותר קודם",
|
||||
"Search Gallery (Filename or Prompt)": "חיפוש בגלריה (שם קובץ או פרומפט)",
|
||||
"Search filenames or prompt metadata...": "חיפוש שמות קבצים או מטא-דאטה של פרומפט..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "חיפוש שמות קבצים או מטא-דאטה של פרומפט...",
|
||||
"Type to load saved workflow...": "הקלד כדי לטעון תהליך עבודה שמור...",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "סף רוחב לעמודות התור (פיקסלים)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "אם כבוי, לכל משימה בתור יהיה כרטיס נפרד"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "מציג את שם הצומת שנמצא כעת בעיבוד"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "נקה אוטומטית משימות שבוטלו או נכשלו ביצירה חדשה"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "הפעל סרגל צד של גלריית תוצאות"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "מחק קבצים לצמיתות מהדיסק (עוקף את סל המיחזור)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "הסתר לשונית: נכסים"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "הסתר לשונית: צמתים"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "הסתר לשונית: מודלים"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "הסתר לשונית: תהליכי עבודה"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "הסתר לשונית: יישומים"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "הסתר לשונית: תבניות"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "החלף את סרגל היסטוריית המשימות הרגיל ב-Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "הסתר את הכפתור הצף 'Graph' (מפת צמתים)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "הסתר תמונת פרופיל"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "פקדי קנבס צפים",
|
||||
"options": {
|
||||
"Default": "ברירת מחדל",
|
||||
"Dock": "עגון",
|
||||
"Hide": "הסתר"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "תקן קיצורי מקשים לא-לטיניים בכל פריסת מקלדת",
|
||||
"tooltip": "מתייחס לאותיות לא-לטיניות כמקש הלטיני באותו מיקום פיזי, כך שקיצורים כמו Q או Ctrl+Z יעבדו בכל שפה. הקלדה בשדות טקסט אינה מושפעת."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "מציב את הפקדים ואת לשוניות תהליכי העבודה הפתוחים בסרגל עליון אחד"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "בוחר תהליכי עבודה מהיר",
|
||||
"tooltip": "הצג בוחר תהליכי עבודה מהיר בעת יצירת תהליך עבודה ריק חדש"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "הסתרת כפתור ההפעלה ב-Comfy Cloud"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Pulizia automatica lavori interrotti",
|
||||
"Comfy Layout": "Layout classico",
|
||||
"Enable Gallery": "Abilita galleria",
|
||||
"Grid Columns Threshold": "Soglia colonne griglia",
|
||||
"Hide Junk": "Nascondi elementi superflui",
|
||||
"Latin Hotkeys On Any Layout": "Scorciatoie latine su qualsiasi layout",
|
||||
"Permanent Delete on Disk Deletion": "Eliminazione permanente dal disco",
|
||||
"Quick Workflow Picker": "Selettore rapido dei workflow",
|
||||
"Show Pending Count Only": "Mostra solo conteggio in attesa",
|
||||
"Show Working Node Name": "Mostra nome del nodo attivo"
|
||||
},
|
||||
"Queue": "Coda",
|
||||
"Search History": "Cerca nella cronologia",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Ignora/Attiva nodo/i selezionato/i (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "Ordina: Più recenti prima",
|
||||
"Sort: Oldest First": "Ordina: Più vecchi prima",
|
||||
"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..."
|
||||
}
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Soglia larghezza per le colonne della coda (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "Se disattivato, ogni attività in coda avrà una scheda separata"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Mostra il nome del nodo attualmente in esecuzione"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Pulisci automaticamente i lavori annullati e falliti a ogni nuova generazione"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Abilita barra laterale Galleria risultati"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Elimina definitivamente i file dal disco (bypassa il Cestino)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Nascondi scheda: Risorse"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Nascondi scheda: Nodi"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Nascondi scheda: Modelli"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Nascondi scheda: Workflow"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Nascondi scheda: App"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Nascondi scheda: Template"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Sostituisci la barra Cronologia lavori predefinita con Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Nascondi pulsante flottante 'Graph' (Mappa nodi/workflow)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Nascondi avatar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Controlli flottanti dell'area di lavoro",
|
||||
"options": {
|
||||
"Default": "Predefinito",
|
||||
"Dock": "Aggancia",
|
||||
"Hide": "Nascondi"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "Correggi scorciatoie non-ASCII su qualsiasi layout di tastiera",
|
||||
"tooltip": "Tratta le lettere non latine come il tasto latino nella stessa posizione fisica, così scorciatoie come Q o Ctrl+Z funzionano con qualsiasi layout. La digitazione nei campi di testo non viene modificata."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "Posiziona i controlli e le schede dei workflow aperti in un'unica barra superiore"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "中断・失敗したジョブを自動消去",
|
||||
"Comfy Layout": "クラシックレイアウト",
|
||||
"Enable Gallery": "ギャラリーを有効化",
|
||||
"Grid Columns Threshold": "グリッド列の幅しきい値",
|
||||
"Hide Junk": "不要な要素を非表示",
|
||||
"Latin Hotkeys On Any Layout": "すべてのキーボード配列でラテン文字ホットキーを有効化",
|
||||
"Permanent Delete on Disk Deletion": "ディスクから完全削除",
|
||||
"Quick Workflow Picker": "クイックワークフローピッカー",
|
||||
"Show Pending Count Only": "待機中の件数のみ表示",
|
||||
"Show Working Node Name": "実行中のノード名を表示"
|
||||
},
|
||||
"Queue": "キュー",
|
||||
"Search History": "履歴を検索",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "選択したノードをキューで無視/解除 (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "並び替え:新しい順",
|
||||
"Sort: Oldest First": "並び替え:古い順",
|
||||
"Search Gallery (Filename or Prompt)": "ギャラリーを検索 (ファイル名またはプロンプト)",
|
||||
"Search filenames or prompt metadata...": "ファイル名またはプロンプトを検索..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "ファイル名またはプロンプトを検索...",
|
||||
"Type to load saved workflow...": "保存済みワークフローを読み込むには入力...",
|
||||
"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 をスキャン"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "キュー列を分割する幅のしきい値 (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "無効にすると、待機中のジョブごとに個別のカードが表示されます"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "現在処理中のノード名を表示します"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "新規生成時にキャンセル・失敗したジョブを自動消去する"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "出力ギャラリーサイドバーを有効にする"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "ディスクから削除する際にゴミ箱を経由せず完全に削除する"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "タブを非表示: アセット"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "タブを非表示: ノード"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "タブを非表示: モデル"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "タブを非表示: ワークフロー"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "タブを非表示: アプリ"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "タブを非表示: テンプレート"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "標準のジョブ履歴サイドバーを Comfy Queue に置き換える"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "フローティングの 'Graph'(ワークフローマップ)ボタンを非表示"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "アバターを非表示"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "フローティングキャンバスコントロール",
|
||||
"options": {
|
||||
"Default": "デフォルト",
|
||||
"Dock": "ドックに固定",
|
||||
"Hide": "非表示"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "非ASCIIキーバインドの修正(どのキーボード配列でもホットキーを有効化)",
|
||||
"tooltip": "非ラテン文字を同じ物理位置のラテン文字キーとして扱うため、他の入力配列でも Q や Ctrl+Z などが動作します。テキスト入力欄には影響しません。"
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "操作ボタンと開いているワークフロータブを単一の上部バーにまとめる"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "クイックワークフローピッカー",
|
||||
"tooltip": "新しい空のワークフローを作成するときにクイックワークフローピッカーを表示する"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "Comfy Cloudで実行ボタンを非表示"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "중단된 작업 자동 지우기",
|
||||
"Comfy Layout": "클래식 레이아웃",
|
||||
"Enable Gallery": "갤러리 활성화",
|
||||
"Grid Columns Threshold": "그리드 열 너비 임계값",
|
||||
"Hide Junk": "불필요한 항목 숨기기",
|
||||
"Latin Hotkeys On Any Layout": "모든 키보드 배열에서 라틴 단축키 지원",
|
||||
"Permanent Delete on Disk Deletion": "디스크에서 영구 삭제",
|
||||
"Quick Workflow Picker": "빠른 워크플로우 선택기",
|
||||
"Show Pending Count Only": "대기 중인 작업 수만 표시",
|
||||
"Show Working Node Name": "실행 중인 노드 이름 표시"
|
||||
},
|
||||
"Queue": "대기열",
|
||||
"Search History": "기록 검색",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "대기열에서 선택한 노드 무시/해제 (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "정렬: 최신순",
|
||||
"Sort: Oldest First": "정렬: 오래된순",
|
||||
"Search Gallery (Filename or Prompt)": "갤러리 검색 (파일명 또는 프롬프트)",
|
||||
"Search filenames or prompt metadata...": "파일명 또는 프롬프트 메타데이터 검색..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "파일명 또는 프롬프트 메타데이터 검색...",
|
||||
"Type to load saved workflow...": "저장된 워크플로우를 불러오려면 입력하세요...",
|
||||
"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}개 스캔 완료"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "대기열 열 분할 너비 임계값 (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "비활성화하면 대기 중인 각 작업마다 개별 카드가 표시됩니다"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "현재 실행 중인 노드의 이름을 표시합니다"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "새 생성 시작 시 취소 및 실패한 작업 자동 지우기"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "출력 갤러리 사이드바 활성화"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "디스크에서 삭제 시 휴지통을 거치지 않고 영구 삭제"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "탭 숨기기: 에셋"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "탭 숨기기: 노드"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "탭 숨기기: 모델"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "탭 숨기기: 워크플로우"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "탭 숨기기: 앱"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "탭 숨기기: 템플릿"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "기본 작업 기록 사이드바를 Comfy Queue로 대체"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "플로팅 'Graph'(워크플로우 맵) 버튼 숨기기"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "아바타 숨기기"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "플로팅 캔버스 컨트롤",
|
||||
"options": {
|
||||
"Default": "기본값",
|
||||
"Dock": "고정",
|
||||
"Hide": "숨기기"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "비ASCII 단축키 수정 (모든 키보드 배열에서 단축키 사용)",
|
||||
"tooltip": "비라틴 문자를 같은 물리적 위치의 라틴 키로 처리하여 다른 입력기에서도 Q나 Ctrl+Z 같은 단축키가 동작합니다. 텍스트 입력란 타이핑에는 영향을 주지 않습니다."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "컨트롤과 열린 워크플로우 탭을 하나의 상단 바에 배치합니다"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "빠른 워크플로우 선택기",
|
||||
"tooltip": "새 빈 워크플로우를 만들 때 빠른 워크플로우 선택기 표시"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "Comfy Cloud에서 실행 버튼 숨기기"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Limpar interrompidos automaticamente",
|
||||
"Comfy Layout": "Layout clássico",
|
||||
"Enable Gallery": "Ativar galeria",
|
||||
"Grid Columns Threshold": "Limite de colunas da grade",
|
||||
"Hide Junk": "Ocultar itens desnecessários",
|
||||
"Latin Hotkeys On Any Layout": "Atalhos latinos em qualquer layout",
|
||||
"Permanent Delete on Disk Deletion": "Exclusão permanente no disco",
|
||||
"Quick Workflow Picker": "Seletor Rápido de Fluxos",
|
||||
"Show Pending Count Only": "Mostrar apenas contagem pendente",
|
||||
"Show Working Node Name": "Mostrar nome do nó ativo"
|
||||
},
|
||||
"Queue": "Fila",
|
||||
"Search History": "Pesquisar histórico",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Ignorar/Incluir nó(s) selecionado(s) na fila (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "Ordenar: Mais recentes primeiro",
|
||||
"Sort: Oldest First": "Ordenar: Mais antigos primeiro",
|
||||
"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..."
|
||||
}
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Limite de largura para colunas da fila (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "Se desativado, cada tarefa na fila terá um card individual"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Mostra o nome do nó que está em execução no momento"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Limpar automaticamente tarefas canceladas e com erro ao iniciar nova geração"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Ativar barra lateral da Galeria de saídas"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Excluir arquivos permanentemente do disco (ignora a Lixeira)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Ocultar aba: Recursos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Ocultar aba: Nós"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Ocultar aba: Modelos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Ocultar aba: Fluxos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Ocultar aba: Aplicativos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Ocultar aba: Modelos prontos"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Substituir o Histórico de tarefas padrão pelo Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Ocultar botão flutuante 'Graph' (Mapa de nós)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Ocultar avatar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Controles flutuantes do canvas",
|
||||
"options": {
|
||||
"Default": "Padrão",
|
||||
"Dock": "Acoplar",
|
||||
"Hide": "Ocultar"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "Corrigir atalhos não-ASCII em qualquer layout de teclado",
|
||||
"tooltip": "Trata letras não latinas como a tecla latina na mesma posição física para que atalhos como Q ou Ctrl+Z funcionem em qualquer idioma. Não afeta a digitação em campos de texto."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "Coloca os controles e as abas de fluxos abertos em uma única barra superior"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Автоочистка прерванных",
|
||||
"Comfy Layout": "Классическая компоновка",
|
||||
"Enable Gallery": "Включить галерею",
|
||||
"Grid Columns Threshold": "Порог колонок сетки",
|
||||
"Hide Junk": "Скрыть лишнее",
|
||||
"Latin Hotkeys On Any Layout": "Латинские горячие клавиши на любой раскладке",
|
||||
"Permanent Delete on Disk Deletion": "Безвозвратное удаление с диска",
|
||||
"Quick Workflow Picker": "Быстрый выбор рабочего процесса",
|
||||
"Show Pending Count Only": "Показывать только счётчик очереди",
|
||||
"Show Working Node Name": "Показывать имя активного узла"
|
||||
},
|
||||
"Queue": "Очередь",
|
||||
"Search History": "Поиск по истории",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Игнорировать выбранные ноды в очереди (Ctrl+Q)",
|
||||
@@ -6,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": "Наверх",
|
||||
@@ -37,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": "Предупреждение",
|
||||
@@ -114,5 +146,28 @@
|
||||
"Sort: Newest First": "Сортировка: сначала новые",
|
||||
"Sort: Oldest First": "Сортировка: сначала старые",
|
||||
"Search Gallery (Filename or Prompt)": "Поиск по галерее (имя файла или промпт)",
|
||||
"Search filenames or prompt metadata...": "Поиск по именам файлов или промптам..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "Поиск по именам файлов или промптам...",
|
||||
"Type to load saved workflow...": "Найти сохранённый рабочий процесс...",
|
||||
"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}"
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Ширина в пикселях для разделения очереди на несколько колонок"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "Если отключено, для каждой задачи в очереди будет отдельная карточка"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Показывать имя узла, который сейчас выполняется"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Автоматически очищать отменённые и неудачные задачи при новой генерации"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Включить боковую панель галереи результатов"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Удалять файлы с диска безвозвратно (минуя Корзину)"
|
||||
},
|
||||
"Comfy Sidebar_Remove Cards With Missing Files": {
|
||||
"name": "Удалять карточки очереди, если их файлов больше нет (например, после очистки папки temp)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Скрыть вкладку: Ассеты"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Скрыть вкладку: Узлы"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Скрыть вкладку: Модели"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Скрыть вкладку: Рабочие процессы"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Скрыть вкладку: Приложения"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Скрыть вкладку: Шаблоны"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Заменить стандартную историю заданий на Comfy Queue"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Скрыть плавающую кнопку 'Graph' (карта рабочего процесса)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Скрыть аватар"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Плавающие элементы управления холстом",
|
||||
"options": {
|
||||
"Default": "По умолчанию",
|
||||
"Dock": "Закрепить",
|
||||
"Hide": "Скрыть"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "Исправить нелатинские горячие клавиши (работа на любой раскладке)",
|
||||
"tooltip": "Обрабатывает нелатинские буквы (например, кириллицу) как соответствующие латинские клавиши, чтобы горячие клавиши вроде Q или Ctrl+Z работали на любой раскладке. На ввод текста в полях не влияет."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "Разместить элементы управления и открытые вкладки на единой верхней панели"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "Быстрый выбор рабочего процесса",
|
||||
"tooltip": "Показывать быстрый выбор при создании нового пустого рабочего процесса"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "Скрыть кнопку «Запустить в Comfy Cloud»"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"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"
|
||||
},
|
||||
"Queue": "Kuyruk",
|
||||
"Search History": "Geçmişte ara",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "Seçili düğümleri kuyrukta yoksay/etkinleştir (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "Sıralama: Önce En Yeniler",
|
||||
"Sort: Oldest First": "Sıralama: Önce En Eskiler",
|
||||
"Search Gallery (Filename or Prompt)": "Galeride Ara (Dosya Adı veya Prompt)",
|
||||
"Search filenames or prompt metadata...": "Dosya adlarını veya prompt meta verilerini ara..."
|
||||
}
|
||||
"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",
|
||||
"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ı"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "Kuyruk sütunları için genişlik eşiği (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "Devre dışı bırakılırsa, kuyruktaki her iş için ayrı kart gösterilir"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "Şu anda işlenmekte olan düğümün adını gösterir"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "Yeni üretimde iptal edilen ve başarısız işleri otomatik temizle"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "Çıktı Galerisi Kenar Çubuğunu Etkinleştir"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Diskten silerken dosyaları kalıcı olarak sil (Çöp Kutusunu atlar)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Sekmeyi Gizle: Varlıklar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "Sekmeyi Gizle: Düğümler"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "Sekmeyi Gizle: Modeller"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "Sekmeyi Gizle: İş Akışları"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "Sekmeyi Gizle: Uygulamalar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "Sekmeyi Gizle: Şablonlar"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "Varsayılan İş Geçmişi kenar çubuğunu Comfy Queue ile değiştir"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "Yüzen 'Graph' (İş Akışı/Düğüm Haritası) düğmesini gizle"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "Avatarı Gizle"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "Yüzen Tuval Kontrolleri",
|
||||
"options": {
|
||||
"Default": "Varsayılan",
|
||||
"Dock": "Sabitle",
|
||||
"Hide": "Gizle"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "ASCII dışı kısayolları düzelt (her klavye düzeninde kısayollar)",
|
||||
"tooltip": "Latin olmayan harfleri aynı fiziksel konumdaki Latin tuşu gibi işleyerek Q veya Ctrl+Z gibi kısayolların her klavye düzeninde çalışmasını sağlar. Metin alanlarına yazmayı etkilemez."
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "Kontrolleri ve açık iş akışı sekmelerini tek bir üst çubuğa yerleştirir"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "自動清除已中斷任務",
|
||||
"Comfy Layout": "經典版面配置",
|
||||
"Enable Gallery": "啟用圖庫",
|
||||
"Grid Columns Threshold": "網格欄寬閾值",
|
||||
"Hide Junk": "隱藏多餘元素",
|
||||
"Latin Hotkeys On Any Layout": "任意鍵盤配置下使用拉丁快速鍵",
|
||||
"Permanent Delete on Disk Deletion": "從磁碟永久刪除",
|
||||
"Quick Workflow Picker": "快速工作流程選擇器",
|
||||
"Show Pending Count Only": "僅顯示等待數量",
|
||||
"Show Working Node Name": "顯示目前執行節點名稱"
|
||||
},
|
||||
"Queue": "隊列",
|
||||
"Search History": "搜尋歷史",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "在隊列中忽略選取節點 (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "排序:最新優先",
|
||||
"Sort: Oldest First": "排序:最舊優先",
|
||||
"Search Gallery (Filename or Prompt)": "搜尋圖庫 (檔案名稱或提示詞)",
|
||||
"Search filenames or prompt metadata...": "搜尋檔案名稱或提示詞元資料..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "搜尋檔案名稱或提示詞元資料...",
|
||||
"Type to load saved workflow...": "輸入以載入已儲存的工作流程...",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "佇列分欄的寬度閾值 (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "關閉後,每個排隊任務將顯示為獨立的卡片"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "顯示目前正在執行的節點名稱"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "開始新生成時自動清除已取消和失敗的任務"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "啟用輸出圖庫側邊欄"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "從磁碟刪除時永久刪除檔案(略過資源回收筒)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "隱藏分頁:資產"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "隱藏分頁:節點"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "隱藏分頁:模型"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "隱藏分頁:工作流程"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "隱藏分頁:應用程式"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "隱藏分頁:範本"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "使用 Comfy Queue 取代預設任務歷程側邊欄"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "隱藏浮動 'Graph'(工作流程/節點地圖)按鈕"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "隱藏頭像"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "浮動畫布控制列",
|
||||
"options": {
|
||||
"Default": "預設",
|
||||
"Dock": "停靠",
|
||||
"Hide": "隱藏"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "修正非 ASCII 快速鍵(任意鍵盤配置下使用快速鍵)",
|
||||
"tooltip": "將非拉丁字元按鍵識別為相同實體位置的拉丁鍵位,使 Q 或 Ctrl+Z 等快速鍵在任意輸入法配置下都能正常運作。不影響文字框輸入。"
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "將控制按鈕與開啟的工作流程分頁整合至單一頂部列"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "快速工作流程選擇器",
|
||||
"tooltip": "建立新的空白工作流程時顯示快速工作流程選擇器"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "隱藏「在 Comfy Cloud 上執行」按鈕"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "自动清除已中断任务",
|
||||
"Comfy Layout": "经典布局",
|
||||
"Enable Gallery": "启用图库",
|
||||
"Grid Columns Threshold": "网格列宽阈值",
|
||||
"Hide Junk": "隐藏多余元素",
|
||||
"Latin Hotkeys On Any Layout": "任意输入法布局下使用拉丁快捷键",
|
||||
"Permanent Delete on Disk Deletion": "从磁盘永久删除",
|
||||
"Quick Workflow Picker": "快速工作流选择器",
|
||||
"Show Pending Count Only": "仅显示等待数量",
|
||||
"Show Working Node Name": "显示当前运行节点名称"
|
||||
},
|
||||
"Queue": "队列",
|
||||
"Search History": "搜索历史",
|
||||
"Toggle Ignore Selected Node(s) in Queue (Ctrl+Q)": "在队列中忽略所选节点 (Ctrl+Q)",
|
||||
@@ -114,5 +127,36 @@
|
||||
"Sort: Newest First": "排序:最新优先",
|
||||
"Sort: Oldest First": "排序:最早优先",
|
||||
"Search Gallery (Filename or Prompt)": "搜索图库 (文件名或提示词)",
|
||||
"Search filenames or prompt metadata...": "搜索文件名或提示词元数据..."
|
||||
}
|
||||
"Search filenames or prompt metadata...": "搜索文件名或提示词元数据...",
|
||||
"Type to load saved workflow...": "输入以加载已保存的工作流...",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"Comfy Sidebar_Grid Columns Threshold": {
|
||||
"name": "队列分栏的宽度阈值 (px)"
|
||||
},
|
||||
"Comfy Sidebar_Show Pending Count Only": {
|
||||
"name": "关闭后,每个排队任务将显示为单独的卡片"
|
||||
},
|
||||
"Comfy Sidebar_Show Working Node Name": {
|
||||
"name": "显示当前正在运行的节点名称"
|
||||
},
|
||||
"Comfy Sidebar_Auto Clear Interrupted": {
|
||||
"name": "开始新生成时自动清除已取消和失败的任务"
|
||||
},
|
||||
"Comfy Sidebar_Enable Gallery": {
|
||||
"name": "启用输出图库侧边栏"
|
||||
},
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "从磁盘删除时永久删除文件(跳过回收站)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "隐藏标签页:资产"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Nodes": {
|
||||
"name": "隐藏标签页:节点"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Models": {
|
||||
"name": "隐藏标签页:模型"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Workflows": {
|
||||
"name": "隐藏标签页:工作流"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Apps": {
|
||||
"name": "隐藏标签页:应用"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Templates": {
|
||||
"name": "隐藏标签页:模板"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Override Stock Job History Tab": {
|
||||
"name": "用 Comfy Queue 替换默认任务历史侧边栏"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Graph Button": {
|
||||
"name": "隐藏浮动 'Graph'(工作流/节点地图)按钮"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Avatar": {
|
||||
"name": "隐藏头像"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Floating Canvas Controls": {
|
||||
"name": "浮动画布控制栏",
|
||||
"options": {
|
||||
"Default": "默认",
|
||||
"Dock": "停靠",
|
||||
"Hide": "隐藏"
|
||||
}
|
||||
},
|
||||
"Comfy Sidebar_Latin Hotkeys On Any Layout": {
|
||||
"name": "修复非 ASCII 快捷键(任意输入法下使用快捷键)",
|
||||
"tooltip": "将非拉丁字符按键识别为同物理位置的拉丁键位,使 Q 或 Ctrl+Z 等快捷键在任意布局下都能生效。不影响文本框输入。"
|
||||
},
|
||||
"Comfy Sidebar_Comfy Layout": {
|
||||
"name": "将控制按钮和打开的工作流标签整合到单一顶部栏"
|
||||
},
|
||||
"Comfy Sidebar_Quick Workflow Picker": {
|
||||
"name": "快速工作流选择器",
|
||||
"tooltip": "创建新的空白工作流时显示快速工作流选择器"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Run on Comfy Cloud": {
|
||||
"name": "隐藏“在 Comfy Cloud 上运行”按钮"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,420 @@
|
||||
"""Extract searchable prompt text from ComfyUI prompt graphs and PNG outputs.
|
||||
|
||||
This module has no ComfyUI imports, so it can be used and tested on its own.
|
||||
|
||||
How it works
|
||||
------------
|
||||
* Only the PNG ``prompt`` text chunk is read. Other chunks (notably the often
|
||||
multi-megabyte ``workflow`` chunk) are skipped with a seek, never parsed.
|
||||
* From API-format prompt graphs (whether supplied by Queue or read from PNGs),
|
||||
collect only the strings that actually
|
||||
feed a text-encoder node (``CLIPTextEncode`` and friends), following links to
|
||||
upstream string/primitive/concat nodes. Model names, sampler names, file
|
||||
names and other string widgets are ignored.
|
||||
* Extracted text is cached per file (keyed by mtime + size), so repeated
|
||||
searches only pay for files that are new or changed.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import struct
|
||||
import sys
|
||||
import threading
|
||||
import zlib
|
||||
from collections import OrderedDict
|
||||
|
||||
_PNG_SIGNATURE = b"\x89PNG\r\n\x1a\n"
|
||||
|
||||
# Input names that can carry prompt text (substring match, lower-case).
|
||||
# Deliberately does not match plain "clip", "model", "vae", "image", etc.
|
||||
_PROMPT_KEY_HINTS = (
|
||||
"text", "prompt", "positive", "negative", "caption",
|
||||
"string", "value", "t5xxl", "clip_l", "clip_g",
|
||||
)
|
||||
_MAX_LINK_DEPTH = 6
|
||||
_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, segments, (width, height))
|
||||
_cache_lock = threading.Lock()
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Prompt graph -> text
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def _is_prompt_key(name):
|
||||
lowered = str(name).lower()
|
||||
return any(hint in lowered for hint in _PROMPT_KEY_HINTS)
|
||||
|
||||
|
||||
def _is_encoder(class_type):
|
||||
lowered = str(class_type or "").lower()
|
||||
return "textencode" in lowered or "prompt" in lowered
|
||||
|
||||
|
||||
def _is_link(value):
|
||||
# API-format link: [source_node_id, output_slot]
|
||||
return isinstance(value, list) and len(value) == 2 and isinstance(value[1], int)
|
||||
|
||||
|
||||
def extract_prompt_texts(prompt):
|
||||
"""Return the prompt strings found in an API-format ComfyUI prompt dict."""
|
||||
if not isinstance(prompt, dict):
|
||||
return []
|
||||
|
||||
texts = []
|
||||
seen = set()
|
||||
|
||||
def visit(node_id, depth):
|
||||
key = str(node_id)
|
||||
if key in seen or depth > _MAX_LINK_DEPTH:
|
||||
return
|
||||
seen.add(key)
|
||||
node = prompt.get(key)
|
||||
inputs = node.get("inputs") if isinstance(node, dict) else None
|
||||
if not isinstance(inputs, dict):
|
||||
return
|
||||
for name, value in inputs.items():
|
||||
if not _is_prompt_key(name):
|
||||
continue
|
||||
if isinstance(value, str):
|
||||
if value.strip():
|
||||
texts.append(value)
|
||||
elif _is_link(value):
|
||||
visit(value[0], depth + 1)
|
||||
|
||||
starts = [
|
||||
node_id for node_id, node in prompt.items()
|
||||
if isinstance(node, dict) and _is_encoder(node.get("class_type"))
|
||||
]
|
||||
if not starts:
|
||||
# Unusual graph with no recognisable text-encoder node: fall back to
|
||||
# every node, still restricted to prompt-like input names.
|
||||
starts = list(prompt)
|
||||
for node_id in starts:
|
||||
visit(node_id, 0)
|
||||
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]
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# PNG chunk reading
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def _inflate(data, limit=_MAX_PROMPT_CHUNK_BYTES):
|
||||
# Bounded decompress: refuses to expand beyond `limit` bytes.
|
||||
return zlib.decompressobj().decompress(data, limit)
|
||||
|
||||
|
||||
def _decode_text_chunk(chunk_type, data, nul):
|
||||
"""Decode tEXt / zTXt / iTXt chunk data (keyword already located at `nul`)."""
|
||||
if chunk_type == b"tEXt":
|
||||
return data[nul + 1:].decode("latin-1")
|
||||
|
||||
if chunk_type == b"zTXt":
|
||||
if data[nul + 1] != 0: # only compression method 0 (zlib) exists
|
||||
return None
|
||||
return _inflate(data[nul + 2:]).decode("latin-1")
|
||||
|
||||
# iTXt: keyword\0 compression_flag compression_method language\0 translated\0 text
|
||||
flag = data[nul + 1]
|
||||
rest = data[nul + 3:]
|
||||
lang_end = rest.index(b"\x00")
|
||||
translated_end = rest.index(b"\x00", lang_end + 1)
|
||||
body = rest[translated_end + 1:]
|
||||
if flag == 1:
|
||||
body = _inflate(body)
|
||||
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:
|
||||
return None
|
||||
while True:
|
||||
header = fileobj.read(8)
|
||||
if len(header) < 8:
|
||||
return None
|
||||
length = int.from_bytes(header[:4], "big")
|
||||
chunk_type = header[4:]
|
||||
if chunk_type in (b"IDAT", b"IEND"):
|
||||
return None # ComfyUI writes its text chunks before the image data
|
||||
|
||||
if chunk_type in (b"tEXt", b"zTXt", b"iTXt"):
|
||||
head = fileobj.read(min(length, 80)) # keyword is at most 79 bytes
|
||||
nul = head.find(b"\x00")
|
||||
if nul != -1 and head[:nul] == b"prompt":
|
||||
if length > _MAX_PROMPT_CHUNK_BYTES:
|
||||
return None
|
||||
data = head + fileobj.read(length - len(head))
|
||||
text = _decode_text_chunk(chunk_type, data, nul)
|
||||
return json.loads(text) if text else None
|
||||
fileobj.seek(length - len(head) + 4, 1) # rest of data + CRC
|
||||
else:
|
||||
fileobj.seek(length + 4, 1)
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Cached per-file text
|
||||
# --------------------------------------------------------------------------- #
|
||||
|
||||
def _load_entry(path):
|
||||
"""Return (text, segments, (width, height)) for a PNG, cached by mtime + size."""
|
||||
try:
|
||||
st = os.stat(path)
|
||||
except OSError:
|
||||
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], hit[2], hit[3]
|
||||
|
||||
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, segments = "", ()
|
||||
|
||||
with _cache_lock:
|
||||
_cache[path] = (signature, text, segments, dims)
|
||||
_cache.move_to_end(path)
|
||||
while len(_cache) > _CACHE_MAX_ENTRIES:
|
||||
_cache.popitem(last=False)
|
||||
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
|
||||
@@ -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.0"
|
||||
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"
|
||||