Nodes/Bjornulf_custom_nodes/๐Ÿฆ™๐Ÿ‘ Ollama Vision Prompt Selector
ComfyUI Node

๐Ÿฆ™๐Ÿ‘ Ollama Vision Prompt Selector

Pre-built captioning prompts instead of writing your own

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
๐Ÿฆ™๐Ÿ‘ Ollama Vision Prompt Selector
    • OLLAMA_VISION_PROMPT
    โ—„prompt_typeโ–พโ–บ
    โ—„prefix_custom_promptโ–บ
    โ—„suffix_custom_promptDo not include any introductory text or explanations, make it a clean one line answer.โ–บ

    The pack's Ollama Vision node needs a prompt telling it what kind of description to produce, and writing a good one every time gets old fast. This node is the fix: a menu of twelve purpose-built vision prompts - basic caption, an advanced/detailed version, character-focused, object-focused, semantic description, action description in basic or advanced form, scene context, and prompts specifically shaped for feeding SDXL, FLUX, or video pipelines - so you pick a use case instead of authoring a prompt from scratch each time.

    How it works

    Set prompt_type to whichever mode matches what you're doing - SDXL or FLUX if you're building an auto-captioning dataset pipeline meant to feed a specific model's prompt conventions, characters or objects if you just want an inventory of what's in frame, basic_action/advanced_action if you care about what's happening rather than what's static. The result is a ready-made prompt string, output as OLLAMA_VISION_PROMPT, built to plug straight into Ollama Vision's matching input.

    Two optional text fields let you customize the canned template without abandoning it: prefix_custom_prompt adds your own instructions before the template, and suffix_custom_prompt adds text after it - which defaults to "Do not include any introductory text or explanations, make it a clean one line answer." That default suffix is worth noticing on its own: it's there specifically to stop vision models from wrapping their answer in chatty preamble ("Sure, here's a description of the image:") when what you actually want is a clean string you can drop straight into a prompt field.

    The inputs and outputs that matter

    • prompt_type - the 12-option dropdown: NONE, basic, advanced, characters, objects, semantic, basic_action, advanced_action, context, SDXL, FLUX, video.
    • prefix_custom_prompt (optional, multiline, empty by default) - text prepended to the selected template.
    • suffix_custom_prompt (optional, multiline, defaults to the "clean one line answer" instruction) - text appended after it; clear this if you actually want a fuller, multi-sentence description back.
    • Output: OLLAMA_VISION_PROMPT, a plain string wired into Ollama Vision.

    How to install it

    Through ComfyUI Manager: search Bjornulf_custom_nodes, install, restart ComfyUI. Manually:

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

    cd in, pip install -r requirements.txt (a venv is worth setting up), restart. This node alone doesn't call Ollama - it just builds text - so it has no extra dependency of its own beyond what the shared pack requires, but it's only useful once you've got Ollama itself installed and a vision model pulled for the Ollama Vision node it's meant to feed.

    Common issues

    There isn't much that breaks in this node specifically - it's pure text assembly, no network calls. The place people get tripped up is expectation: if you leave the default suffix in place and then wonder why your vision model's answer is terse and single-line rather than descriptive, that's the suffix doing exactly what it says. Clear it (or write your own) if you want a longer, more natural description back instead of a clean one-liner. And remember the output is just a STRING - it needs to actually be wired into Ollama Vision's OLLAMA_VISION_PROMPT input to do anything; on its own this node produces text and stops.

    CategoryBjornulf

    Inputs (3)

    NameTypeDefaultDescription
    prompt_typeCOMBO12 options: NONE, basic, advanced, characters, objects, semantic, +6
    prefix_custom_promptoptSTRINGโ€”
    suffix_custom_promptoptSTRINGDo not include any introductory text or explanations, make it a clean one line answer.โ€”

    Outputs (1)

    NameTypeDescription
    OLLAMA_VISION_PROMPTSTRINGโ€”