My Ollama Load Context
Resume a saved Ollama conversation exactly where you left off
- context
MyOllamaLoadContext is the other half of the pack's conversation-persistence pair. My Ollama Save Context writes Ollama's internal token context to a pickle file; this node reads one back and hands it to My Ollama Generate Advance, which then continues the conversation as if the previous session had never ended.
It exists because Ollama's context doesn't survive restarts - the token array that keeps a multi-turn chat coherent lives only as long as the run that produced it. If you're doing long, iterative prompt work (brainstorm a prompt, refine it over several calls, come back to it after a break), this is the node that makes "tomorrow" work. Load the saved context into Generate Advance's optional context input, and the model remembers everything it was told before.
How it works
On load, the node scans ComfyUi-Ollama-YN/file/saved_contexts/ for .pickle files and populates the context_file dropdown with them. Pick one, run it, and it unpickles the saved token array and returns it as the context string output. Wire that into My Ollama Generate Advance's optional context input, and you're resuming - not restarting.
The single output, context, is a STRING, and it's the only thing this node does. It doesn't run a model, it doesn't generate anything; it's a state-reload node. If you haven't saved anything yet, the dropdown will be empty and there's nothing to select.
The input
- context_file - the dropdown of saved pickle files, named
<filename>_<timestamp>.pickle. The timestamp makes it easy to spot which save is which.
No other inputs, no options, no URL. It reads from the pack's own file/saved_contexts folder, so there's nothing to configure.
Installing it
Shared pack install. ComfyUI Manager (search "ComfyUi-Ollama-YN"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/wujm424606/ComfyUi-Ollama-YN.git
# restart ComfyUI
Dependencies are just ollama, pandas, and aiohttp; unpickling is stdlib. No model download, no Ollama server needed for the load itself - though you'll obviously want Ollama running before you feed the context back into a generate node.
The gotcha, and a pointer
The README warns about the exact trap here: a context you just saved won't show up in this node's dropdown until you restart ComfyUI, because the file list is built when the node loads. So the pattern is: save → restart → load. Also note this loads Ollama's internal token context, not a readable transcript - if you're expecting the conversation as text, you're looking at the wrong node; this one is for model state, and it pairs specifically with My Ollama Generate Advance. Used together with the save node, it's the closest thing this pack has to a "session memory" feature.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| context_file | COMBO | 0 options: |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| context | STRING | — |