combine_chat_messages _O
The glue node that turns your ChatGPT calls from one-shot into a real conversation
- message1
- message2
- OPENAI_CHAT_MESSAGES
If you've ever built a ChatGPT workflow in ComfyUI, you've hit the wall this node exists to knock over: an LLM doesn't take "a prompt", it takes a list of messages. combine_chat_messages _O is how you build that list from pieces. It merges two message lists into one, so you can assemble a system message, a user message, a bit of context, and whatever else, then hand the whole thing to the completion node in the right order.
It's part of the Quality of Life Suit's OpenAI suite, found under O/OpenAI/Advanced/ChatGPT. The suite's flow is: load_openAI _O creates the client, Chat_Message _O creates individual messages, this node stitches them together, and Chat completion _O sends the result and returns the reply. Think of it as the conversational equivalent of a Concat Text node - except that order actually matters to the model, and that's the whole point of having a dedicated node for it.
What it takes and gives
The inputs are dead simple - two message lists:
- message1 (OPENAI_CHAT_MESSAGES) - first half of the conversation
- message2 (OPENAI_CHAT_MESSAGES) - second half
The single output is an OPENAI_CHAT_MESSAGES list with message1's messages followed by message2's. Under the hood it's just list concatenation:
messages = message1["messages"] + message2["messages"]
No deduping, no reordering, no validation - concatenate and return. That's the entire mechanism, and honestly it's refreshing.
Where it fits
The canonical use is the system-prompt sandwich. Create a Chat_Message _O with role = system and the behaviour you want ("you are a prompt engineer who outputs comma-separated tags"), another with role = user and your actual request, then combine them so the model sees the system instructions before the user message. Feed the combined list into Chat completion _O and the answer comes back as a STRING you can drop straight into a CLIP Text Encode.
Because the inputs and output are the same type, you can also chain combines - merge a system+user pair, then append a follow-up from a second pair to build multi-turn context. That's where it earns its keep: proper multi-turn chat in a node graph instead of one stateless call.
The gotchas
Two things will bite you, and neither is this node's fault. First, the whole suite needs an OpenAI API key - either in the load_openAI _O node or in the pack's config.json under openAI_API_Key. Second, this pack is old, and its own pyproject.toml admits it "does not support the new OpenAI API." The default base_url in load_openAI even points at a Cloudflare-worker proxy rather than OpenAI's endpoint, so if calls fail check that first and set it to https://api.openai.com/v1 with your real key. When it breaks, the completion node swallows the error and retries once, so watch the console for the actual message.
Install
It ships with the whole pack, so install once, use everything in O/:
cd <ComfyUI root>/custom_nodes
git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
Restart ComfyUI (browser reload doesn't cut it). The pack auto-updates on startup via a config.json it creates; if you want it to stop changing under you, set "autoUpdate": false in that file.
Worth it? If you're doing anything beyond a single ChatGPT-to-prompt call, yes - it's the difference between a one-liner and an actual conversational workflow, and it costs you one wire.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| message1 | OPENAI_CHAT_MESSAGES | — | |
| message2 | OPENAI_CHAT_MESSAGES | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| OPENAI_CHAT_MESSAGES | OPENAI_CHAT_MESSAGES | — |