Skip to content

park_ttl: an engine's own park ttl, so ComfyUI nodes that call other engines finish - #125

Merged
T-Crypt merged 2 commits into
mainfrom
T-Crypt/park-ttl
Oct 21, 2026
Merged

T-Crypt merged 2 commits into
mainfrom
T-Crypt/park-ttl

Conversation

@T-Crypt

@T-Crypt T-Crypt commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Fixes #121.

A ComfyUI node can do work outside ComfyUI's queue. In #121 a chat panel inside ComfyUI called a llama-swap model, and that call drained ComfyUI's own lease. With keep_comfyui_up off, the drain stopped the server and killed the request that had asked for the card. With it on, ComfyUI stays up and the request finishes, but its 504 MiB CUDA context stays on the card for [park] ttl, which is a node-wide setting, 30 minutes by default.

park_ttl on an [[engine]] entry replaces [park] ttl for that engine. Keep-up plus a short park_ttl lets the node's request finish and frees the context minutes later. Nothing in it knows about ComfyUI nodes. It works for any parked engine, and an entry without it behaves as before.

  • park.Parked gains TTL, and Evict uses it when it is set.
  • The lease carries the engine's park_ttl. It rides OpAcquire and OpReattach as min_turn does, so a re-attach keeps it, and gateway starts pick it up from berth.toml through berth run.
  • berth config check refuses a negative park_ttl.
  • docs/gateway.md gains a section on ComfyUI nodes that call other engines, with the config to use. contrib/INTEGRATION.md points to it.

Proof:

  • TestEvict (an engine's own ttl beats the node's, both ways) and TestParkedEngineOwnTTL fail with Evict ignoring the per-engine ttl and pass with it. Config and options tests cover the key.
  • Full proof green: build, gofmt, vet, go test ./..., Windows build and vet, golangci-lint (0 issues). mkdocs build --strict passes.

A ComfyUI node can call another engine (a chat panel calling a llama-swap
model), and that call can drain ComfyUI's own lease. With keep_comfyui_up
off, the drain stops the server and kills the request that asked for the
card. With it on, ComfyUI stays up and its CUDA context stays on the card
for the node's [park] ttl, 30 minutes by default.

park_ttl on an engine entry replaces [park] ttl for that engine. Keep-up
plus a short park_ttl lets the node's request finish and frees the context
minutes later. It rides the acquire and re-attach messages like min_turn.

Fixes #121.
@T-Crypt
T-Crypt merged commit be5eeaf into main Oct 21, 2026
4 checks passed
@T-Crypt
T-Crypt deleted the T-Crypt/park-ttl branch October 21, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draining ComfyUI kills a llama-swap request that ComfyUI itself sent

1 participant