Repository navigation
Smart Queue v1: GPU-aware queue autopilot + Cooldown & Pause node - #1
Merged
Merged
Conversation
Also add aiohttp to CI install (needed since Task 5's middleware tests, plan only called this out for pytest-asyncio in Task 6).
SmartCooldownNode falls back to a plain object base when comfy_api isn't installed, so it stays importable for __init__.py's smoke test outside a real ComfyUI process (plan only wrapped the io import, not the class).
Two plan-code fixes required to make this actually work: - test_smoke.py's manual __init__.py loader didn't register the module in sys.modules before exec, so __init__.py's relative imports (from .backend...) couldn't resolve their parent package. Fixed by registering it first and giving it submodule_search_locations so it's treated as a package. - pytest.ini moved from the package root into tests/: with it at the package root, pytest's Package collector (any dir with __init__.py) unconditionally imports that __init__.py during test *setup* for setUpModule/tearDownModule support, which broke every single test the moment __init__.py started doing the Task 9 relative imports. Rooting pytest at tests/ (which has no __init__.py) keeps the package __init__.py out of the collection tree entirely; --import-mode=importlib avoids the equivalent issue for backend/ and backend/nodes/, which do need __init__.py for real imports.
--import-mode=importlib (needed to keep the package's own __init__.py out of pytest's Package-setup import) stops pytest from touching sys.path at all, so bare `pytest tests/ -v` (what CI runs) couldn't find backend/ without it. python -m pytest masked this by adding cwd itself.
Wires the Python side too (execute() dispatches smart_queue.cooldown_notify and, for wait_for_click, smart_queue.cooldown_wait_for_click via PromptServer.send_sync, then blocks on backend/continue_registry.py's threading.Event until POST /smart_queue/continue/<prompt_id> signals it). run_cooldown()'s signature and tests are unchanged. Sound files are short generated sine-wave tones (stdlib wave module, 440/880/1318Hz, all under 25KB).
Manual verification against a running ComfyUI instance surfaced four gaps unit tests couldn't catch: the queue panel and history were never actually populated (add_queue_item/mark_completed/record_job_started existed only in tests), smart_queue.css was never linked into the page, no manual pause control existed despite spec Section 6 requiring one, and RubzGpuCooldownNode is shadowed by the old rubz-gpu-cooldown pack's registration. - Add backend/queue_tracker.py: mirrors PromptServer's live prompt_queue into Smart Queue's own persistence and the autopilot job counter, including jobs that start and finish within a single poll tick. - Add manual pause/resume: AutopilotState.manual_paused/effective_paused, POST /smart_queue/manual_pause, middleware gates on the combined state. - Fix CSS not being loaded; land the pause control as a small icon button inserted into ComfyUI's own Run-button toolbar row (real flex child, not a position:fixed overlay guessing coordinates) after two placements that overlapped other UI were tried and rejected. - Document all findings in spec Section 13 and update plan checkboxes to match actual verified state.
define_schema() referenced a Hidden enum member that doesn't exist in this ComfyUI version, crashing /object_info for the node. Read the running prompt's id from PromptServer.instance.last_prompt_id instead, set once per prompt by ComfyUI's own execution loop. Verified against a live instance: node sound/toast/fallback/wait-for-click/ unload-before-wait all work, and the queue panel + node UI hold up with Nodes 2.0 toggled on and off. v1 is now fully verified end to end.
Fully superseded and never published, so no external users to migrate. Confirmed the node still resolves correctly from this pack after removal.
rubz
added a commit
that referenced
this pull request
Aug 30, 2026
Smart Queue v1: GPU-aware queue autopilot + Cooldown & Pause node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/prompt, never interrupting a running jobdocs/specs/anddocs/plans/Test plan
cd tests && python -m pytest -q)rubz-gpu-cooldownpack deleted (never published, no external users)