Nodes/Kinburg-Nodes/Context Sizer (GGUF)
ComfyUI Node

Context Sizer (GGUF)

A ComfyUI node in Kinburg-Nodes/LLM with 5 inputs and 5 outputs.

By Kinburg·Created 2 months ago·Updated 3 days ago· 1
Context Sizer (GGUF)
  • config
  • image
  • text_tokens
  • image_tokens
  • total_tokens
  • suggested_n_ctx
  • info
text_1
margin64
unload_after_runconfig default
CategoryKinburg-Nodes/LLM

Inputs (5)

NameTypeDefaultDescription
configKINBURG_LLM_CONFIGA 'Local LLM Settings (GGUF)' node — its model (and mmproj, for image sizing) and max_tokens are used.
text_1optSTRINGPrompt text to size (e.g. your rubric / prompt). Connect-only; more text_* slots appear as you wire them and are joined with newlines. The config's system prompt is counted automatically.
imageoptIMAGEOptional image(s) to size for — needs an mmproj on the config (Vision Settings). A batch is fine; the node reports the largest image's token cost.
marginoptINT640–8192Safety headroom added on top of input + output when suggesting n_ctx.
unload_after_runoptCOMBOconfig defaultFree the model from VRAM after THIS node runs, without touching the shared config. 'config default' follows the Settings node; 'unload after run' frees VRAM (a different model runs next); 'keep loaded' stays warm (the same model works next).

Outputs (5)

NameTypeDescription
text_tokensINT
image_tokensINT
total_tokensINT
suggested_n_ctxINT
infoSTRING