LLM (Managed Cache)
The no-drama local LLM node for one-shot prompt generation
- STRING
Some nodes you tune for an hour. This one you set in ten seconds. LLMOptionalMemoryFreeSimple is the pack's lightweight LLM chat node: pick a GGUF from a dropdown, type your prompt, tick a box if you want your VRAM back afterward, hit queue. It's the right tool for "turn this description into a prompt once" and other jobs where the full advanced node's sampling panel is just noise.
What it is
The simple sibling of LLMOptionalMemoryFreeAdvanced. Same self-contained model loading, same optional memory-freeing behavior, but only the settings that matter for everyday use. It's text-only - no image input, so this is for pure LLM work, which is exactly what the README's LLM prompt-generation nodes (like the Qwen and IF prompt GGUFs) are for.
The inputs that matter
- ckpt_name - dropdown of GGUF files in
models/LLavacheckpoints. Your LLM. - prompt - your input. Multiline, so it can hold a real instruction like "Write a detailed Flux prompt for a neon-lit rainy street at night."
- temperature - default 0.1. Low for consistent prompt output, up for creative variation.
- max_ctx - context length, default 4096. Leave it unless your prompts are long.
- gpu_layers - GPU offload (default 27). Raise if it's slow.
- n_threads - CPU threads.
- unload - the one that matters. Check it and the model frees from memory after answering, so the diffusion sampler downstream gets the GPU.
Output is a single STRING.
How it works
llama.cpp inference, same as every node in this pack's LLM family: load the GGUF, run your prompt, return the text. The "simple" part is that there's no system message field and no penalties - you get one prompt and a temperature. That's genuinely fine for prompt generation, where you're usually feeding a well-formed instruction and reading one answer.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/gokayfem/ComfyUI_VLM_nodes
Restart (or Manager → "VLM Nodes"). Python 3.9+ and the llama-cpp-python stack. GGUF model files go in models/LLavacheckpoints; no mmproj needed since this node never touches images.
Troubleshooting
The llama-cpp-python install issues are the recurring theme across this pack: on Windows that's the "invalid wheel filename" error during setup and the missing llama.dll import failure at startup, both fixed by reinstalling the package built for your backend. If generation is slow, raise gpu_layers. If the model stays in VRAM and your next node OOMs, you forgot the unload checkbox. Keep it simple.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | 0 options: | |
| max_ctx | INT | 4096128–131072 | — |
| gpu_layers | INT | -1-1–1000 | — |
| n_threads | INT | 121–256 | — |
| prompt | STRING | — | |
| temperature | FLOAT | 0.100–2 | — |
| unload | BOOLEAN | false | — |
| chat_formatopt | STRING | — | |
| n_batchopt | INT | 5121–8192 | Logical prompt batch. Lower this if context loading runs out of memory. |
| n_ubatchopt | INT | 5121–8192 | Physical prompt micro-batch. Never exceeds n_batch. |
| flash_attentionopt | COMBO | Auto | Auto enables llama.cpp flash attention only with accelerator offload and safely retries without it when unsupported. |
| use_mmapopt | BOOLEAN | true | Memory-map GGUF weights when the installed backend supports it. |
| split_modeopt | COMBO | Layer | How llama.cpp distributes tensors across multiple accelerators. |
| main_gpuopt | INT | 00–31 | — |
| tensor_splitopt | STRING | Optional comma-separated accelerator proportions, for example 0.6,0.4. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |