Nodes/24oiduts-ComfyUI/πŸ’¬ Qwen Chat
ComfyUI Node

πŸ’¬ Qwen Chat

A multi-turn chatbot living inside your ComfyUI graph

By GeekyGhostΒ·Created 12 months agoΒ·Updated 10 months agoΒ· 0
πŸ’¬ Qwen Chat
    • output
    β—„messageHello! How can you help me?β–Ί
    β—„conversation_iddefaultβ–Ί
    β—„model_sizeQwen2-7Bβ–Ί
    β—„clear_historyfalseβ–Ί
    β—„system_promptYou are a helpful AI assistant.β–Ί

    Qwen Chat is the node that makes a real conversational agent part of your workflow. Most "chat" things in ComfyUI are single-shot prompt boxes; this one keeps conversation history, so it actually remembers what you said two turns ago. That's rarer than it should be, and it's the whole reason this node exists in the 24oiduts-ComfyUI pack.

    The practical use is less "chat with a robot" and more "build an interactive pipeline." Because the conversation state lives keyed by a conversation_id you provide, you can run multiple independent chats in the same graph, or reset a chat mid-session without restarting ComfyUI. Think of it as a stateful assistant node you can talk to through the UI while you're building a workflow - or a conversational front end for generating things downstream.

    How it works

    Under the hood it's transformers with a real Qwen causal LM - Qwen2-7B or Qwen-14B, loaded fp16 and cached. What's different from the pack's QwenTextGenerator is the memory: a class-level dictionary stores the message history per conversation_id, and every turn appends to it before generating. There's no API involved and nothing leaves your machine, but the model download is real and large - budget for several GB on first run and enough VRAM to hold the model.

    The inputs that matter

    • message - your current turn. This is what gets answered.
    • conversation_id - a STRING label for which chat thread this message belongs to. Use default for one chat, or give different threads different IDs to run several simultaneously.
    • model_size - Qwen2-7B or Qwen-14B. Smallest that fits your card; 14B is noticeably slower and heavier.
    • clear_history - flip to true and the node wipes the thread for that conversation_id, so the next turn starts fresh. This is how you reset without restarting.
    • system_prompt - the persona/constraint string, defaulting to "You are a helpful AI assistant." Set this once and every turn respects it.

    What comes out

    The reply text comes out of the output port, ready to wire anywhere a STRING is accepted. Keep an eye on the same pack-wide quirk as the other Qwen nodes: if transformers is missing, the node silently falls back to a [FALLBACK] placeholder instead of erroring, which can make it look like the chat is working when it isn't. If replies look canned, check the console for the ⚠️ transformers not available warning.

    Installing it

    This is a node in the 24oiduts-ComfyUI pack, installed once:

    • ComfyUI Manager: search 24oiduts, install, restart.
    • Manual:
      cd ComfyUI/custom_nodes/
      git clone https://github.com/GeekyGhost/24oiduts-ComfyUI
      pip install -r 24oiduts-ComfyUI/requirements.txt
      then restart ComfyUI.

    The GitHub README is a stale Studio42 template that says "not recommended for use at this time" with no license - an unmaintained banner, not a statement about the code. The real doc of record inside the repo is LCARS_README.md.

    Troubleshooting

    • "Chat" answers repeat one-liners - transformers isn't installed; the fallback kicked in. pip install transformers into ComfyUI's venv and restart.
    • Conversation keeps "forgetting" after restart - history is in-memory only, not persisted. It survives runs inside one session, not across ComfyUI restarts.
    • VRAM pressure - the 7B is the sensible choice; 14B is for people with headroom.

    If you want a stateful LLM in the graph rather than a one-shot text generator, this is the node - and conversation_id is the detail that makes it actually useful.

    CategoryStudio42/LCARS/Models

    Inputs (5)

    NameTypeDefaultDescription
    messageSTRINGHello! How can you help me?β€”
    conversation_idSTRINGdefaultβ€”
    model_sizeCOMBOQwen2-7B2 options: Qwen2-7B, Qwen-14B
    clear_historyBOOLEANfalseβ€”
    system_promptoptSTRINGYou are a helpful AI assistant.β€”

    Outputs (1)

    NameTypeDescription
    outputIMAGEβ€”