Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -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
|
||||
|
||||
+3
-1
@@ -2,4 +2,6 @@ __pycache__/
|
||||
*.pyc
|
||||
Thumbs.db
|
||||
.DS_Store
|
||||
desktop.ini
|
||||
desktop.ini
|
||||
# Local test suite (kept out of the repository)
|
||||
tests/
|
||||
|
||||
+556
-409
@@ -1,379 +1,478 @@
|
||||
import asyncio
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import threading
|
||||
from aiohttp import web
|
||||
from server import PromptServer
|
||||
import folder_paths
|
||||
|
||||
from . import prompt_search
|
||||
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
WEB_DIRECTORY = "./js"
|
||||
|
||||
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
|
||||
|
||||
|
||||
def is_path_safe(base_dir, target_path):
|
||||
"""Prevents Path Traversal attacks."""
|
||||
real_base = os.path.realpath(base_dir)
|
||||
real_target = os.path.realpath(target_path)
|
||||
try:
|
||||
# commonpath reliably handles OS-specific case sensitivity and slash logic
|
||||
return os.path.commonpath([real_base, real_target]) == real_base
|
||||
except ValueError:
|
||||
# Raised if paths are on different drives on Windows
|
||||
return False
|
||||
|
||||
|
||||
def get_all_candidate_roots(subfolder="", folder_type="output"):
|
||||
"""Gathers all potential ComfyUI base directories (output, model folders, extra paths)."""
|
||||
roots = []
|
||||
try:
|
||||
roots.append(folder_paths.get_output_directory())
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Include specific model categories (loras, checkpoints, etc.)
|
||||
categories = ["loras", "checkpoints", "vae", "unet", "clip", "embeddings", "upscale_models"]
|
||||
if subfolder and subfolder in folder_paths.folder_names_and_paths:
|
||||
try:
|
||||
roots.extend(folder_paths.get_folder_paths(subfolder))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
for cat in categories:
|
||||
try:
|
||||
roots.extend(folder_paths.get_folder_paths(cat))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
roots.append(folder_paths.get_input_directory())
|
||||
roots.append(folder_paths.get_temp_directory())
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Deduplicate while preserving existence
|
||||
unique = []
|
||||
for r in roots:
|
||||
if r and r not in unique and os.path.exists(r):
|
||||
unique.append(r)
|
||||
return unique
|
||||
|
||||
|
||||
def resolve_existing_path(filename="", subfolder="", folder_type="output", candidate_roots=None, strict=False):
|
||||
"""Finds the actual location of a file or folder across all candidate root directories.
|
||||
|
||||
strict=True is for destructive operations: the file must exist at exactly
|
||||
<root>/<subfolder>/<filename> (no fallback to a same-named file in the root),
|
||||
and only the root matching `folder_type` (output/input/temp) is considered.
|
||||
"""
|
||||
candidates = candidate_roots if candidate_roots is not None else get_all_candidate_roots(subfolder, folder_type)
|
||||
|
||||
if strict:
|
||||
type_dirs = {
|
||||
"output": folder_paths.get_output_directory(),
|
||||
"input": folder_paths.get_input_directory(),
|
||||
"temp": folder_paths.get_temp_directory(),
|
||||
}
|
||||
wanted = type_dirs.get(folder_type)
|
||||
if wanted is None:
|
||||
return None, None
|
||||
wanted = os.path.realpath(wanted)
|
||||
if not filename:
|
||||
return None, None
|
||||
for root in candidates:
|
||||
if os.path.realpath(root) != wanted:
|
||||
continue
|
||||
p = os.path.join(root, subfolder, filename) if subfolder else os.path.join(root, filename)
|
||||
if os.path.isfile(p) and is_path_safe(root, p):
|
||||
return p, root
|
||||
return None, None
|
||||
|
||||
if filename:
|
||||
for root in candidates:
|
||||
if subfolder:
|
||||
p1 = os.path.join(root, subfolder, filename)
|
||||
if os.path.isfile(p1) and is_path_safe(root, p1):
|
||||
return p1, root
|
||||
p2 = os.path.join(root, filename)
|
||||
if os.path.isfile(p2) and is_path_safe(root, p2):
|
||||
return p2, root
|
||||
|
||||
for root in candidates:
|
||||
if subfolder:
|
||||
d1 = os.path.join(root, subfolder)
|
||||
if os.path.isdir(d1) and is_path_safe(root, d1):
|
||||
return d1, root
|
||||
if os.path.isdir(root):
|
||||
return root, root
|
||||
|
||||
return None, None
|
||||
|
||||
|
||||
def open_file_in_os(target_path):
|
||||
"""Fast, native cross-platform explorer launch."""
|
||||
system = platform.system()
|
||||
|
||||
if system == "Windows":
|
||||
norm_path = os.path.normpath(target_path)
|
||||
if not os.path.exists(norm_path):
|
||||
raise FileNotFoundError(f"Path not found: {norm_path}")
|
||||
if os.path.isfile(norm_path):
|
||||
# Use raw command string so Windows Explorer correctly parses /select,"path"
|
||||
subprocess.Popen(f'explorer /select,"{norm_path}"')
|
||||
else:
|
||||
subprocess.Popen(f'explorer "{norm_path}"')
|
||||
|
||||
elif system == "Darwin": # macOS
|
||||
if not os.path.exists(target_path):
|
||||
raise FileNotFoundError(f"Path not found: {target_path}")
|
||||
if os.path.isfile(target_path):
|
||||
subprocess.Popen(["open", "-R", target_path])
|
||||
else:
|
||||
subprocess.Popen(["open", target_path])
|
||||
|
||||
else: # Linux / Unix
|
||||
folder = os.path.dirname(target_path) if os.path.isfile(target_path) else target_path
|
||||
if not os.path.exists(folder):
|
||||
raise FileNotFoundError(f"Path not found: {folder}")
|
||||
if "DISPLAY" in os.environ or "WAYLAND_DISPLAY" in os.environ:
|
||||
subprocess.Popen(["xdg-open", folder], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
else:
|
||||
raise RuntimeError("Headless Linux server detected (no desktop GUI available).")
|
||||
|
||||
|
||||
_GALLERY_EXTS = {
|
||||
".png", ".jpg", ".jpeg", ".webp", ".gif", ".avif",
|
||||
".mp4", ".webm", ".mov", ".mkv",
|
||||
".mp3", ".wav", ".ogg", ".flac", ".m4a", ".aac",
|
||||
".glb", ".gltf", ".obj", ".fbx", ".stl",
|
||||
".json"
|
||||
}
|
||||
|
||||
|
||||
def _relative_subfolder(directory, output_dir):
|
||||
rel_sub = os.path.relpath(directory, output_dir).replace("\\", "/")
|
||||
return "" if rel_sub == "." else rel_sub
|
||||
|
||||
|
||||
def _list_gallery(subfolder, search, cancel):
|
||||
"""Blocking directory listing / prompt search. Runs in a worker thread.
|
||||
|
||||
Returns (http_status, json_payload).
|
||||
"""
|
||||
output_dir = folder_paths.get_output_directory()
|
||||
target_dir = os.path.realpath(os.path.join(output_dir, subfolder)) if subfolder else os.path.realpath(output_dir)
|
||||
|
||||
if not is_path_safe(output_dir, target_dir):
|
||||
return 403, {"error": "Unsafe path"}
|
||||
|
||||
if not os.path.exists(target_dir) or not os.path.isdir(target_dir):
|
||||
return 200, {"subfolder": subfolder, "folders": [], "files": []}
|
||||
|
||||
folders = []
|
||||
files = []
|
||||
|
||||
if search:
|
||||
# Recursive filename + prompt-text search. Prompt metadata is only read for PNGs.
|
||||
for root, dirs, fnames in os.walk(target_dir):
|
||||
dirs[:] = [d for d in dirs if not d.startswith(".")]
|
||||
for fname in fnames:
|
||||
if cancel.is_set():
|
||||
return 200, {
|
||||
"subfolder": subfolder.replace("\\", "/"),
|
||||
"folders": folders,
|
||||
"files": files
|
||||
}
|
||||
if fname.startswith("."):
|
||||
continue
|
||||
ext = os.path.splitext(fname)[1].lower()
|
||||
if ext not in _GALLERY_EXTS:
|
||||
continue
|
||||
|
||||
fpath = os.path.join(root, fname)
|
||||
matched = search in fname.lower()
|
||||
if not matched and ext == ".png":
|
||||
matched = search in prompt_search.get_prompt_search_text(fpath)
|
||||
if matched:
|
||||
try:
|
||||
stat = os.stat(fpath)
|
||||
except (PermissionError, FileNotFoundError):
|
||||
continue
|
||||
files.append({
|
||||
"filename": fname,
|
||||
"subfolder": _relative_subfolder(root, output_dir),
|
||||
"type": "output",
|
||||
"mtime": stat.st_mtime,
|
||||
"size": stat.st_size
|
||||
})
|
||||
else:
|
||||
# Instant single-directory listing without reading files from disk
|
||||
with os.scandir(target_dir) as entries:
|
||||
for entry in entries:
|
||||
if entry.name.startswith("."):
|
||||
continue
|
||||
try:
|
||||
if entry.is_dir(follow_symlinks=False):
|
||||
folders.append({
|
||||
"name": entry.name,
|
||||
"subfolder": os.path.relpath(entry.path, output_dir).replace("\\", "/"),
|
||||
"mtime": entry.stat().st_mtime
|
||||
})
|
||||
elif entry.is_file(follow_symlinks=False):
|
||||
if os.path.splitext(entry.name)[1].lower() in _GALLERY_EXTS:
|
||||
stat = entry.stat()
|
||||
files.append({
|
||||
"filename": entry.name,
|
||||
"subfolder": _relative_subfolder(os.path.dirname(entry.path), output_dir),
|
||||
"type": "output",
|
||||
"mtime": stat.st_mtime,
|
||||
"size": stat.st_size
|
||||
})
|
||||
except (PermissionError, FileNotFoundError):
|
||||
continue
|
||||
|
||||
folders.sort(key=lambda x: x["name"].lower())
|
||||
files.sort(key=lambda x: x["mtime"], reverse=True)
|
||||
|
||||
return 200, {
|
||||
"subfolder": subfolder.replace("\\", "/"),
|
||||
"folders": folders,
|
||||
"files": files
|
||||
}
|
||||
|
||||
|
||||
_LOCALES_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "locales")
|
||||
_ALLOWED_LOCALE_FILES = {"main.json", "settings.json"}
|
||||
|
||||
|
||||
@PromptServer.instance.routes.get("/comfy-sidebar/locales/{lang}/{filename}")
|
||||
async def locale_file_handler(request):
|
||||
lang = request.match_info.get("lang", "").strip()
|
||||
filename = request.match_info.get("filename", "").strip()
|
||||
if not lang or filename not in _ALLOWED_LOCALE_FILES:
|
||||
return web.json_response({"error": "Not found"}, status=404)
|
||||
|
||||
target_file = os.path.join(_LOCALES_DIR, lang, filename)
|
||||
if not is_path_safe(_LOCALES_DIR, target_file) or not os.path.isfile(target_file):
|
||||
return web.json_response({"error": "Not found"}, status=404)
|
||||
|
||||
return web.FileResponse(target_file)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.get("/comfy-sidebar/gallery/list")
|
||||
async def gallery_list_handler(request):
|
||||
try:
|
||||
subfolder = request.query.get("subfolder", "").strip().strip("/\\")
|
||||
search = request.query.get("search", "").strip().lower()
|
||||
|
||||
# Scanning can touch thousands of files: keep it off the event loop so
|
||||
# ComfyUI's server (websocket, queue updates) stays responsive.
|
||||
cancel = threading.Event()
|
||||
loop = asyncio.get_running_loop()
|
||||
try:
|
||||
status, payload = await loop.run_in_executor(None, _list_gallery, subfolder, search, cancel)
|
||||
except asyncio.CancelledError:
|
||||
cancel.set() # client went away / sent a newer search: stop scanning
|
||||
raise
|
||||
return web.json_response(payload, status=status)
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/queue/prompt-search")
|
||||
async def queue_prompt_search_handler(request):
|
||||
"""Extract searchable prompt text from Queue API-format prompt graphs."""
|
||||
try:
|
||||
data = await request.json()
|
||||
prompts = data.get("prompts", [])
|
||||
if not isinstance(prompts, list) or len(prompts) > 32:
|
||||
return web.json_response({"error": "Expected up to 32 prompt graphs"}, status=400)
|
||||
|
||||
texts = {}
|
||||
for item in prompts:
|
||||
if not isinstance(item, dict):
|
||||
continue
|
||||
pid = item.get("pid")
|
||||
graph = item.get("prompt")
|
||||
if pid is None or not isinstance(graph, dict):
|
||||
continue
|
||||
texts[str(pid)] = prompt_search.get_prompt_search_text_from_graph(graph)
|
||||
|
||||
return web.json_response({"texts": texts})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=400)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/open-folder")
|
||||
async def open_folder_handler(request):
|
||||
try:
|
||||
data = await request.json()
|
||||
filename = (data.get("filename") or "").strip()
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "output").strip()
|
||||
|
||||
target_path, _ = resolve_existing_path(filename, subfolder, folder_type)
|
||||
if not target_path:
|
||||
target_path = folder_paths.get_output_directory()
|
||||
|
||||
open_file_in_os(target_path)
|
||||
return web.json_response({"success": True, "path": target_path})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=400)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/delete-file")
|
||||
async def delete_file_handler(request):
|
||||
try:
|
||||
data = await request.json()
|
||||
filename = (data.get("filename") or "").strip()
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "output").strip()
|
||||
|
||||
if not filename:
|
||||
return web.json_response({"error": "No filename provided"}, status=400)
|
||||
|
||||
# Strictly restrict deletion to generated output and temp files (protects models/checkpoints)
|
||||
delete_roots = [
|
||||
folder_paths.get_output_directory(),
|
||||
folder_paths.get_temp_directory()
|
||||
]
|
||||
delete_roots = [os.path.realpath(r) for r in delete_roots if r and os.path.exists(r)]
|
||||
|
||||
target_file, root = resolve_existing_path(filename, subfolder, folder_type, candidate_roots=delete_roots, strict=True)
|
||||
|
||||
if not target_file or not os.path.isfile(target_file) or not is_path_safe(root, target_file):
|
||||
return web.json_response({"error": "File not found or outside output directory"}, status=404)
|
||||
|
||||
# Try moving to Recycle Bin / Trash first, fallback to os.remove
|
||||
permanent = bool(data.get("permanent", False))
|
||||
action = "deleted"
|
||||
if not permanent:
|
||||
try:
|
||||
import send2trash
|
||||
send2trash.send2trash(target_file)
|
||||
action = "trashed"
|
||||
except Exception:
|
||||
os.remove(target_file)
|
||||
action = "deleted"
|
||||
else:
|
||||
os.remove(target_file)
|
||||
action = "deleted"
|
||||
|
||||
return web.json_response({"success": True, "deleted": target_file, "action": action})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
|
||||
import asyncio
|
||||
import filecmp
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
from aiohttp import web
|
||||
from server import PromptServer
|
||||
import folder_paths
|
||||
|
||||
from . import prompt_search
|
||||
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
WEB_DIRECTORY = "./js"
|
||||
|
||||
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]
|
||||
|
||||
|
||||
def is_path_safe(base_dir, target_path):
|
||||
"""Prevents Path Traversal attacks."""
|
||||
real_base = os.path.realpath(base_dir)
|
||||
real_target = os.path.realpath(target_path)
|
||||
try:
|
||||
# commonpath reliably handles OS-specific case sensitivity and slash logic
|
||||
return os.path.commonpath([real_base, real_target]) == real_base
|
||||
except ValueError:
|
||||
# Raised if paths are on different drives on Windows
|
||||
return False
|
||||
|
||||
|
||||
async def _read_json_body(request):
|
||||
"""Returns (data, error_response). Requires an explicit application/json content type.
|
||||
|
||||
A web page on another origin can send a "simple" cross-site POST (e.g. text/plain) to a local
|
||||
ComfyUI without any CORS preflight. Insisting on application/json forces a preflight, which
|
||||
ComfyUI's CORS policy rejects, so these file-changing endpoints can't be triggered that way.
|
||||
"""
|
||||
if request.content_type != "application/json":
|
||||
return None, web.json_response({"error": "Content-Type must be application/json"}, status=415)
|
||||
data = await request.json()
|
||||
if not isinstance(data, dict):
|
||||
return None, web.json_response({"error": "Expected a JSON object"}, status=400)
|
||||
return data, None
|
||||
|
||||
|
||||
def _reserve_unique_path(directory, filename):
|
||||
"""Atomically creates an empty placeholder for `filename` inside `directory`.
|
||||
|
||||
If the name is taken, " (1)", " (2)", ... is added, so an existing file is never overwritten.
|
||||
Returns (path, name). The caller fills the placeholder and removes it again on failure.
|
||||
"""
|
||||
stem, ext = os.path.splitext(filename)
|
||||
name = filename
|
||||
suffix = 1
|
||||
while True:
|
||||
path = os.path.join(directory, name)
|
||||
try:
|
||||
fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o666)
|
||||
os.close(fd)
|
||||
return path, name
|
||||
except FileExistsError:
|
||||
name = f"{stem} ({suffix}){ext}"
|
||||
suffix += 1
|
||||
|
||||
|
||||
def get_all_candidate_roots(subfolder="", folder_type="output"):
|
||||
"""Gathers all potential ComfyUI base directories (output, model folders, extra paths)."""
|
||||
roots = []
|
||||
try:
|
||||
roots.append(folder_paths.get_output_directory())
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Include specific model categories (loras, checkpoints, etc.)
|
||||
categories = ["loras", "checkpoints", "vae", "unet", "clip", "embeddings", "upscale_models"]
|
||||
if subfolder and subfolder in folder_paths.folder_names_and_paths:
|
||||
try:
|
||||
roots.extend(folder_paths.get_folder_paths(subfolder))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
for cat in categories:
|
||||
try:
|
||||
roots.extend(folder_paths.get_folder_paths(cat))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
roots.append(folder_paths.get_input_directory())
|
||||
roots.append(folder_paths.get_temp_directory())
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Deduplicate while preserving existence
|
||||
unique = []
|
||||
for r in roots:
|
||||
if r and r not in unique and os.path.exists(r):
|
||||
unique.append(r)
|
||||
return unique
|
||||
|
||||
|
||||
def resolve_existing_path(filename="", subfolder="", folder_type="output", candidate_roots=None, strict=False):
|
||||
"""Finds the actual location of a file or folder across all candidate root directories.
|
||||
|
||||
strict=True is for destructive operations: the file must exist at exactly
|
||||
<root>/<subfolder>/<filename> (no fallback to a same-named file in the root),
|
||||
and only the root matching `folder_type` (output/input/temp) is considered.
|
||||
"""
|
||||
candidates = candidate_roots if candidate_roots is not None else get_all_candidate_roots(subfolder, folder_type)
|
||||
|
||||
if strict:
|
||||
type_dirs = {
|
||||
"output": folder_paths.get_output_directory(),
|
||||
"input": folder_paths.get_input_directory(),
|
||||
"temp": folder_paths.get_temp_directory(),
|
||||
}
|
||||
wanted = type_dirs.get(folder_type)
|
||||
if wanted is None:
|
||||
return None, None
|
||||
wanted = os.path.realpath(wanted)
|
||||
if not filename:
|
||||
return None, None
|
||||
for root in candidates:
|
||||
if os.path.realpath(root) != wanted:
|
||||
continue
|
||||
p = os.path.join(root, subfolder, filename) if subfolder else os.path.join(root, filename)
|
||||
if os.path.isfile(p) and is_path_safe(root, p):
|
||||
return p, root
|
||||
return None, None
|
||||
|
||||
if filename:
|
||||
for root in candidates:
|
||||
if subfolder:
|
||||
p1 = os.path.join(root, subfolder, filename)
|
||||
if os.path.isfile(p1) and is_path_safe(root, p1):
|
||||
return p1, root
|
||||
p2 = os.path.join(root, filename)
|
||||
if os.path.isfile(p2) and is_path_safe(root, p2):
|
||||
return p2, root
|
||||
|
||||
for root in candidates:
|
||||
if subfolder:
|
||||
d1 = os.path.join(root, subfolder)
|
||||
if os.path.isdir(d1) and is_path_safe(root, d1):
|
||||
return d1, root
|
||||
if os.path.isdir(root):
|
||||
return root, root
|
||||
|
||||
return None, None
|
||||
|
||||
|
||||
def open_file_in_os(target_path):
|
||||
"""Fast, native cross-platform explorer launch."""
|
||||
system = platform.system()
|
||||
|
||||
if system == "Windows":
|
||||
norm_path = os.path.normpath(target_path)
|
||||
if not os.path.exists(norm_path):
|
||||
raise FileNotFoundError(f"Path not found: {norm_path}")
|
||||
if os.path.isfile(norm_path):
|
||||
# Use raw command string so Windows Explorer correctly parses /select,"path"
|
||||
subprocess.Popen(f'explorer /select,"{norm_path}"')
|
||||
else:
|
||||
subprocess.Popen(f'explorer "{norm_path}"')
|
||||
|
||||
elif system == "Darwin": # macOS
|
||||
if not os.path.exists(target_path):
|
||||
raise FileNotFoundError(f"Path not found: {target_path}")
|
||||
if os.path.isfile(target_path):
|
||||
subprocess.Popen(["open", "-R", target_path])
|
||||
else:
|
||||
subprocess.Popen(["open", target_path])
|
||||
|
||||
else: # Linux / Unix
|
||||
folder = os.path.dirname(target_path) if os.path.isfile(target_path) else target_path
|
||||
if not os.path.exists(folder):
|
||||
raise FileNotFoundError(f"Path not found: {folder}")
|
||||
if "DISPLAY" in os.environ or "WAYLAND_DISPLAY" in os.environ:
|
||||
subprocess.Popen(["xdg-open", folder], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
else:
|
||||
raise RuntimeError("Headless Linux server detected (no desktop GUI available).")
|
||||
|
||||
|
||||
_GALLERY_EXTS = {
|
||||
".png", ".jpg", ".jpeg", ".webp", ".gif", ".avif",
|
||||
".mp4", ".webm", ".mov", ".mkv",
|
||||
".mp3", ".wav", ".ogg", ".flac", ".m4a", ".aac",
|
||||
".glb", ".gltf", ".obj", ".fbx", ".stl",
|
||||
".json"
|
||||
}
|
||||
|
||||
|
||||
def _relative_subfolder(directory, output_dir):
|
||||
rel_sub = os.path.relpath(directory, output_dir).replace("\\", "/")
|
||||
return "" if rel_sub == "." else rel_sub
|
||||
|
||||
|
||||
def _list_gallery(subfolder, search, cancel):
|
||||
"""Blocking directory listing / prompt search. Runs in a worker thread.
|
||||
|
||||
Returns (http_status, json_payload).
|
||||
"""
|
||||
# Resolve links up front: everything below is relative to realpath'd directories, so a symlinked or
|
||||
# junctioned output folder would otherwise produce "../.." subfolders.
|
||||
output_dir = os.path.realpath(folder_paths.get_output_directory())
|
||||
target_dir = os.path.realpath(os.path.join(output_dir, subfolder)) if subfolder else output_dir
|
||||
|
||||
if not is_path_safe(output_dir, target_dir):
|
||||
return 403, {"error": "Unsafe path"}
|
||||
|
||||
if not os.path.exists(target_dir) or not os.path.isdir(target_dir):
|
||||
return 200, {"subfolder": subfolder, "folders": [], "files": []}
|
||||
|
||||
folders = []
|
||||
files = []
|
||||
|
||||
if search:
|
||||
# Recursive filename + prompt-text search. Prompt metadata is only read for PNGs.
|
||||
for root, dirs, fnames in os.walk(target_dir):
|
||||
dirs[:] = [d for d in dirs if not d.startswith(".")]
|
||||
for fname in fnames:
|
||||
if cancel.is_set():
|
||||
return 200, {
|
||||
"subfolder": subfolder.replace("\\", "/"),
|
||||
"folders": folders,
|
||||
"files": files
|
||||
}
|
||||
if fname.startswith("."):
|
||||
continue
|
||||
ext = os.path.splitext(fname)[1].lower()
|
||||
if ext not in _GALLERY_EXTS:
|
||||
continue
|
||||
|
||||
fpath = os.path.join(root, fname)
|
||||
matched = search in fname.lower()
|
||||
if not matched and ext == ".png":
|
||||
matched = search in prompt_search.get_prompt_search_text(fpath)
|
||||
if matched:
|
||||
try:
|
||||
stat = os.stat(fpath)
|
||||
except (PermissionError, FileNotFoundError):
|
||||
continue
|
||||
files.append({
|
||||
"filename": fname,
|
||||
"subfolder": _relative_subfolder(root, output_dir),
|
||||
"type": "output",
|
||||
"mtime": stat.st_mtime,
|
||||
"size": stat.st_size
|
||||
})
|
||||
else:
|
||||
# Instant single-directory listing without reading files from disk
|
||||
with os.scandir(target_dir) as entries:
|
||||
for entry in entries:
|
||||
if entry.name.startswith("."):
|
||||
continue
|
||||
try:
|
||||
if entry.is_dir(follow_symlinks=False):
|
||||
folders.append({
|
||||
"name": entry.name,
|
||||
"subfolder": os.path.relpath(entry.path, output_dir).replace("\\", "/"),
|
||||
"mtime": entry.stat().st_mtime
|
||||
})
|
||||
elif entry.is_file(follow_symlinks=False):
|
||||
if os.path.splitext(entry.name)[1].lower() in _GALLERY_EXTS:
|
||||
stat = entry.stat()
|
||||
files.append({
|
||||
"filename": entry.name,
|
||||
"subfolder": _relative_subfolder(os.path.dirname(entry.path), output_dir),
|
||||
"type": "output",
|
||||
"mtime": stat.st_mtime,
|
||||
"size": stat.st_size
|
||||
})
|
||||
except (PermissionError, FileNotFoundError):
|
||||
continue
|
||||
|
||||
folders.sort(key=lambda x: x["name"].lower())
|
||||
files.sort(key=lambda x: x["mtime"], reverse=True)
|
||||
|
||||
return 200, {
|
||||
"subfolder": subfolder.replace("\\", "/"),
|
||||
"folders": folders,
|
||||
"files": files
|
||||
}
|
||||
|
||||
|
||||
_LOCALES_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "locales")
|
||||
_ALLOWED_LOCALE_FILES = {"main.json", "settings.json"}
|
||||
|
||||
|
||||
def _get_extension_build_info():
|
||||
"""Read the package version and the checked-out Git commit for the About panel."""
|
||||
version = "unknown"
|
||||
commit = "unknown"
|
||||
|
||||
try:
|
||||
pyproject_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "pyproject.toml")
|
||||
with open(pyproject_path, "r", encoding="utf-8") as f:
|
||||
pyproject = f.read()
|
||||
project_match = re.search(r"(?ms)^\[project\]\s*(.*?)(?=^\[|\Z)", pyproject)
|
||||
if project_match:
|
||||
version_match = re.search(r'(?m)^\s*version\s*=\s*"([^"]+)"', project_match.group(1))
|
||||
if version_match:
|
||||
version = version_match.group(1)
|
||||
except (OSError, UnicodeError):
|
||||
pass
|
||||
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["git", "rev-parse", "--short=7", "HEAD"],
|
||||
cwd=os.path.dirname(os.path.realpath(__file__)),
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True,
|
||||
timeout=2
|
||||
)
|
||||
candidate = result.stdout.strip()
|
||||
if re.fullmatch(r"[0-9a-fA-F]{7,40}", candidate):
|
||||
commit = candidate[:7]
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
pass
|
||||
|
||||
return {"version": version, "commit": commit}
|
||||
|
||||
|
||||
@PromptServer.instance.routes.get("/comfy-sidebar/version")
|
||||
async def version_handler(request):
|
||||
return web.json_response(_get_extension_build_info())
|
||||
|
||||
|
||||
@PromptServer.instance.routes.get("/comfy-sidebar/locales/{lang}/{filename}")
|
||||
async def locale_file_handler(request):
|
||||
lang = request.match_info.get("lang", "").strip()
|
||||
filename = request.match_info.get("filename", "").strip()
|
||||
if not lang or filename not in _ALLOWED_LOCALE_FILES:
|
||||
return web.json_response({"error": "Not found"}, status=404)
|
||||
|
||||
target_file = os.path.join(_LOCALES_DIR, lang, filename)
|
||||
if not is_path_safe(_LOCALES_DIR, target_file) or not os.path.isfile(target_file):
|
||||
return web.json_response({"error": "Not found"}, status=404)
|
||||
|
||||
return web.FileResponse(target_file)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.get("/comfy-sidebar/gallery/list")
|
||||
async def gallery_list_handler(request):
|
||||
try:
|
||||
subfolder = request.query.get("subfolder", "").strip().strip("/\\")
|
||||
search = request.query.get("search", "").strip().lower()
|
||||
|
||||
# Scanning can touch thousands of files: keep it off the event loop so
|
||||
# ComfyUI's server (websocket, queue updates) stays responsive.
|
||||
cancel = threading.Event()
|
||||
loop = asyncio.get_running_loop()
|
||||
try:
|
||||
status, payload = await loop.run_in_executor(None, _list_gallery, subfolder, search, cancel)
|
||||
except asyncio.CancelledError:
|
||||
cancel.set() # client went away / sent a newer search: stop scanning
|
||||
raise
|
||||
return web.json_response(payload, status=status)
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/queue/prompt-search")
|
||||
async def queue_prompt_search_handler(request):
|
||||
"""Extract searchable prompt text from Queue API-format prompt graphs."""
|
||||
try:
|
||||
data, error = await _read_json_body(request)
|
||||
if error:
|
||||
return error
|
||||
prompts = data.get("prompts", [])
|
||||
if not isinstance(prompts, list) or len(prompts) > 32:
|
||||
return web.json_response({"error": "Expected up to 32 prompt graphs"}, status=400)
|
||||
|
||||
texts = {}
|
||||
for item in prompts:
|
||||
if not isinstance(item, dict):
|
||||
continue
|
||||
pid = item.get("pid")
|
||||
graph = item.get("prompt")
|
||||
if pid is None or not isinstance(graph, dict):
|
||||
continue
|
||||
texts[str(pid)] = prompt_search.get_prompt_search_text_from_graph(graph)
|
||||
|
||||
return web.json_response({"texts": texts})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=400)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/open-folder")
|
||||
async def open_folder_handler(request):
|
||||
try:
|
||||
data, error = await _read_json_body(request)
|
||||
if error:
|
||||
return error
|
||||
filename = (data.get("filename") or "").strip()
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "output").strip()
|
||||
|
||||
target_path, _ = resolve_existing_path(filename, subfolder, folder_type)
|
||||
if not target_path:
|
||||
target_path = folder_paths.get_output_directory()
|
||||
|
||||
open_file_in_os(target_path)
|
||||
return web.json_response({"success": True, "path": target_path})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=400)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/delete-file")
|
||||
async def delete_file_handler(request):
|
||||
try:
|
||||
data, error = await _read_json_body(request)
|
||||
if error:
|
||||
return error
|
||||
filename = (data.get("filename") or "").strip()
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "output").strip()
|
||||
|
||||
if not filename:
|
||||
return web.json_response({"error": "No filename provided"}, status=400)
|
||||
|
||||
# Strictly restrict deletion to generated output and temp files (protects models/checkpoints)
|
||||
delete_roots = [
|
||||
folder_paths.get_output_directory(),
|
||||
folder_paths.get_temp_directory()
|
||||
]
|
||||
delete_roots = [os.path.realpath(r) for r in delete_roots if r and os.path.exists(r)]
|
||||
|
||||
target_file, root = resolve_existing_path(filename, subfolder, folder_type, candidate_roots=delete_roots, strict=True)
|
||||
|
||||
if not target_file or not os.path.isfile(target_file) or not is_path_safe(root, target_file):
|
||||
return web.json_response({"error": "File not found or outside output directory"}, status=404)
|
||||
|
||||
# Never fall back to a permanent delete on our own: the user asked for the Recycle Bin.
|
||||
# When the trash can't be used we report it (409) so the UI can offer to turn on
|
||||
# direct deletion or help fix send2trash, instead of silently destroying the file.
|
||||
permanent = data.get("permanent") is True
|
||||
if permanent:
|
||||
os.remove(target_file)
|
||||
action = "deleted"
|
||||
else:
|
||||
try:
|
||||
import send2trash
|
||||
except ImportError:
|
||||
return web.json_response({
|
||||
"error": "The send2trash package is not installed.",
|
||||
"code": "trash_unavailable",
|
||||
"python": sys.executable
|
||||
}, status=409)
|
||||
try:
|
||||
send2trash.send2trash(target_file)
|
||||
action = "trashed"
|
||||
except Exception as e:
|
||||
return web.json_response({
|
||||
"error": str(e) or e.__class__.__name__,
|
||||
"code": "trash_failed",
|
||||
"python": sys.executable
|
||||
}, status=409)
|
||||
|
||||
return web.json_response({"success": True, "deleted": target_file, "action": action})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/move-temp-to-output")
|
||||
async def move_temp_to_output_handler(request):
|
||||
try:
|
||||
import shutil
|
||||
data = await request.json()
|
||||
data, error = await _read_json_body(request)
|
||||
if error:
|
||||
return error
|
||||
filename = (data.get("filename") or "").strip()
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "").strip()
|
||||
@@ -400,24 +499,12 @@ async def move_temp_to_output_handler(request):
|
||||
return web.json_response({"error": "Temp image not found"}, status=404)
|
||||
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
stem, ext = os.path.splitext(filename)
|
||||
destination_name = filename
|
||||
suffix = 1
|
||||
|
||||
# Reserve a unique destination without ever overwriting an existing output.
|
||||
while True:
|
||||
destination_path = os.path.join(output_dir, destination_name)
|
||||
try:
|
||||
fd = os.open(destination_path, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o666)
|
||||
os.close(fd)
|
||||
break
|
||||
except FileExistsError:
|
||||
destination_name = f"{stem} ({suffix}){ext}"
|
||||
suffix += 1
|
||||
destination_path, destination_name = _reserve_unique_path(output_dir, filename)
|
||||
|
||||
try:
|
||||
shutil.copy2(source_path, destination_path)
|
||||
os.remove(source_path)
|
||||
except Exception:
|
||||
try:
|
||||
os.remove(destination_path)
|
||||
@@ -425,6 +512,13 @@ async def move_temp_to_output_handler(request):
|
||||
pass
|
||||
raise
|
||||
|
||||
# The copy is what matters. On Windows the source can still be locked (for example by a browser
|
||||
# tab that is displaying it); a leftover temp file is harmless because ComfyUI clears temp on start.
|
||||
try:
|
||||
os.remove(source_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
return web.json_response({
|
||||
"success": True,
|
||||
"filename": destination_name,
|
||||
@@ -435,26 +529,79 @@ async def move_temp_to_output_handler(request):
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/promote-output")
|
||||
async def promote_output_handler(request):
|
||||
try:
|
||||
import shutil
|
||||
data = await request.json()
|
||||
raw_filename = (data.get("filename") or "").strip()
|
||||
filename = os.path.basename(raw_filename)
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "output").strip()
|
||||
|
||||
target_file, root = resolve_existing_path(raw_filename, subfolder, folder_type)
|
||||
if not target_file or not os.path.isfile(target_file):
|
||||
return web.json_response({"error": "File not found"}, status=404)
|
||||
|
||||
input_dir = folder_paths.get_input_directory()
|
||||
dest_path = os.path.join(input_dir, filename)
|
||||
if not is_path_safe(input_dir, dest_path):
|
||||
return web.json_response({"error": "Unsafe destination path"}, status=403)
|
||||
|
||||
shutil.copy2(target_file, dest_path)
|
||||
return web.json_response({"name": filename})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/promote-output")
|
||||
async def promote_output_handler(request):
|
||||
try:
|
||||
data, error = await _read_json_body(request)
|
||||
if error:
|
||||
return error
|
||||
raw_filename = (data.get("filename") or "").strip()
|
||||
filename = os.path.basename(raw_filename)
|
||||
subfolder = (data.get("subfolder") or "").strip()
|
||||
folder_type = (data.get("type") or "output").strip()
|
||||
|
||||
# Strict lookup: exactly <root for `type`>/<subfolder>/<filename>. The lenient search used before
|
||||
# could pick a same-named file from another folder (or another subfolder) and copy the wrong image.
|
||||
target_file, root = resolve_existing_path(raw_filename, subfolder, folder_type, strict=True)
|
||||
if not target_file or not os.path.isfile(target_file):
|
||||
return web.json_response({"error": "File not found"}, status=404)
|
||||
|
||||
input_dir = folder_paths.get_input_directory()
|
||||
os.makedirs(input_dir, exist_ok=True)
|
||||
dest_path = os.path.join(input_dir, filename)
|
||||
if not is_path_safe(input_dir, dest_path):
|
||||
return web.json_response({"error": "Unsafe destination path"}, status=403)
|
||||
|
||||
# Promoting the same image twice reuses the existing input file. A *different* image that
|
||||
# merely shares the name (output counters restart per prefix) must never overwrite it.
|
||||
if os.path.isfile(dest_path) and filecmp.cmp(target_file, dest_path, shallow=False):
|
||||
return web.json_response({"name": filename})
|
||||
|
||||
dest_path, dest_name = _reserve_unique_path(input_dir, filename)
|
||||
try:
|
||||
shutil.copy2(target_file, dest_path)
|
||||
except Exception:
|
||||
try:
|
||||
os.remove(dest_path)
|
||||
except OSError:
|
||||
pass
|
||||
raise
|
||||
return web.json_response({"name": dest_name})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
@PromptServer.instance.routes.post("/comfy-sidebar/files-exist")
|
||||
async def files_exist_handler(request):
|
||||
"""Reports which of the given output/input/temp files are still on disk.
|
||||
|
||||
Body: {"files": [{"filename": ..., "subfolder": ..., "type": "output|input|temp"}, ...]}
|
||||
Answer: {"exists": [true, false, ...]} in the same order.
|
||||
|
||||
The Queue uses this to tell "the file is really gone" (temp folder cleared, file deleted) from a
|
||||
one-off failed image request, so a card is never dropped just because a request failed.
|
||||
Anything that can't be judged (unknown type, malformed entry) is reported as existing.
|
||||
"""
|
||||
try:
|
||||
data, error = await _read_json_body(request)
|
||||
if error:
|
||||
return error
|
||||
files = data.get("files")
|
||||
if not isinstance(files, list) or len(files) > 2000:
|
||||
return web.json_response({"error": "Expected a list of at most 2000 files"}, status=400)
|
||||
|
||||
exists = []
|
||||
for item in files:
|
||||
if not isinstance(item, dict):
|
||||
exists.append(True)
|
||||
continue
|
||||
filename = (item.get("filename") or "").strip()
|
||||
subfolder = (item.get("subfolder") or "").strip()
|
||||
folder_type = (item.get("type") or "output").strip()
|
||||
if not filename or folder_type not in ("output", "input", "temp"):
|
||||
exists.append(True)
|
||||
continue
|
||||
path, _ = resolve_existing_path(filename, subfolder, folder_type, strict=True)
|
||||
exists.append(bool(path and os.path.isfile(path)))
|
||||
return web.json_response({"exists": exists})
|
||||
except Exception as e:
|
||||
return web.json_response({"error": str(e)}, status=500)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import {
|
||||
findOriginalPropertiesButton,
|
||||
findTopbarContainer,
|
||||
|
||||
@@ -26,6 +26,8 @@ export const SettingIds = Object.freeze({
|
||||
HIDE_GRAPH_BUTTON: "Comfy Sidebar.Hide Junk.Graph Button",
|
||||
CLASSIC_LAYOUT: "Comfy Sidebar.Comfy Layout",
|
||||
LATIN_HOTKEYS: "Comfy Sidebar.Latin Hotkeys On Any Layout",
|
||||
PERMANENT_DELETE: "Comfy Sidebar.Permanent Delete on Disk Deletion",
|
||||
REMOVE_MISSING_CARDS: "Comfy Sidebar.Remove Cards With Missing Files",
|
||||
QUICK_WORKFLOW_PICKER: "Comfy Sidebar.Quick Workflow Picker",
|
||||
MAX_HISTORY_ITEMS: "Comfy.Queue.MaxHistoryItems",
|
||||
DOCK_QUEUE: "Comfy.Queue.QPOV2",
|
||||
|
||||
+11
-2
@@ -25,7 +25,12 @@ export const PersistenceAdapter = {
|
||||
return img;
|
||||
}).filter(Boolean);
|
||||
|
||||
const includeWorkflow = cleanedImages.length === 0 || state.status !== PromptStatus.COMPLETED;
|
||||
// The workflow is only dropped from storage when it can be read back from a saved PNG.
|
||||
// Text-only jobs, temp previews (the TEMP folder gets cleared), videos/webp and unfinished
|
||||
// jobs have no such copy, and ComfyUI's own history is gone after a server restart.
|
||||
const recoverableFromFile = cleanedImages.some(img =>
|
||||
img.type === "output" && /\.png$/i.test(img.filename || ""));
|
||||
const includeWorkflow = !recoverableFromFile || state.status !== PromptStatus.COMPLETED;
|
||||
|
||||
serializable.push({
|
||||
pid: String(state.pid),
|
||||
@@ -61,7 +66,11 @@ export const PersistenceAdapter = {
|
||||
break;
|
||||
} catch (e) {
|
||||
if (e.name === "QuotaExceededError" || e.code === 22 || e.code === 1014) {
|
||||
serializable.shift();
|
||||
// Storage is full. First shed workflows, oldest card first, and only drop
|
||||
// whole cards once there is no workflow left to shed.
|
||||
const withWorkflow = serializable.find(item => item.workflow);
|
||||
if (withWorkflow) withWorkflow.workflow = null;
|
||||
else serializable.shift();
|
||||
} else {
|
||||
console.warn("Comfy Sidebar: LocalStorage error", e);
|
||||
break;
|
||||
|
||||
@@ -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,7 +1,7 @@
|
||||
import { api } from "/scripts/api.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
import { store } from "../core/store.js";
|
||||
import { PromptStatus } from "../core/constants.js";
|
||||
import { PromptStatus, SettingIds } from "../core/constants.js";
|
||||
import { createPromptState, activatePrompt, updatePromptProgress } from "../core/promptState.js";
|
||||
import { syncQueue, concludeRun, initSessionAndHistory, clearCancelledOrFailed } from "./queueService.js";
|
||||
import { findImagesInOutputs, findTextsInOutputs } from "../utils/utils.js";
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { PromptStatus, StoreEvents, SettingIds } from "../core/constants.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
import { createPromptState, activatePrompt, finalizePrompt } from "../core/promptState.js";
|
||||
import { normalizeQueueItem, normalizeHistoryItem } from "./queueNormalizer.js";
|
||||
import { findImagesInOutputs, findTextsInOutputs, getPrimaryOutputImages, getNodeTitle } from "../utils/utils.js";
|
||||
import { findTextsInOutputs, getPrimaryOutputImages, getNodeTitle } from "../utils/utils.js";
|
||||
|
||||
function extractNodeTitles(outputs, workflow, promptGraph = null) {
|
||||
const titles = {};
|
||||
@@ -255,6 +255,19 @@ export async function initSessionAndHistory() {
|
||||
}));
|
||||
normalized.sort((a, b) => a.norm.queueNumber - b.norm.queueNumber);
|
||||
|
||||
const maxItems = getSetting(SettingIds.MAX_HISTORY_ITEMS, 64);
|
||||
|
||||
// The server keeps runs that this sidebar already pruned (its history is bigger than the Queue
|
||||
// limit). Re-adding those as brand-new cards would give them *higher* sequence numbers than the
|
||||
// cards we saved, and the limit would then evict the newest runs instead of the oldest ones.
|
||||
// So history that is older than a card we already have is only used to fill free slots, and is
|
||||
// ranked below everything else.
|
||||
const knownQueueNumbers = normalized
|
||||
.filter(({ norm }) => store.hasPrompt(norm.pid))
|
||||
.map(({ norm }) => norm.queueNumber);
|
||||
const newestKnownQueueNumber = knownQueueNumbers.length > 0 ? Math.max(...knownQueueNumbers) : -Infinity;
|
||||
const backfill = [];
|
||||
|
||||
normalized.forEach(({ norm: item, promptGraph }) => {
|
||||
const { images, texts, nodeTitles: titles } = extractPromptOutputs(item.outputs, item.workflow, promptGraph);
|
||||
|
||||
@@ -288,8 +301,7 @@ export async function initSessionAndHistory() {
|
||||
return;
|
||||
}
|
||||
|
||||
const seq = store.nextSequence();
|
||||
const newState = createPromptState(item.pid, {
|
||||
const stateInit = {
|
||||
status: item.status,
|
||||
images,
|
||||
texts,
|
||||
@@ -297,15 +309,33 @@ export async function initSessionAndHistory() {
|
||||
nodeTitles: titles,
|
||||
workflow: item.workflow,
|
||||
progressText: "",
|
||||
timestamp: seq,
|
||||
rendered: true
|
||||
});
|
||||
store.setPrompt(item.pid, newState);
|
||||
};
|
||||
|
||||
if (item.queueNumber <= newestKnownQueueNumber) {
|
||||
backfill.push({ pid: item.pid, stateInit });
|
||||
return;
|
||||
}
|
||||
|
||||
store.setPrompt(item.pid, createPromptState(item.pid, { ...stateInit, timestamp: store.nextSequence() }));
|
||||
});
|
||||
|
||||
if (backfill.length > 0) {
|
||||
const all = store.getAllPrompts();
|
||||
const finishedCount = all.filter(s => s.status !== PromptStatus.PENDING && s.status !== PromptStatus.ACTIVE).length;
|
||||
const room = Math.max(0, maxItems - finishedCount);
|
||||
const take = room > 0 ? backfill.slice(-room) : [];
|
||||
const lowest = all.reduce((min, s) => (s.timestamp > 0 ? Math.min(min, s.timestamp) : min), Infinity);
|
||||
const base = Number.isFinite(lowest) ? lowest : 1;
|
||||
take.forEach(({ pid, stateInit }, idx) => {
|
||||
// Positive fractions below every existing card, oldest backfill lowest.
|
||||
const timestamp = base * (idx + 1) / (take.length + 1);
|
||||
store.setPrompt(pid, createPromptState(pid, { ...stateInit, timestamp }));
|
||||
});
|
||||
}
|
||||
|
||||
await updatePromptSearchTexts(normalized.map(({ norm, promptGraph }) => ({ pid: norm.pid, promptGraph })));
|
||||
|
||||
const maxItems = getSetting(SettingIds.MAX_HISTORY_ITEMS, 64);
|
||||
store.pruneHistory(maxItems);
|
||||
await syncQueue();
|
||||
} catch (err) {
|
||||
@@ -374,4 +404,19 @@ export async function clearCancelledOrFailed() {
|
||||
} catch (e) {
|
||||
console.error("Comfy Sidebar: Failed to clear cancelled or failed tasks", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function removeHistoryItems(pids) {
|
||||
if (!pids || pids.length === 0) return;
|
||||
try {
|
||||
store.removePrompts(pids);
|
||||
await api.fetchApi("/history", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ delete: pids })
|
||||
});
|
||||
await syncQueue();
|
||||
} catch (e) {
|
||||
console.error("Comfy Sidebar: Failed to remove history items", e);
|
||||
}
|
||||
}
|
||||
|
||||
+50
-18
@@ -8,7 +8,8 @@ import { renumberNodesTopologically, setManualNodeId } from "./utils/nodeRenumbe
|
||||
import { applySidebarOverride } from "./comfy/adapter.js";
|
||||
import { syncAllNodeBadges, setupVueNodeObserver, toggleIgnoreActiveNode } from "./comfy/nodes.js";
|
||||
import { applyClassicLayout, setupPropertiesPanelToggleFix, syncClassicLayout, syncStockHistoryAndProgressSettings, destroyLayoutFix } from "./comfy/layout.js";
|
||||
import { initSessionAndHistory, syncQueue } from "./queue/queueService.js";
|
||||
import { initSessionAndHistory } from "./queue/queueService.js";
|
||||
import { sweepMissingCards } from "./queue/missingFiles.js";
|
||||
import { setupExecutionTracker } from "./queue/executionTracker.js";
|
||||
import { setupSidebarView, renderSidebar, teardownSidebarView } from "./ui/sidebarView.js";
|
||||
import { setupGalleryView, teardownGalleryView } from "./ui/galleryView.js";
|
||||
@@ -18,6 +19,28 @@ import { getScrollContainer } from "./utils/utils.js";
|
||||
import { store } from "./core/store.js";
|
||||
import { getSetting, setSetting } from "./core/settings.js";
|
||||
|
||||
// The About panel supports extension-provided badges. Resolve build metadata before
|
||||
// registering the extension so the badge is part of its initial registration.
|
||||
let aboutPageBadges = [];
|
||||
try {
|
||||
const response = await fetch("/comfy-sidebar/version", { cache: "no-store" });
|
||||
if (response.ok) {
|
||||
const { version, commit } = await response.json();
|
||||
if (version && version !== "unknown") {
|
||||
const hasCommit = typeof commit === "string" && /^[0-9a-f]{7}$/i.test(commit);
|
||||
aboutPageBadges = [{
|
||||
label: `Comfy Sidebar v${version}${hasCommit ? ` (${commit})` : ""}`,
|
||||
url: hasCommit
|
||||
? `https://github.com/m0rtus59/ComfyUI-ComfySidebar/commit/${commit}`
|
||||
: "https://github.com/m0rtus59/ComfyUI-ComfySidebar",
|
||||
icon: "icon-[lucide--github]"
|
||||
}];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("[ComfySidebar] Could not load version information for the About panel:", error);
|
||||
}
|
||||
|
||||
let isInitialized = false;
|
||||
let activeKeydownHandler = null;
|
||||
let cleanupFns = [];
|
||||
@@ -50,6 +73,22 @@ function setupKeydownShortcuts() {
|
||||
document.addEventListener("keydown", activeKeydownHandler, true);
|
||||
}
|
||||
|
||||
function 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);
|
||||
}
|
||||
}
|
||||
|
||||
function registerSettings() {
|
||||
app.ui.settings.addSetting({
|
||||
id: SettingIds.GRID_COLUMNS_THRESHOLD,
|
||||
@@ -79,22 +118,6 @@ 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"),
|
||||
@@ -106,7 +129,14 @@ function registerSettings() {
|
||||
});
|
||||
|
||||
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
|
||||
@@ -293,6 +323,7 @@ function setupWorkflowTabsPositionWatcher() {
|
||||
|
||||
app.registerExtension({
|
||||
name: "ComfySidebar.ClassicRestore",
|
||||
aboutPageBadges,
|
||||
|
||||
async init() {
|
||||
await initI18n();
|
||||
@@ -407,6 +438,7 @@ app.registerExtension({
|
||||
const sidebarContainer = setupSidebarView();
|
||||
|
||||
await initSessionAndHistory();
|
||||
await sweepMissingCards();
|
||||
setupKeydownShortcuts();
|
||||
|
||||
syncAllNodeBadges();
|
||||
|
||||
+34
-35
@@ -1,9 +1,8 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import { PromptStatus } from "../core/constants.js";
|
||||
import { t } from "../core/i18n.js";
|
||||
import { store } from "../core/store.js";
|
||||
import { renderCardImages } from "./mediaPreview.js";
|
||||
import { copyImageToClipboard, openFileOrFolder, deleteFileOnServer, moveTempImageToOutput, updateMovedImageReferences, findNodeIdForImage, removeImageFromNodeOutputs } from "./mediaActions.js";
|
||||
import { copyImageToClipboard, deleteFilesWithFeedback, moveTempImageToOutput, updateMovedImageReferences, findNodeIdForImage, removeImageFromNodeOutputs } from "./mediaActions.js";
|
||||
import { centerAndSelectCanvasNode } from "../comfy/adapter.js";
|
||||
import { getRunOutputs, extractWorkflowFromPng, isImageFormat, animateCardRemoval, downloadJson, getScrollContainer, attachDeleteConfirmation } from "../utils/utils.js";
|
||||
import { showFullscreenPreview } from "../utils/comparison.js";
|
||||
@@ -20,6 +19,20 @@ export function resetAllCardHoverStates() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-check intermediate files after Queue cleanup has removed TEMP images.
|
||||
* The normal card update path caches this validation, so invalidate it first.
|
||||
*/
|
||||
export function revalidateIntermediateResults(pid) {
|
||||
const state = store.getPrompt(pid);
|
||||
const cardObj = cardPool.get(String(pid));
|
||||
if (!state || !cardObj) return;
|
||||
|
||||
state._hasValidatedIntermediates = false;
|
||||
cardObj._isCheckingIntermediates = false;
|
||||
syncCardButtonVisibility(cardObj, state);
|
||||
}
|
||||
|
||||
export function syncCardButtonVisibility(cardObj, state) {
|
||||
if (!cardObj) return;
|
||||
|
||||
@@ -586,44 +599,30 @@ export function getOrCreateCard(state, callbacks = {}) {
|
||||
confirmTitle: t("Click again to confirm removing card"),
|
||||
confirmDiskTitle: t("Ctrl+Click again to delete file from DISK / TRASH"),
|
||||
onConfirm: async (shouldDeleteFromDisk) => {
|
||||
animateCardRemoval(card, async () => {
|
||||
if (shouldDeleteFromDisk) {
|
||||
const liveState = store.getPrompt(state.pid) || state;
|
||||
|
||||
if (shouldDeleteFromDisk) {
|
||||
const filesToDelete = [];
|
||||
const seen = new Set();
|
||||
const addFile = (item) => {
|
||||
if (item && item.filename) {
|
||||
const key = `${item.type || ""}/${item.subfolder || ""}/${item.filename}`;
|
||||
if (!seen.has(key)) {
|
||||
seen.add(key);
|
||||
filesToDelete.push(item);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
(liveState.images || []).forEach(addFile);
|
||||
const allOutputs = getRunOutputs(liveState.nodeOutputs, liveState.workflow);
|
||||
allOutputs.forEach(out => (out.images || []).forEach(addFile));
|
||||
|
||||
let deletedCount = 0;
|
||||
let lastAction = "trashed";
|
||||
for (const fileItem of filesToDelete) {
|
||||
const action = await deleteFileOnServer(fileItem);
|
||||
if (action) {
|
||||
deletedCount++;
|
||||
lastAction = action;
|
||||
const filesToDelete = [];
|
||||
const seen = new Set();
|
||||
const addFile = (item) => {
|
||||
if (item && item.filename) {
|
||||
const key = `${item.type || ""}/${item.subfolder || ""}/${item.filename}`;
|
||||
if (!seen.has(key)) {
|
||||
seen.add(key);
|
||||
filesToDelete.push(item);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (deletedCount > 0) {
|
||||
const msg = lastAction === "trashed"
|
||||
? `Moved ${deletedCount} file${deletedCount > 1 ? "s" : ""} to Recycle Bin.`
|
||||
: `Permanently deleted ${deletedCount} file${deletedCount > 1 ? "s" : ""}.`;
|
||||
showNotification(msg, "success", "Delete Files");
|
||||
}
|
||||
}
|
||||
(liveState.images || []).forEach(addFile);
|
||||
const allOutputs = getRunOutputs(liveState.nodeOutputs, liveState.workflow);
|
||||
allOutputs.forEach(out => (out.images || []).forEach(addFile));
|
||||
|
||||
// Delete first, animate afterwards: if a file can't be deleted (for example the user
|
||||
// cancelled the Recycle Bin dialog) the card must stay.
|
||||
if (!(await deleteFilesWithFeedback(filesToDelete))) return;
|
||||
}
|
||||
|
||||
animateCardRemoval(card, () => {
|
||||
deleteHistoryItem(state.pid);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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,7 +1,6 @@
|
||||
import { app } from "/scripts/app.js";
|
||||
import { SettingIds, PromptStatus } from "../core/constants.js";
|
||||
import { t } from "../core/i18n.js";
|
||||
import { deleteFileOnServer, openFileOrFolder } from "./mediaActions.js";
|
||||
import { deleteFileOnServer, openFileOrFolder, copyImageToClipboard } from "./mediaActions.js";
|
||||
import { extractWorkflowFromPng, isImageFormat, animateCardRemoval, getScrollContainer, calculateGridColumns, downloadJson, setupSpotlightTracker, attachDeleteConfirmation } from "../utils/utils.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
import { renderCardImages } from "./mediaPreview.js";
|
||||
@@ -339,8 +338,10 @@ function createFileCard(file) {
|
||||
onConfirm: async () => {
|
||||
const action = await deleteFileOnServer(fileAsset);
|
||||
if (action) {
|
||||
const msg = action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file.");
|
||||
showNotification(msg, "success", t("Delete File"));
|
||||
if (action !== "missing") {
|
||||
const msg = action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file.");
|
||||
showNotification(msg, "success", t("Delete File"));
|
||||
}
|
||||
cachedFiles = cachedFiles.filter(f => f.filename !== file.filename || f.subfolder !== file.subfolder);
|
||||
displayedFilesCount = Math.max(0, displayedFilesCount - 1);
|
||||
|
||||
|
||||
+113
-22
@@ -1,4 +1,8 @@
|
||||
import { getSetting } from "../core/settings.js";
|
||||
import { getSetting, setSetting } from "../core/settings.js";
|
||||
import { SettingIds } from "../core/constants.js";
|
||||
import { askTrashFallback } from "./deleteFallbackDialog.js";
|
||||
import { showNotification } from "../utils/nodeRenumber.js";
|
||||
import { t } from "../core/i18n.js";
|
||||
|
||||
export async function copyImageToClipboard(src) {
|
||||
try {
|
||||
@@ -52,29 +56,116 @@ export async function openFileOrFolder(img) {
|
||||
a.remove();
|
||||
}
|
||||
|
||||
export async function deleteFileOnServer(fileItem) {
|
||||
/**
|
||||
* Deletes a generated file on the server.
|
||||
* Resolves to "trashed" / "deleted" on success, "missing" if the file was already gone,
|
||||
* or null if it could not be deleted (error, or the user cancelled the trash-failed dialog).
|
||||
*
|
||||
* If the Recycle Bin can't be used the server refuses to delete (HTTP 409) rather than silently
|
||||
* deleting permanently; we then ask the user whether to turn on direct deletion or retry
|
||||
* after fixing send2trash.
|
||||
*/
|
||||
export async function deleteFileOnServer(fileItem, { suppressDialog = false, endpoint = "/comfy-sidebar/delete-file" } = {}) {
|
||||
if (!fileItem || !fileItem.filename) return null;
|
||||
const isPermanent = getSetting("Comfy Sidebar.Permanent Delete on Disk Deletion", false);
|
||||
try {
|
||||
const res = await fetch("/comfy-sidebar/delete-file", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
filename: fileItem.filename,
|
||||
subfolder: fileItem.subfolder || "",
|
||||
type: fileItem.type || "output",
|
||||
permanent: isPermanent
|
||||
})
|
||||
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 (res.ok) {
|
||||
const data = await res.json();
|
||||
return data.action || (isPermanent ? "deleted" : "trashed");
|
||||
|
||||
if (choice === "permanent") {
|
||||
setSetting(SettingIds.PERMANENT_DELETE, true);
|
||||
permanent = true;
|
||||
} else if (choice !== "retry") {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
} catch (e) {
|
||||
console.error("Comfy Sidebar: Failed to delete file on server", e);
|
||||
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) {
|
||||
@@ -164,10 +255,10 @@ export function findNodeIdForImage(state, img) {
|
||||
for (const key in out) {
|
||||
const val = out[key];
|
||||
if (Array.isArray(val)) {
|
||||
if (val.some(i => i && typeof i === "object" && i.filename === img.filename)) {
|
||||
if (val.some(i => i && typeof i === "object" && i.filename === img.filename && (i.subfolder || "") === (img.subfolder || ""))) {
|
||||
return nodeId;
|
||||
}
|
||||
} else if (val && typeof val === "object" && val.filename === img.filename) {
|
||||
} else if (val && typeof val === "object" && val.filename === img.filename && (val.subfolder || "") === (img.subfolder || "")) {
|
||||
return nodeId;
|
||||
}
|
||||
}
|
||||
|
||||
+39
-25
@@ -3,7 +3,7 @@ import { openFileOrFolder, removeImageFromNodeOutputs } 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";
|
||||
|
||||
export function findWorkflowBackgroundThumbnail(state, randParam = "") {
|
||||
@@ -368,7 +368,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";
|
||||
@@ -626,37 +631,46 @@ export function renderCardImages(cardObj, state, onNavigateBatch) {
|
||||
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 = Math.min(cardObj.currentImageIndex || 0, liveState.images.length - 1);
|
||||
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;
|
||||
}
|
||||
|
||||
// Keep the history card even if its file was removed. Missing media should
|
||||
// not erase history or prevent a later run from reusing the same output path.
|
||||
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);
|
||||
// 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
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -771,7 +785,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 = () => {
|
||||
|
||||
+36
-33
@@ -8,9 +8,10 @@ import { updateSidebarBadge, centerAndSelectCanvasNode } from "../comfy/adapter.
|
||||
import { matchesFilter, getRunOutputs, isImageFormat, animateCardRemoval, getScrollContainer, calculateGridColumns, setupSpotlightTracker, attachDeleteConfirmation } from "../utils/utils.js";
|
||||
import { getSetting } from "../core/settings.js";
|
||||
import { renderCardImages } from "./mediaPreview.js";
|
||||
import { deleteFileOnServer, moveTempImageToOutput, updateMovedImageReferences, removeImageFromNodeOutputs, copyImageToClipboard, findNodeIdForImage } from "./mediaActions.js";
|
||||
import { deleteFilesWithFeedback, moveTempImageToOutput, updateMovedImageReferences, removeImageFromNodeOutputs, copyImageToClipboard, findNodeIdForImage } from "./mediaActions.js";
|
||||
import { toggleIgnoreActiveNode } from "../comfy/nodes.js";
|
||||
import { renumberNodesTopologically, showNotification } from "../utils/nodeRenumber.js";
|
||||
import { showNotification } from "../utils/nodeRenumber.js";
|
||||
import { clearTemporaryCards, countTemporaryCards } from "./clearTemporary.js";
|
||||
|
||||
let scrollToTopBtnEl = null;
|
||||
let globalClickRegistered = false;
|
||||
@@ -261,7 +262,9 @@ export function setupSidebarView() {
|
||||
return btn;
|
||||
};
|
||||
|
||||
const createActionBtn = (iconClass, tooltip, hoverColor, onClickFn) => {
|
||||
// `onArm` runs on the first press. Return false to cancel arming (nothing to confirm),
|
||||
// or a string to show as the tooltip while the button waits for its confirming press.
|
||||
const createActionBtn = (iconClass, tooltip, hoverColor, onClickFn, onArm = null) => {
|
||||
const btn = document.createElement("button");
|
||||
btn.className = `${iconClass} comfy-sidebar-header-btn`;
|
||||
btn.title = tooltip;
|
||||
@@ -269,6 +272,7 @@ export function setupSidebarView() {
|
||||
let timeout = null, isPending = false;
|
||||
const reset = () => {
|
||||
isPending = false;
|
||||
btn.title = tooltip;
|
||||
Object.assign(btn.style, {
|
||||
color: "", background: "",
|
||||
borderColor: "", boxShadow: ""
|
||||
@@ -279,6 +283,9 @@ export function setupSidebarView() {
|
||||
btn.addEventListener("click", async (ev) => {
|
||||
ev.stopPropagation();
|
||||
if (!isPending) {
|
||||
const armed = onArm ? onArm() : true;
|
||||
if (armed === false) return;
|
||||
if (typeof armed === "string") btn.title = armed;
|
||||
isPending = true;
|
||||
Object.assign(btn.style, {
|
||||
color: "#fff", background: hoverColor, borderColor: hoverColor,
|
||||
@@ -308,10 +315,6 @@ export function setupSidebarView() {
|
||||
toggleIgnoreActiveNode(() => renderSidebar());
|
||||
});
|
||||
|
||||
const btnRenumber = createInstantBtn("pi pi-sort-numeric-down", t("Renumber All Nodes by Execution Order (Alt+R)"), async () => {
|
||||
await renumberNodesTopologically();
|
||||
});
|
||||
|
||||
const divider = document.createElement("div");
|
||||
Object.assign(divider.style, {
|
||||
width: "1px", height: "14px", background: "var(--border, var(--border-color, #444))",
|
||||
@@ -323,15 +326,28 @@ export function setupSidebarView() {
|
||||
renderSidebar();
|
||||
});
|
||||
|
||||
const btnClearAll = createActionBtn("pi pi-trash", t("Clear All History"), "#dc3545", async () => {
|
||||
await clearAllHistory();
|
||||
const btnClearTemporary = createActionBtn("pi pi-hourglass", t("Clear Temporary (cards and files not saved to Outputs)"), "#fd7e14", async () => {
|
||||
await clearTemporaryCards();
|
||||
renderSidebar();
|
||||
}, () => {
|
||||
const count = countTemporaryCards();
|
||||
if (count === 0) {
|
||||
showNotification(t("Nothing temporary to clear."), "success", t("Clear Temporary"));
|
||||
return false;
|
||||
}
|
||||
return t("Click again to clear {count} temporary card(s)", { count });
|
||||
});
|
||||
|
||||
const btnClearAll = createActionBtn("pi pi-trash", t("Clear All History"), "#dc3545", async () => {
|
||||
await clearTemporaryCards();
|
||||
await clearAllHistory();
|
||||
renderSidebar();
|
||||
}, () => t("Click again to clear all history"));
|
||||
|
||||
actionsGroup.appendChild(btnToggleIgnore);
|
||||
actionsGroup.appendChild(btnRenumber);
|
||||
actionsGroup.appendChild(divider);
|
||||
actionsGroup.appendChild(btnClearInterrupted);
|
||||
actionsGroup.appendChild(btnClearTemporary);
|
||||
actionsGroup.appendChild(btnClearAll);
|
||||
standardHeader.appendChild(actionsGroup);
|
||||
|
||||
@@ -557,15 +573,13 @@ export function renderSidebar() {
|
||||
confirmTitle: t("Click again to confirm removing from batch"),
|
||||
confirmDiskTitle: t("Ctrl+Click again to delete file from DISK / TRASH"),
|
||||
onConfirm: async (shouldDeleteFromDisk) => {
|
||||
animateCardRemoval(card, async () => {
|
||||
if (shouldDeleteFromDisk && img && img.filename) {
|
||||
const action = await deleteFileOnServer(img);
|
||||
if (action) {
|
||||
const msg = action === "trashed" ? t("Moved file to Recycle Bin.") : t("Permanently deleted file.");
|
||||
showNotification(msg, "success", t("Delete File"));
|
||||
}
|
||||
}
|
||||
// Delete first: if the file can't be deleted (e.g. the Recycle Bin dialog was
|
||||
// cancelled) the card has to stay.
|
||||
if (shouldDeleteFromDisk && img && img.filename) {
|
||||
if (!(await deleteFilesWithFeedback([img], t("Delete File")))) return;
|
||||
}
|
||||
|
||||
animateCardRemoval(card, async () => {
|
||||
const pid = batchInfo.parentPromptId || batchInfo.pid;
|
||||
const state = store.getPrompt(pid);
|
||||
const imgIdx = batchInfo.images.indexOf(img);
|
||||
@@ -817,22 +831,11 @@ export function renderSidebar() {
|
||||
confirmTitle: t("Click again to confirm removing output"),
|
||||
confirmDiskTitle: t("Ctrl+Click again to delete this node's files from DISK / TRASH"),
|
||||
onConfirm: async (shouldDeleteFromDisk) => {
|
||||
animateCardRemoval(card, async () => {
|
||||
if (shouldDeleteFromDisk && out.images) {
|
||||
let count = 0;
|
||||
let lastAct = "trashed";
|
||||
for (const imgItem of out.images) {
|
||||
const action = await deleteFileOnServer(imgItem);
|
||||
if (action) { count++; lastAct = action; }
|
||||
}
|
||||
if (count > 0) {
|
||||
const msg = lastAct === "trashed"
|
||||
? `Moved ${count} file${count > 1 ? "s" : ""} to Recycle Bin.`
|
||||
: `Permanently deleted ${count} file${count > 1 ? "s" : ""}.`;
|
||||
showNotification(msg, "success", "Delete Files");
|
||||
}
|
||||
}
|
||||
if (shouldDeleteFromDisk && out.images) {
|
||||
if (!(await deleteFilesWithFeedback(out.images))) return;
|
||||
}
|
||||
|
||||
animateCardRemoval(card, async () => {
|
||||
if (st.nodeOutputs && st.nodeOutputs[out.nodeId]) {
|
||||
delete st.nodeOutputs[out.nodeId];
|
||||
}
|
||||
|
||||
@@ -575,10 +575,6 @@ function createComparisonViewer(baseSrc, onDestroy = () => {}) {
|
||||
wrapper.appendChild(mediaA);
|
||||
let isZoomed = false;
|
||||
|
||||
if (!baseSrc) {
|
||||
showPlaceholder();
|
||||
}
|
||||
|
||||
const slider = document.createElement("div");
|
||||
slider.className = "comfy-sidebar-comparison-slider";
|
||||
Object.assign(slider.style, {
|
||||
@@ -623,6 +619,11 @@ 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;
|
||||
|
||||
@@ -10,6 +10,25 @@ function isTemporaryWorkflow(wf) {
|
||||
return wf.isTemporary === true || wf.isPersisted === false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ComfyUI's workflow store calls `createNewTemporary(path?, workflowData?)` for *every* new unsaved tab:
|
||||
* the "+" button / New command, but also loading a file (drag & drop, Open, PNG metadata, paste),
|
||||
* templates, "load default" and "Duplicate". Only the first group should open the quick picker.
|
||||
*
|
||||
* What distinguishes them is the action's arguments:
|
||||
* - a file load / duplicate passes a name (the file name) as `path`;
|
||||
* - default workflow / templates / pasted graphs pass data that already contains nodes;
|
||||
* - a blank workflow has no name and an empty graph.
|
||||
*/
|
||||
export function isBlankWorkflowCreation(args) {
|
||||
const [path, workflowData] = Array.isArray(args) ? args : [];
|
||||
if (typeof path === "string" && path.trim() !== "") return false;
|
||||
if (!workflowData || typeof workflowData !== "object") return true;
|
||||
const hasNodes = Array.isArray(workflowData.nodes) && workflowData.nodes.length > 0;
|
||||
const hasSubgraphs = Array.isArray(workflowData.definitions?.subgraphs) && workflowData.definitions.subgraphs.length > 0;
|
||||
return !hasNodes && !hasSubgraphs;
|
||||
}
|
||||
|
||||
function findNewWorkflowButton(target) {
|
||||
if (!target || typeof target.closest !== "function") return null;
|
||||
|
||||
@@ -460,7 +479,7 @@ export function setupNewWorkflowQuickPicker() {
|
||||
let unsubWorkflowAction = null;
|
||||
const wfMgr = app.extensionManager?.workflow;
|
||||
if (wfMgr && typeof wfMgr.$onAction === "function") {
|
||||
unsubWorkflowAction = wfMgr.$onAction(({ name, after, onError }) => {
|
||||
unsubWorkflowAction = wfMgr.$onAction(({ name, args, after, onError }) => {
|
||||
if (name === "closeWorkflow") {
|
||||
activeCloseCount++;
|
||||
after(() => { activeCloseCount = Math.max(0, activeCloseCount - 1); });
|
||||
@@ -472,6 +491,10 @@ export function setupNewWorkflowQuickPicker() {
|
||||
if (!getSetting(SettingIds.QUICK_WORKFLOW_PICKER, true)) return;
|
||||
if (isReplacing || activeCloseCount > 0 || wfMgr.tabsRestored === false) return;
|
||||
|
||||
// Loaded files, templates, the default graph and duplicates also go through
|
||||
// createNewTemporary: they are not "new blank workflow" and must not open the picker.
|
||||
if (!isBlankWorkflowCreation(args)) return;
|
||||
|
||||
const isExplicitNew = name === "createNewTemporary" || Date.now() <= userInitiatedBlankUntil;
|
||||
if (!isExplicitNew) return;
|
||||
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import { store } from "../core/store.js";
|
||||
import { findActiveSidebars, findPropertiesPanel } from "../comfy/adapter.js";
|
||||
import { findActiveSidebars } from "../comfy/adapter.js";
|
||||
|
||||
export class SidebarOverlay {
|
||||
constructor(options = {}) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { SidebarOverlay } from "./overlay.js";
|
||||
import { t } from "../core/i18n.js";
|
||||
|
||||
// Global helper for code block copying in Markdown view
|
||||
window.moonCopyCode = function(button) {
|
||||
window.comfySidebarCopyCode = function(button) {
|
||||
try {
|
||||
const container = button.parentElement;
|
||||
if (!container) return;
|
||||
@@ -36,11 +36,11 @@ function parseInlineMarkdown(html) {
|
||||
html = html.replace(/`([^`]+)`/g, '<code style="background:#252525;padding:2px 6px;border-radius:3px;font-family:monospace;color:#e06c75;border:1px solid #333;font-size:12px;">$1</code>');
|
||||
html = html.replace(/\*\*\*(.*?)\*\*\*/g, '<strong style="color:#ffffff;font-weight:600;"><em>$1</em></strong>');
|
||||
html = html.replace(/\*\*(.*?)\*\*/g, '<strong style="color:#ffffff;font-weight:600;">$1</strong>');
|
||||
html = html.replace(/__(.*?)__/g, '<strong style="color:#ffffff;font-weight:600;">$1</strong>');
|
||||
html = html.replace(/(?<![\w])__(.+?)__(?![\w])/g, '<strong style="color:#ffffff;font-weight:600;">$1</strong>');
|
||||
html = html.replace(/\*(.*?)\*/g, '<em>$1</em>');
|
||||
html = html.replace(/_(.*?)_/g, '<em>$1</em>');
|
||||
html = html.replace(/(?<![\w])_(.+?)_(?![\w])/g, '<em>$1</em>');
|
||||
html = html.replace(/~~(.*?)~~/g, '<span style="text-decoration:line-through;color:#888;">$1</span>');
|
||||
html = html.replace(/\[([^\]]+)\]\(((?:https?:\/\/|\/)[^\s)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--primary, #ea580c);text-decoration:none;border-bottom:1px dashed var(--primary, #ea580c);cursor:pointer;">$1</a>');
|
||||
html = html.replace(/\[([^\]]+)\]\(((?:https?:\/\/|\/(?!\/))[^\s)"'<>`]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--primary, #ea580c);text-decoration:none;border-bottom:1px dashed var(--primary, #ea580c);cursor:pointer;">$1</a>');
|
||||
html = html.replace(/\$(?!\s)([^\$]+?)(?<!\s)\$/g, '<span style="font-family:\'Times New Roman\',Times,serif;font-size:14px;color:#e5c07b;font-style:italic;padding:0 2px;">$1</span>');
|
||||
return html;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ function parseMarkdown(text) {
|
||||
const rCode = codeContent.join("\n");
|
||||
const langBadge = codeLang ? `<div style="position:absolute;top:6px;left:10px;color:#85c5ec;font-size:10px;font-family:sans-serif;font-weight:bold;text-transform:uppercase;opacity:0.8;user-select:none;">${codeLang}</div>` : '';
|
||||
const btnStyle = "position:absolute;top:6px;right:6px;background:var(--secondary, #333);color:var(--muted-foreground, #aaa);border:1px solid var(--border, #555);border-radius:3px;padding:3px 8px;font-size:10px;cursor:pointer;";
|
||||
htmlLines.push(`<div class="code-block-container" style="position:relative;margin:8px 0;">${langBadge}<button onclick="window.moonCopyCode(this)" style="${btnStyle}">${t("Copy")}</button><pre style="background:color-mix(in srgb, var(--card, #1e1e1e) 90%, black 10%);padding:10px;padding-top:28px;border-radius:4px;border:1px solid var(--border, #333);font-family:monospace;overflow-x:auto;margin:0;color:#85c5ec;"><code>${rCode}</code></pre></div>`);
|
||||
htmlLines.push(`<div class="code-block-container" style="position:relative;margin:8px 0;">${langBadge}<button onclick="window.comfySidebarCopyCode(this)" style="${btnStyle}">${t("Copy")}</button><pre style="background:color-mix(in srgb, var(--card, #1e1e1e) 90%, black 10%);padding:10px;padding-top:28px;border-radius:4px;border:1px solid var(--border, #333);font-family:monospace;overflow-x:auto;margin:0;color:#85c5ec;"><code>${rCode}</code></pre></div>`);
|
||||
codeContent = []; codeLang = ""; inCodeBlock = false;
|
||||
} else {
|
||||
inCodeBlock = true; codeLang = trimmed.slice(3).trim();
|
||||
|
||||
@@ -406,6 +406,26 @@ export function getRunOutputs(nodeOutputs, rawWorkflow, promptGraph = null) {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Every file of a card that lives on the server's disk: its own files plus the files of all
|
||||
* node outputs. Live preview blobs are not on disk and are skipped.
|
||||
*/
|
||||
export function collectCardFiles(state) {
|
||||
const files = [];
|
||||
const seen = new Set();
|
||||
const addFile = (item) => {
|
||||
if (!item || !item.filename) return;
|
||||
if (item.url && item.url.startsWith("blob:")) return;
|
||||
const key = `${item.type || "output"}/${item.subfolder || ""}/${item.filename}`;
|
||||
if (seen.has(key)) return;
|
||||
seen.add(key);
|
||||
files.push(item);
|
||||
};
|
||||
(state?.images || []).forEach(addFile);
|
||||
getRunOutputs(state?.nodeOutputs, state?.workflow).forEach((out) => (out.images || []).forEach(addFile));
|
||||
return files;
|
||||
}
|
||||
|
||||
export function getPrimaryOutputImages(nodeOutputs, rawWorkflow) {
|
||||
if (!nodeOutputs) return findImagesInOutputs(null, rawWorkflow);
|
||||
const runOutputs = getRunOutputs(nodeOutputs, rawWorkflow);
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "نقل إلى المخرجات",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "انقل الصورة المحددة إلى المخرجات (Ctrl+نقرة)",
|
||||
"Moved selected image to Outputs.": "تم نقل الصورة المحددة إلى المخرجات.",
|
||||
"Failed to move 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": "انقر مرة أخرى لمسح السجل بالكامل"
|
||||
}
|
||||
|
||||
+27
-1
@@ -18,7 +18,21 @@
|
||||
"No nodes selected. Click a node on the canvas first to toggle ignore.": "No nodes selected. Click a node on the canvas first to toggle ignore.",
|
||||
"Renumber All Nodes by Execution Order (Alt+R)": "Renumber All Nodes by Execution Order (Alt+R)",
|
||||
"Clear Cancelled & Failed": "Clear Cancelled & Failed",
|
||||
"Clear Temporary": "Clear Temporary",
|
||||
"Clear Temporary (cards and files not saved to Outputs)": "Clear Temporary (cards and files not saved to Outputs)",
|
||||
"Click again to clear {count} temporary card(s)": "Click again to clear {count} temporary card(s)",
|
||||
"Cleared {count} temporary card(s).": "Cleared {count} temporary card(s).",
|
||||
"Nothing temporary to clear.": "Nothing temporary to clear.",
|
||||
"Could not delete {count} file(s). Their cards were kept.": "Could not delete {count} file(s). Their cards were kept.",
|
||||
"Clear All History": "Clear All History",
|
||||
"Clear All History (also clears TEMP)": "Clear All History (also clears TEMP)",
|
||||
"Click again to clear all history and TEMP files": "Click again to clear all history and TEMP files",
|
||||
"Could not inspect the TEMP directory.": "Could not inspect the TEMP directory.",
|
||||
"Finish or cancel queued workflows before clearing history and TEMP.": "Finish or cancel queued workflows before clearing history and TEMP.",
|
||||
"Moved {count} TEMP item(s) to Recycle Bin.": "Moved {count} TEMP item(s) to Recycle Bin.",
|
||||
"Permanently deleted {count} TEMP item(s).": "Permanently deleted {count} TEMP item(s).",
|
||||
"Could not delete {count} TEMP item(s).": "Could not delete {count} TEMP item(s).",
|
||||
"TEMP cleanup stopped because a workflow entered the queue.": "TEMP cleanup stopped because a workflow entered the queue.",
|
||||
"Filter by text, images, nodes...": "Filter by text, images, nodes...",
|
||||
"Clear & Close Search": "Clear & Close Search",
|
||||
"Scroll to Top": "Scroll to Top",
|
||||
@@ -50,6 +64,17 @@
|
||||
"Click again to confirm removing output": "Click again to confirm removing output",
|
||||
"Moved file to Recycle Bin.": "Moved file to Recycle Bin.",
|
||||
"Permanently deleted file.": "Permanently deleted file.",
|
||||
"Couldn't move the file to the Recycle Bin": "Couldn't move the file to the Recycle Bin",
|
||||
"Could not move \"{filename}\" to the Recycle Bin / Trash.": "Could not move \"{filename}\" to the Recycle Bin / Trash.",
|
||||
"The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:": "The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:",
|
||||
"The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.": "The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.",
|
||||
"Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings → Comfy Sidebar.": "Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings → Comfy Sidebar.",
|
||||
"Turn on direct deletion": "Turn on direct deletion",
|
||||
"Try again": "Try again",
|
||||
"Cancel": "Cancel",
|
||||
"Moved {count} file(s) to Recycle Bin.": "Moved {count} file(s) to Recycle Bin.",
|
||||
"Permanently deleted {count} file(s).": "Permanently deleted {count} file(s).",
|
||||
"Could not delete {count} file(s). The card was kept.": "Could not delete {count} file(s). The card was kept.",
|
||||
"Cancelled": "Cancelled",
|
||||
"Error": "Error",
|
||||
"Warning": "Warning",
|
||||
@@ -133,5 +158,6 @@
|
||||
"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"
|
||||
"Move to Outputs": "Move to Outputs",
|
||||
"Click again to clear all history": "Click again to clear all history"
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
"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"
|
||||
},
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"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."
|
||||
"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"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "انتقال به خروجیها",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "انتقال تصویر انتخابشده به خروجیها (Ctrl+کلیک)",
|
||||
"Moved selected image to Outputs.": "تصویر انتخابشده به خروجیها منتقل شد.",
|
||||
"Failed to move 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": "برای پاک کردن کل تاریخچه دوباره کلیک کنید"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"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."
|
||||
"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"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "העבר לפלט",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "העבר את התמונה שנבחרה לפלט (Ctrl+לחיצה)",
|
||||
"Moved selected image to Outputs.": "התמונה שנבחרה הועברה לפלט.",
|
||||
"Failed to move 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": "לחצו שוב כדי לנקות את כל ההיסטוריה"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"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."
|
||||
"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"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "出力フォルダーへ移動",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "選択した画像を出力フォルダーへ移動 (Ctrl+クリック)",
|
||||
"Moved selected image to Outputs.": "選択した画像を出力フォルダーへ移動しました。",
|
||||
"Failed to move 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": "もう一度クリックすると、すべての履歴を消去します"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "출력 폴더로 이동",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "선택한 이미지를 출력 폴더로 이동 (Ctrl+클릭)",
|
||||
"Moved selected image to Outputs.": "선택한 이미지를 출력 폴더로 이동했습니다.",
|
||||
"Failed to move 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": "모든 기록을 지우려면 한 번 더 클릭하세요"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"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."
|
||||
"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"
|
||||
}
|
||||
|
||||
+21
-1
@@ -19,6 +19,14 @@
|
||||
"Renumber All Nodes by Execution Order (Alt+R)": "Перенумеровать ноды по порядку выполнения (Alt+R)",
|
||||
"Clear Cancelled & Failed": "Очистить отменённые и с ошибкой",
|
||||
"Clear All History": "Очистить всю историю",
|
||||
"Clear All History (also clears TEMP)": "Очистить всю историю и папку TEMP",
|
||||
"Click again to clear all history and TEMP files": "Нажмите ещё раз, чтобы очистить историю и файлы TEMP",
|
||||
"Could not inspect the TEMP directory.": "Не удалось проверить папку TEMP.",
|
||||
"Finish or cancel queued workflows before clearing history and TEMP.": "Завершите или отмените задания в очереди перед очисткой истории и TEMP.",
|
||||
"Moved {count} TEMP item(s) to Recycle Bin.": "Элементов TEMP перемещено в корзину: {count}.",
|
||||
"Permanently deleted {count} TEMP item(s).": "Элементов TEMP удалено безвозвратно: {count}.",
|
||||
"Could not delete {count} TEMP item(s).": "Не удалось удалить элементов TEMP: {count}.",
|
||||
"TEMP cleanup stopped because a workflow entered the queue.": "Очистка TEMP остановлена: в очереди появилось задание.",
|
||||
"Filter by text, images, nodes...": "Поиск по тексту, файлам, нодам...",
|
||||
"Clear & Close Search": "Очистить и закрыть поиск",
|
||||
"Scroll to Top": "Наверх",
|
||||
@@ -50,6 +58,17 @@
|
||||
"Click again to confirm removing output": "Нажмите еще раз для подтверждения удаления",
|
||||
"Moved file to Recycle Bin.": "Файл перемещен в корзину.",
|
||||
"Permanently deleted file.": "Файл удален навсегда.",
|
||||
"Couldn't move the file to the Recycle Bin": "Не удалось переместить файл в корзину",
|
||||
"Could not move \"{filename}\" to the Recycle Bin / Trash.": "Не удалось переместить «{filename}» в корзину.",
|
||||
"The send2trash package is not installed in ComfyUI's Python environment. To fix it, run this command and restart ComfyUI:": "Пакет send2trash не установлен в окружении Python, в котором работает ComfyUI. Чтобы исправить, выполните эту команду и перезапустите ComfyUI:",
|
||||
"The system trash can't be used for this file (for example a drive or network share without a trash folder, or a Linux session without a desktop trash). Fix that and try again.": "Системная корзина недоступна для этого файла (например, диск или сетевая папка без корзины либо сессия Linux без корзины рабочего стола). Устраните проблему и повторите попытку.",
|
||||
"Direct deletion removes files permanently, bypassing the Recycle Bin. You can change this later in Settings → Comfy Sidebar.": "Прямое удаление безвозвратно удаляет файлы, минуя корзину. Позже это можно изменить в Настройки → Comfy Sidebar.",
|
||||
"Turn on direct deletion": "Включить прямое удаление",
|
||||
"Try again": "Повторить",
|
||||
"Cancel": "Отмена",
|
||||
"Moved {count} file(s) to Recycle Bin.": "Перемещено файлов в корзину: {count}.",
|
||||
"Permanently deleted {count} file(s).": "Файлов удалено безвозвратно: {count}.",
|
||||
"Could not delete {count} file(s). The card was kept.": "Не удалось удалить файлов: {count}. Карточка сохранена.",
|
||||
"Cancelled": "Отменено",
|
||||
"Error": "Ошибка",
|
||||
"Warning": "Предупреждение",
|
||||
@@ -133,5 +152,6 @@
|
||||
"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."
|
||||
"Failed to move image to Outputs.": "Не удалось переместить изображение в Outputs.",
|
||||
"Click again to clear all history": "Нажмите ещё раз, чтобы очистить всю историю"
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
"Comfy Sidebar_Permanent Delete on Disk Deletion": {
|
||||
"name": "Удалять файлы с диска безвозвратно (минуя Корзину)"
|
||||
},
|
||||
"Comfy Sidebar_Remove Cards With Missing Files": {
|
||||
"name": "Удалять карточки очереди, если их файлов больше нет (например, после очистки папки temp)"
|
||||
},
|
||||
"Comfy Sidebar_Hide Junk_Assets": {
|
||||
"name": "Скрыть вкладку: Ассеты"
|
||||
},
|
||||
|
||||
+10
-14
@@ -1,17 +1,4 @@
|
||||
{
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Kesilenleri Otomatik Temizle",
|
||||
"Comfy Layout": "Klasik Düzen",
|
||||
"Enable Gallery": "Galeriyi Etkinleştir",
|
||||
"Grid Columns Threshold": "Izgara Sütun Eşiği",
|
||||
"Hide Junk": "Gereksiz Öğeleri Gizle",
|
||||
"Latin Hotkeys On Any Layout": "Her Düzende Latin Kısayol Tuşları",
|
||||
"Permanent Delete on Disk Deletion": "Diskten Kalıcı Olarak Sil",
|
||||
"Quick Workflow Picker": "Hızlı İş Akışı Seçici",
|
||||
"Show Pending Count Only": "Yalnızca Bekleyen Sayısını Göster",
|
||||
"Show Working Node Name": "Çalışan Düğüm Adını Göster"
|
||||
},
|
||||
"settingsCategories": {
|
||||
"Comfy Sidebar": "Comfy Sidebar",
|
||||
"Auto Clear Interrupted": "Kesilenleri Otomatik Temizle",
|
||||
@@ -146,5 +133,14 @@
|
||||
"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ı."
|
||||
"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"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "移至輸出資料夾",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "將選取的圖片移至輸出資料夾 (Ctrl+點擊)",
|
||||
"Moved selected image to Outputs.": "已將選取的圖片移至輸出資料夾。",
|
||||
"Failed to move 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": "再次點擊以清除所有歷史記錄"
|
||||
}
|
||||
|
||||
+10
-1
@@ -133,5 +133,14 @@
|
||||
"Move to Outputs": "移动到输出目录",
|
||||
"Move selected image to Outputs (Ctrl+Click)": "将选中的图像移动到输出目录 (Ctrl+单击)",
|
||||
"Moved selected image to Outputs.": "已将选中的图像移动到输出目录。",
|
||||
"Failed to move 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": "再次点击以清除所有历史记录"
|
||||
}
|
||||
|
||||
+1
-1
@@ -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.6"
|
||||
version = "1.8.7"
|
||||
license = { file = "LICENSE" }
|
||||
dependencies = [
|
||||
"send2trash>=1.8.0",
|
||||
|
||||
Reference in New Issue
Block a user