Nodes/comfyui-llm-bikeshed/LLM Lifecycle: Textgen
ComfyUI Node

LLM Lifecycle: Textgen

The legacy Textgen VRAM switch (new graphs don't need it)

By VirusShell·Created 4 months ago·Updated 3 days ago· 1
LLM Lifecycle: Textgen
    • lifecycle
    ◄manage_model_memorytrue►

    LLM Lifecycle: Textgen is a one-switch node that existed to give oobabooga Textgen the same VRAM treatment as its LM Studio sibling - and that's now mostly history. The pack moved the behavior onto the provider itself, and this node survives for old graphs. Read this to understand the switch; don't build new workflows around it.

    What it does

    When wired into the lifecycle input of LLM Provider: OAI Compatible with the backend detected as Textgen, it tells the adapter to load the model before a generation runs and unload it after the last one in a chain - the POST /v1/internal/model/load / unload hooks on Textgen. That's the VRAM math from the KB's LLM essay (llm-in-comfyui.md): a chat model and a diffusion model sharing one card is the classic failure mode, and the fix is automated load/unload rather than holding both resident. With the switch OFF, the node emits an empty lifecycle, which the adapter treats as "no lifecycle" - no load, no unload, same as if you'd never connected it.

    It has exactly one widget:

    • manage_model_memory - BOOLEAN, default ON. ON enables the load/unload behavior; OFF disables it.

    That lone BOOLEAN exists partly for a ComfyUI quirk the pack hit in development: nodes with no widgets at all render unreliably (just a title and an output socket), so a toggle keeps the node usable while staying optional. The output is a single lifecycle socket of type LLM_LIFECYCLE.

    Why you should probably not use it

    The pack's own migration note is blunt: replace OAI Compatible + LLM Lifecycle: Textgen with LLM Provider: Textgen and its built-in manage_model_memory toggle. Same behavior, same VRAM handling, one fewer node, no lifecycle wiring to get wrong. The dedicated provider also gets Textgen-specific niceties this path doesn't - the internal model list for the dropdown and a read-only "loaded" line. The lifecycle node remains supported so saved workflows don't break, but if you're starting fresh, the provider is strictly the better route.

    If you do keep it (you have an old graph, or you're locked into OAI Compatible for some multi-backend reason), the wiring is trivial: provider's lifecycle input ← this node's lifecycle output. Leave manage_model_memory ON and forget it exists.

    Install

    Pack standard: ComfyUI Manager search "comfyui-llm-bikeshed", or clone into custom_nodes/ and pip install -r requirements.txt. Dependencies are only pyyaml and requests, already in ComfyUI core - no model downloads. Textgen auth (--api-key / --admin-key) is configured in config.yaml, never in the workflow.

    CategoryLLM Bikeshed/lifecycle

    Inputs (1)

    NameTypeDefaultDescription
    manage_model_memoryBOOLEANtrueWhen ON, load the selected model before generation and unload after the last node in a chain. OFF = same as leaving lifecycle disconnected.

    Outputs (1)

    NameTypeDescription
    lifecycleLLM_LIFECYCLEConnect to the lifecycle input on LLM Provider: OAI Compatible when the detected backend is Textgen.