You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image map: admin socket refresh can drive a self-sustaining projection recompute loop #9635
With the image map's socket-driven refresh runtime attached (PR invoke-ai#41), an admin who leaves the Image Map widget open on a busy multi-user server can keep the index worker fitting UMAP projections back to back, indefinitely.
The cycle:
An admin's map scope is every user's images — request_projection(user_id, all_images=is_admin) in invokeai/app/services/image_map/image_map.py.
GET /points is itself what enqueues a recompute when the scope hash has moved (same file).
image_map_projection_ready naming the admin arrives, and the runtime refetches /points.
A full all-images fit takes minutes. If any user embedded images during it, the refetch in step 3 finds the scope stale and enqueues another full fit.
That fit completes, emits projection_ready to the admin, and we are back at step 3.
Why the existing filter does not help
PR invoke-ai#41 added isForAnotherUser to ImageMapDataRuntime.tsx, which drops projection_ready events naming a different user — that fixed admins being driven by other users' recomputes. It cannot help here, because these events name the admin themselves. The admin's own scope legitimately changed; the problem is the rate, not the attribution.
Suggested directions
A minimum interval / backoff between socket-driven refreshes (user-initiated refresh stays immediate).
Suppress the projection_ready refetch when the previous response already reported stale: true and the returned point set is unchanged — the recompute is already known to be in flight, so the poke adds nothing.
Or have the backend coalesce: skip enqueueing when a fit for the same scope is already queued or running.
The right interval depends on how long a full fit takes on real hardware and how many admin clients typically watch the widget, which is why this is filed rather than patched.
Context
Found by an adversarial review of invoke-ai#41 (feat/image-map-08-live-theme). The other findings from that review are fixed on that branch.
Activity