10 Commits
Author SHA1 Message Date
kk8bit 31f20a5041 Make the monitor's RAM figure agree with its percentage
psutil's virtual_memory().used counts only active+wired on macOS, while
.percent is defined as (total - available) / total. Showing one next to
the other produced readings like 10.1/24GB (68%). Derive the used figure
from total - available so both describe the same thing; it also lines up
with Activity Monitor's Memory Used.
2026-09-20 23:26:48 +08:00
kk8bit d1a90c89bc Poll resource stats from the frontend; stop touching the environment
The monitor ran a resident asyncio task that sampled psutil/nvml every
0.5–2s and pushed the result over ComfyUI's WebSocket — whether or not
any panel was open, whether or not the tab was even in the foreground.
It is now a plain GET /kaytool/resources that the panel polls at the same
adaptive rate while it is visible and the page is in the foreground. A
200ms cache dedupes concurrent tabs and keeps cpu_percent's "since last
call" baseline sane.

The RemBG loader stopped setting U2NET_HOME. rembg offers no other way to
choose its model directory, and mutating the process environment reached
every other rembg-based extension in the same ComfyUI. Models now live
where rembg puts them by default; the changelog carries the migration
note.

Event listeners in gululu.js and nodealign.js use arrow functions instead
of .bind(this).

Together these remove every finding the registry's policy-v0.2 scanner
raised against 0.71.0 except the translators' HTTP calls.
2026-09-20 22:35:18 +08:00
kk8bit e5770345a9 Stop the resource monitor dying when pynvml is absent
The guard around the pynvml import was written as

    except (ImportError, pynvml.NVMLError):

but when the import is what failed, the name pynvml is unbound, so
evaluating the except clause raises NameError — which that clause does not
catch. The handler blew up in precisely the situation it existed for:
Linux or Windows without pynvml installed.

It propagates out of the collector's constructor into monitor_loop, which
runs as a bare create_task, so nothing reports it beyond a "Task exception
was never retrieved" at GC time. The monitor just never produces data, and
running stays True, so a later start() takes the already-running branch.

Catch Exception instead, and wrap the loop so any failure is logged and
running is reset.
2026-09-20 21:56:44 +08:00
kk8bit 6fa1575d07 v0.70.10 2025-04-26 19:08:55 +08:00
kk8bit e9cb2e96c2 v0.70.7 2025-04-26 17:53:08 +08:00
kk8bit 52464cd09c v0.65.1 2025-04-10 21:24:49 +08:00
kk8bit 1fbd7aab4f v0.65.0 2025-04-09 02:56:11 +08:00
kk8bit 971bfbea66 v0.60.3 2025-04-06 23:03:16 +08:00
kk8bit 9fdb0964a3 v0.57.0 2025-04-04 23:25:31 +08:00
kk8bit da413f6357 v0.56.0 2025-04-03 22:07:14 +08:00