Nodes/Bjornulf_custom_nodes/๐Ÿฆ™ Ollama Persona Selector ๐Ÿ‘‡
ComfyUI Node

๐Ÿฆ™ Ollama Persona Selector ๐Ÿ‘‡

Give your local chatbot a personality without writing a system prompt

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
๐Ÿฆ™ Ollama Persona Selector ๐Ÿ‘‡
    • OLLAMA_PERSONA
    • prompt_text
    โ—„selected_promptDefault Assistantโ–บ
    โ—„custom_prompt_prefixโ–บ

    Writing a good system prompt from scratch is annoying, especially for something you just want for a bit of flavor - a chatty NPC generator, a workflow that spits out text in a particular voice, or just a more interesting local assistant than the flat default. This node is a dropdown of 22 pre-written personas - Sassy Teenager, Gothic Poet, Mad Scientist, Stoic Philosopher, Cheerleader, and a bunch more - so you can pick a voice instead of authoring one.

    How it works

    Choose a persona from selected_prompt and the node hands you back the matching system-prompt text, ready to feed into whatever in the pack actually needs a text prompt. If none of the 22 canned options fit, set it to None and write your own instead in custom_prompt_prefix - the author's own README example is a "crazy scientist explaining gravity," built exactly this way, with the note that the model was smart enough to follow even a typo'd persona description.

    The node gives you two versions of the result: a typed OLLAMA_PERSONA bundle meant for whichever of the pack's other Ollama nodes accepts that plug, and a plain prompt_text string. The plain string is the flexible option - it's just text, so it works anywhere a STRING input is expected, including as a prefix you paste manually into an Ollama Talk node's prompt field if you're not chaining it through a typed connection.

    The inputs and outputs that matter

    • selected_prompt (default "Default Assistant") - the persona dropdown: 22 options including None.
    • custom_prompt_prefix (optional, multiline, empty by default) - your own text, used when selected_prompt is None, or as extra flavor layered on top of a canned persona.
    • OLLAMA_PERSONA - the typed output for wiring into the pack's other persona-aware Ollama nodes.
    • prompt_text - the same result as a plain string, usable anywhere text is accepted.

    How to install it

    Through ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/justUmen/Bjornulf_custom_nodes
    

    cd into the cloned folder, pip install -r requirements.txt (a venv is worth it), restart ComfyUI. This node's own text-selection logic needs nothing exotic, but it lives in the same package as the pack's Ollama chat/vision nodes, which do need the ollama Python client installed (pip install ollama) even if you're only using the persona selector on its own - the whole Bjornulf_custom_nodes folder fails to load if any dependency in its shared requirements.txt is missing.

    Common issues

    This node has no external calls of its own - it's pure text selection, so there's not much to break on its own end. The friction shows up one step later: if you wire OLLAMA_PERSONA into a downstream node and get a red socket or a type-mismatch error, double-check that the node you're connecting it to actually exposes an input of that exact type rather than a plain text input - this pack has multiple similarly-named selector nodes (a separate Job Selector alongside this Persona Selector), and their typed outputs aren't interchangeable even though they serve a similar purpose. When in doubt, use the plain prompt_text output instead - it connects to anything that takes a string, no type-matching required.

    CategoryBjornulf

    Inputs (2)

    NameTypeDefaultDescription
    selected_promptCOMBODefault Assistant22 options: None, Default Assistant, Sassy Teenager, Friendly Neighbor, Gothic Poet, Mad Scientist, +16
    custom_prompt_prefixoptSTRINGโ€”

    Outputs (2)

    NameTypeDescription
    OLLAMA_PERSONAOLLAMA_PERSONAโ€”
    prompt_textSTRINGโ€”