From 28c8d3ba0b7e4b69e689ea8e66809bacc78bd4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8B=E3=81=BF=E3=81=AA=E3=83=BC=E5=85=88=E7=94=9F?= Date: Sat, 6 Jun 2026 22:39:50 +0900 Subject: [PATCH] =?UTF-8?q?async=E9=96=A2=E6=95=B0=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E3=81=97=E3=81=A6ImageDir=E3=81=AE=E9=80=B2=E6=8D=97?= =?UTF-8?q?=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suite_nodes.py | 11 ++++++++++- web/checkpoint_handpicker_suite.js | 13 +++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/suite_nodes.py b/suite_nodes.py index 0b4de9a..c140bd7 100644 --- a/suite_nodes.py +++ b/suite_nodes.py @@ -1,3 +1,4 @@ +import asyncio import base64 import io import json @@ -2088,7 +2089,15 @@ async def review_sync_checkpoint(request): continue search_directory = target.get("search_directory") max_preview_images = _clamp_image_dir_max_images(target.get("max_preview_images", IMAGE_DIR_DEFAULT_MAX_IMAGES)) - sheet, extra = _load_image_dir_preview(node_id, relpath, search_directory, tab_id=tab_id, send_progress=True, max_preview_images=max_preview_images) + sheet, extra = await asyncio.to_thread( + _load_image_dir_preview, + node_id, + relpath, + search_directory, + tab_id, + True, + max_preview_images, + ) _store_preview_state(tab_id, node_id, relpath, status, node_class="ImageDirPreview") _send_preview(node_id, _image_dir_title(relpath), sheet, extra, tab_id=tab_id) preview_count += 1 diff --git a/web/checkpoint_handpicker_suite.js b/web/checkpoint_handpicker_suite.js index bb66051..5313533 100644 --- a/web/checkpoint_handpicker_suite.js +++ b/web/checkpoint_handpicker_suite.js @@ -798,7 +798,7 @@ function setupPreviewNode(nodeType) { const total = Math.max(1, Number(st.progress_total || st.max_preview_images || 1)); const value = Math.max(0, Math.min(total, Number(st.progress_value || 0))); const barX = margin; - const barY = 52; + const barY = 0; const barW = Math.max(1, this.size[0] - margin * 2); const barH = 6; ctx.fillStyle = "rgba(255,255,255,0.14)"; @@ -894,13 +894,14 @@ function selectorRects(node) { const buttonY = 8; const buttonH = 24; const arrowW = 32; - const downX = Math.max(430, (node.size?.[0] || 520) - margin - arrowW); - const upX = downX - gap - arrowW; const refreshW = 102; const listOnlyW = 92; + const pushW = selectorActionMode(node) === "sync" ? 150 : 132; const pushX = margin + refreshW + gap + listOnlyW + gap; - const availablePushW = Math.max(140, upX - gap - pushX); - const pushW = Math.min(190, availablePushW); + // Keep scroll buttons close to the toolbar action buttons instead of anchoring + // them to the right edge. The right edge belongs to ComfyUI output pins. + const upX = pushX + pushW + gap; + const downX = upX + arrowW + gap; return { refreshAll: { x: margin, y: buttonY, w: refreshW, h: buttonH }, listOnly: { x: margin + refreshW + gap, y: buttonY, w: listOnlyW, h: buttonH }, @@ -1062,7 +1063,7 @@ function selectorActionMode(node) { } function selectorActionLabel(node) { - return selectorActionMode(node) === "sync" ? "🎯 Sync Checkpoint" : "🏹 Push to Local List"; + return selectorActionMode(node) === "sync" ? "🎯 Sync Checkpoint" : "🏹 Push Local"; } async function loadSelector(node, mode = "list") {