Nodes/ComfyUI-LLM-Session/LLM Dialogue Cycle
ComfyUI Node

LLM Dialogue Cycle

Run a chat cycle between two local GGUF models inside one node (A<->B), saving transcript.

By kantan-kanto·Created 7 months ago·Updated about a month ago· 27
LLM Dialogue Cycle
    • transcript_text
    initial_user_text
    session_iddefault
    cycles1
    modelA(No GGUF models found in models/LLM/)
    mmprojA(Auto-detect)
    modelB(No GGUF models found in models/LLM/)
    mmprojB(Auto-detect)
    system_promptYou are a helpful assistant.
    system_prompt_A
    system_prompt_B
    max_tokens512
    temperature0.70
    top_p0.90
    n_gpu_layers0
    n_ctx4096
    max_turns12
    summarize_old_historytrue
    summary_chunk_turns3
    max_tokens_summary128
    summary_max_chars1500
    dynamic_max_tokenstrue
    min_generation_tokens96
    safety_margin_tokens64
    persistent_cacheoff
    runtime_cacheLlamaTrieCache
    repeat_penalty1.12
    repeat_last_n256
    rewrite_continuetrue
    log_leveltiming
    suppress_backend_logstrue
    history_dir
    reset_sessionfalse
    stream_to_consolefalse
    enable_thinkingfalse
    CategoryLLM/Session

    Inputs (34)

    NameTypeDefaultDescription
    initial_user_textSTRINGInitial user message (sent to Model A only)
    session_idSTRINGdefaultBase session id. A uses {id}_A, B uses {id}_B, transcript uses {id}.txt
    cyclesINT11–50Number of round trips. 1 = A then B.
    modelACOMBO(No GGUF models found in models/LLM/)GGUF model for role A
    mmprojACOMBO(Auto-detect)Projector reserved for image-capable dialogue workflows. For current text-only dialogue, use (Not required).
    modelBCOMBO(No GGUF models found in models/LLM/)GGUF model for role B
    mmprojBCOMBO(Auto-detect)Projector reserved for image-capable dialogue workflows. For current text-only dialogue, use (Not required).
    system_promptSTRINGYou are a helpful assistant.Shared system prompt for both roles
    system_prompt_ASTRINGRole-specific system prompt for model A (overrides shared prompt if set)
    system_prompt_BSTRINGRole-specific system prompt for model B (overrides shared prompt if set)
    max_tokensINT5121–32768
    temperatureFLOAT0.700–2
    top_pFLOAT0.900.05–1
    n_gpu_layersINT0-1–200
    n_ctxINT4096512–131072
    max_turnsoptINT120–200
    summarize_old_historyoptBOOLEANtrue
    summary_chunk_turnsoptINT31–50
    max_tokens_summaryoptINT12816–2048
    summary_max_charsoptINT1500200–20000
    dynamic_max_tokensoptBOOLEANtrue
    min_generation_tokensoptINT961–4096
    safety_margin_tokensoptINT640–2048
    persistent_cacheoptCOMBOoffPersistent cache backend. LlamaDiskCache stores cache data under separate cache directories for each session id.
    runtime_cacheoptCOMBOLlamaTrieCache4 options: KV_cache, LlamaRAMCache, LlamaTrieCache, off
    repeat_penaltyoptFLOAT1.121–2
    repeat_last_noptINT2560–4096
    rewrite_continueoptBOOLEANtrue
    log_leveloptCOMBOtiming3 options: minimal, timing, debug
    suppress_backend_logsoptBOOLEANtrue
    history_diroptSTRINGOptional history directory. Empty => output/llm_session_sessions/. Disk caches are also stored there, separated by session id.
    reset_sessionoptBOOLEANfalseIf true, resets both {id}_A and {id}_B histories (transcript file is not deleted). Session disk caches are kept.
    stream_to_consoleoptBOOLEANfalseStream tokens to console while generating.
    enable_thinkingoptBOOLEANfalseEnable model thinking/reasoning output for supported chat formats.

    Outputs (1)

    NameTypeDescription
    transcript_textSTRING