Nodes/ComfyUI-OllamaPromptsGeneratorTlant/Ollama Simple Text Generator Tlant
ComfyUI Node

Ollama Simple Text Generator Tlant

The Two-Text-To-One Ollama Combiner (With a Temperature Knob)

By Tlant·Created 2 years ago·Updated 4 months ago· 2
Ollama Simple Text Generator Tlant
    • generated_text
    text1
    text2
    prompt_templateBy analyzing the content of Text 1 and Text 2, combine them into a coherent description.Text 1: {text1} Text 2: {text2} Give me result only.
    modelllama3
    api_urlhttp://localhost:11434/api/generate
    temperature0.7

    This is the "other" Ollama node in the Tlant pack, and it's the one you reach for when you don't need the three-way positive/reference/negative merge of the main generator - you just want to smash two strings together into one new string, with a local LLM doing the smashing. Classic use: your short idea plus a style reference text in, a fused prompt out. It adds a temperature control the main generator lacks, which is a genuinely nice thing to have when you're chasing creativity vs. consistency.

    How it works

    text1 and text2 are dropped into prompt_template, which by default reads "By analyzing the content of Text 1 and Text 2, combine them into a coherent description... Give me result only." The template supports {text1} and {text2} placeholders (it also technically formats {model} and {url}, though the default doesn't use them). Then it POSTs to Ollama's generate endpoint with stream: false and a temperature option - api_url defaults to http://localhost:11434/api/generate, model defaults to llama3.

    A nice detail the main node lacks: this one sets a 30-second timeout on the request, and if the call fails it returns "Error: ..." as the generated_text output instead of hanging the whole graph. The IS_CHANGED method is also smarter - it hashes the inputs, so the node only re-runs when the text actually changes rather than on every execution.

    Inputs and outputs

    • text1, text2 - the two inputs to merge.
    • prompt_template - the instructions and placeholders; edit this to change the LLM's job entirely.
    • model (default llama3) and api_url - must match an installed model and a running Ollama.
    • temperature - float, 0 to 1, default 0.7. Lower = more deterministic merges.

    Output: generated_text (STRING).

    Install

    Same pack install as everything here:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Tlant/ComfyUI-OllamaPromptsGeneratorTlant
    

    restart, or search "Ollama Simple Text Generator Tlant" in ComfyUI Manager. Then make sure Ollama is up and the model is pulled:

    ollama pull llama3
    

    Where people get tripped up

    • The model default differs from the other Ollama node. The main generator defaults to llama3.1:8b; this one defaults to plain llama3. If you've only pulled one of them, the other node will fail with a model-not-found error. ollama list is your friend.
    • The 30-second timeout. Great for not hanging forever, but a slow model on a loaded CPU can legitimately blow past 30 seconds on a big merge. If you hit "Error: ... timed out", that's the culprit - and note you can't extend the timeout from the UI.
    • VRAM churn. As with the main generator, Ollama loads its model, writes your text, and unloads before the sampler runs, so it doesn't permanently squat on VRAM. But the transient load does cost a few seconds of wall-clock before every generation that touches this node.

    For quick text fusing with a creativity dial, it's the simplest Ollama node in the pack - and the timeout behavior alone makes it less likely to strand your whole workflow than its sibling.

    CategoryAI Tools/Ollama

    Inputs (6)

    NameTypeDefaultDescription
    text1STRING
    text2STRING
    prompt_templateSTRINGBy analyzing the content of Text 1 and Text 2, combine them into a coherent description.Text 1: {text1} Text 2: {text2} Give me result only.
    modeloptSTRINGllama3
    api_urloptSTRINGhttp://localhost:11434/api/generate
    temperatureoptFLOAT0.70–1

    Outputs (1)

    NameTypeDescription
    generated_textSTRING