Nodes/Kinburg-Nodes/Context Collector
ComfyUI Node

Context Collector

One block of reference material for your LLM, framed properly

By Kinburg·Created 3 months ago·Updated 6 days ago· 1
Context Collector
    • context
    item_1
    titleCharacters
    wrappermarkdown heading
    heading_level##
    separator
    item_2

    If you're using a local LLM in your workflow to expand prompts, you've already hit the real problem: an LLM is only as useful as what you put in front of it, and stuffing raw text into the system prompt doesn't tell the model what it's looking at. Context Collector is the node that frames your reference material - the character cards, entity cards, world notes - into one tidy block the model can latch onto.

    Mechanically it's simple: a list of item_N text inputs that grows on demand (connect the last slot and a new one appears), all joined in index order and wrapped under a title. Empty or unconnected slots are skipped, so a card you haven't filled doesn't leave a blank hole in the block.

    The inputs that matter:

    • item_1 (required, and it keeps growing) - the cards/text chunks. Wire your Character Cards and Entity Cards here.
    • title - the heading, e.g. Characters or Reference. Empty = no heading.
    • wrapper - markdown heading or none (title in bold, no heading markup).
    • heading_level - # through ######; sets where the block sits in the context hierarchy. Default ##.
    • separator - what goes between items. Default is a blank line.

    The output:

    • context - the framed block. Wire it into a Local LLM Settings (GGUF) node's context input, where it gets appended to the system prompt.

    Here's why the framing matters. With cards under a heading, a prompt like "Vasya and Kolya drink tea in a cafe" comes back from the LLM expanded with each character's looks, because the model can bind the name to the description that follows. Without the heading, it's just prose. Choose the heading level based on how much other structure is in your system prompt - you're carving out one section of the context, not shouting over it.

    One honest caveat the pack's own docs repeat: the diffusion model downstream still has its own limits when you bind attributes across multiple people in one image. Context Collector feeds the prompt-writing LLM, and a good expanded prompt is the best you can do - it won't magically fix a model that can't hold two characters' attributes straight.

    Install via ComfyUI Manager (search "Kinburg-Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Kinburg/Kinburg-Nodes
    

    then restart. This node has no dependencies beyond the pack itself - it's just string assembly. The llama-cpp-python dependency the pack installs automatically is only needed if you actually run the Local LLM nodes, and nothing here requires a model download. A one-author pack, but a well-maintained one: per-package docs, 1395 automated checks, and the input/output names are audited so docs can't drift from the real schema.

    CategoryKinburg-Nodes/LLM/context

    Inputs (6)

    NameTypeDefaultDescription
    item_1STRING
    titleSTRINGCharactersHeading placed at the top of the block (e.g. 'Characters', 'Reference'). Empty = no heading.
    wrapperCOMBOmarkdown headingHow to frame the block: a Markdown heading (pick its level below) or none (title in bold, no heading markup).
    heading_levelCOMBO##Markdown heading level for the title (wrapper = markdown heading). '#' = H1 (top of the hierarchy), '##' = H2, … Ignored when wrapper = none.
    separatorSTRING Inserted between the collected items. Default is a blank line.
    item_2optSTRING

    Outputs (1)

    NameTypeDescription
    contextSTRING