diff --git a/.tracking b/.tracking index 866b59e..f66dba3 100644 --- a/.tracking +++ b/.tracking @@ -7,6 +7,5 @@ img/magic_mike.jpg img/workflow_timer.png js/workflow_timer.css js/workflow_timer.js -py/__pycache__/workflow_timer.cpython-313.pyc py/workflow_timer.py pyproject.toml \ No newline at end of file diff --git a/js/workflow_timer.css b/js/workflow_timer.css index 613d358..9047f0d 100644 --- a/js/workflow_timer.css +++ b/js/workflow_timer.css @@ -1,3 +1,15 @@ +#workflow-timer { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + background: #000; + overflow: hidden; + gap: 5px; +} + .workflow-timer-display { font-size: 50px; font-family: monospace; diff --git a/js/workflow_timer.js b/js/workflow_timer.js index 9f96e3e..8ef1f3d 100644 --- a/js/workflow_timer.js +++ b/js/workflow_timer.js @@ -1,6 +1,8 @@ import { app } from "../../scripts/app.js"; import { api } from "../../scripts/api.js"; +const VERSION = "1.0.5" + const GlobalTimer = { startTime: 0, accumulatedTime: 0, // Track time across pauses @@ -137,10 +139,7 @@ app.registerExtension({ this.bgcolor = "#000000"; const container = document.createElement("div"); - container.style.cssText = ` - display: flex; flex-direction: column; align-items: center; justify-content: center; - width: 100%; height: 100%; background: #000; overflow: hidden; gap: 5px; - `; + container.id = "workflow-timer"; const display = document.createElement("div"); display.className = "workflow-timer-display"; @@ -184,10 +183,12 @@ app.registerExtension({ api.addEventListener("execution_error", () => GlobalTimer.stop('error')); api.addEventListener("execution_interrupted", () => GlobalTimer.stop('error')); - // MTImageComparePause Integration - api.addEventListener("mt.image_compare_preview", () => { - GlobalTimer.stop('pause'); // Turn Red on preview pause - }); + // --- Image Compare Integration --- + api.addEventListener("mt.image_compare_preview", (event) => { + // Check the detail for the isSkipping flag set by image_compare_pause.js + if (event.detail && event.detail.isSkipping) return; + GlobalTimer.stop('pause'); // Pause (Orange) + }); const originalFetch = window.fetch; window.fetch = function() { diff --git a/pyproject.toml b/pyproject.toml index 9fbfef0..33162da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "ComfyUI_Workflow_Timer" description = "A simple workflow timer node for ComfyUI." -version = "1.0.3" +version = "1.0.4" license = {file = "LICENSE"} [project.urls]