resource-safe-generation
Installation
SKILL.md
Resource-Safe Generation
Read ../../references/RESOURCE_SAFE_GENERATION.md and ../../references/COMFYUI_OFFLINE_BATCH.md.
Use when the local LLM and ComfyUI generation models compete for VRAM/RAM.
Core rule: the LLM must finish every creative decision and every ComfyUI instruction before it is unloaded. The offline runner may execute, observe, retry transiently, collect outputs, and report state, but it may not invent prompts, choose new creative directions, repair semantics, or ask the unloaded model for help.
- Finish prompts, references, workflow mapping, seeds/parameters, output identities, and acceptance metadata.
- Build and validate
04_generation/comfyui/offline_batch.jsonwithcomfyui-offline-batch. - Prove where Pi's active LLM runs before choosing a lifecycle mode. Run
python ../../scripts/llm_runtime.py --endpoint <known-base-url>when an endpoint is available. A loopback endpoint such as127.0.0.1,localhost, or::1is local. An OpenAI-compatible API does not imply a cloud model. If location is not proven, keep itunknown; never guessexternal. - Configure
00_project/resource_policy.jsonwith the verified location and a local LLM unload/reload adapter when exclusive mode is required. - Arm
scripts/resource_handoff.py. It starts a model-free runner and waits for the Pi agent turn to finish. - The Pi extension writes the release signal on
agent_end; without the extension, the user can run the explicit release command. - The runner unloads the local LLM, executes the full ComfyUI batch deterministically, continuously updates project status/events, then calls ComfyUI
/freewith model unload and memory release. - The runner reloads the local LLM and writes
RESOURCE_RESUME.mdcontaining results/blockers for the next model turn. - If semantic repair is required, stop the batch, unload ComfyUI models, reload the LLM, and return the failed job plus evidence. Never improvise a new prompt while the LLM is absent.
The Pi progress extension renders resource phase and job progress from files on disk. These UI updates do not require an LLM call.