ComfyUI Node

LLM_Reset

Wipe the model's memory — the 'clear conversation' button

By HairlessPrimate·Created 3 years ago·Updated 2 years ago· 71
LLM_Reset
  • LLM
  • LLM

Models hold grudges. Or, more precisely, they hold context - every token you've fed them stays in the KV cache and shapes everything they say afterward. LLM_Reset is the "clear conversation" button for that: it takes a model and returns it with its context wiped clean, ready to start fresh. Think of it as restarting the model's mental state without reloading the weights.

You'd think a node that just forgets things would be useless, but it earns its place the moment you start chaining generations in one graph. The pack has no built-in looping, and every Call LLM node runs against whatever context the model already has. Run a graph twice and the second run's output can be subtly contaminated by the first - the model "remembers" what it just said. LLM_Reset is the guard against that: drop it in front of a generation node and every run starts from a clean slate.

Inputs and output

  • LLM - the loaded model to reset.

The output is LLM - the same model, context cleared. That pass-through shape is the useful part: you can wire LLM_Reset between any two nodes in a chain to make sure the downstream node starts with a blank mind.

When you actually want it

Three situations, in decreasing order of commonness:

  1. Reproducible runs. If you're A/B testing prompts or seeds and don't want prior context leaking into the comparison, reset before every generation. This is the node's bread and butter.
  2. Prompt-isolation. ComfyUI workflows get re-run and re-branched constantly. When you want a Call LLM node to see only its own prompt - not whatever happened upstream - reset first.
  3. Manual loop hygiene. In the token-level pipeline (LLM_EvalLLM_Sample), a reset is how you abandon one sequence and start another without unloading the model.

The honest caveat: since ComfyUI nodes run in dependency order and the pack lacks state-based caching tricks, the reset is only meaningful if the graph actually re-executes the chain. For most single-run graphs it's a no-op that costs nothing. It becomes essential exactly when you're doing repeated or branched runs - which is when silent context bleed is most confusing.

Install

Standard pack setup: ComfyUI Manager search "ComfyUI-Llama", or:

cd ComfyUI/custom_nodes
git clone https://github.com/daniel-lewis-ab/ComfyUI-Llama

plus pip install llama-cpp-python on manual installs. GGUF models into ComfyUI/custom_nodes/ComfyUI-Llama/models, restart, Ctrl+F5, nodes under the LLM menu.

Bottom line: LLM_Reset is a small utility with a precise job - guaranteeing a fresh context. It won't make your output better on its own, but it's the cheapest fix for "why is the second run different from the first?" that you'll find in this pack.

CategoryLLM

Inputs (1)

NameTypeDefaultDescription
LLMLLM

Outputs (1)

NameTypeDescription
LLMLLM