Nodes/ComfyUI llama.cpp Suite/llama.cpp Task Profile
ComfyUI Node

llama.cpp Task Profile

Your prompt scaffolding, saved inside the workflow

By Setmaster·Created 9 months ago·Updated 3 days ago· 9
llama.cpp Task Profile
    • profile
    ◄profile_snapshot{"description":"No prompt transformation.","id":"freeform","name":"Freeform","prompt_prefix":"","prompt_suffix":"","schema_version":1,"system_prompt":""}►

    What problem this solves

    Every LLM workflow you build ends up with the same three strings: a system prompt, a prefix, a suffix. "You are a prompt engineer for Z-Image. Output one paragraph, no preamble." Then the same text gets retyped into the next workflow, and the next, and by workflow six you have four slightly different versions of your best instruction and no memory of which one worked.

    Task Profile is that scaffolding, packaged. It stores one profile - a system prompt, a prompt prefix, a prompt suffix, plus an ID, name and description - as a snapshot that lives inside the workflow file. You connect its profile output to Generate's profile input and the model gets your instructions without you retyping anything.

    The key design decision is worth spelling out, because it's the opposite of how most "preset" systems behave: the snapshot in the workflow is authoritative at execution. If the pack's local profile library changes later, or you delete the profile entirely, the workflow still runs exactly the text it was saved with. Which means a graph you shared six months ago still does what it did six months ago, instead of silently picking up someone else's edited instructions. That's reproducibility, and for something that shapes every token the model emits, it's the right call.

    Authoring one

    The node has an Edit Profile Library action. That opens a dialog where you can create a profile, duplicate an existing one, or edit one, then Save Library. Profiles are text-only - a system prompt, a prefix and a suffix. They do not change the model, samplers, seed, images, constraints, release policy or partial-output policy. That separation is deliberate: a profile is instructions, not a config dump.

    Two actions that people conflate, and the docs are unusually blunt about it: Save Library and Update Saved Snapshot are separate. Saving the library does not silently push your edits into workflows you already saved. You choose the profile on the node, then hit Update Saved Snapshot when you want this workflow to adopt the new text. That update participates in Comfy's undo, so undo puts the old snapshot back. It's a bit of a ceremony, and it's exactly the amount of friction you want on something that changes what gets rendered.

    Library files live under your Comfy user data directory as comfyui-llamacpp/profiles.json. The editor does import/export JSON, and a save that would clobber another editor's changes reports a conflict and keeps your unsaved draft rather than merging badly.

    Freeform is the built-in profile and it's read-only: empty system prompt, no prefix, no suffix, no transformation.

    The inputs and outputs

    One required input, profile_snapshot - the portable compact JSON, and it defaults to Freeform:

    {"schema_version":1,"id":"freeform","name":"Freeform","prompt_prefix":"","prompt_suffix":"","system_prompt":"","description":"No prompt transformation."}
    

    One output, profile. Wire it to Generate's profile input and you're done.

    Two behaviours to actually understand:

    Prefix and suffix wrap the user prompt - they're added around the text you typed before it reaches the model. They do not add anything to the model's response. If you want exact literal text appended after generation (a trigger word, a LoRA tag, weighted syntax), that's core Comfy concatenation on the output side. A profile can't preserve that for you, because it modifies the input.

    The profile's system prompt fills only an exactly empty system-prompt input. A single space counts as an explicit value and blocks the fill. That's a stricter rule than most people expect and it's the source of a confusing afternoon: your profile's system prompt "isn't working" because you left a stray space in Generate's field.

    Also relevant: if you're feeding Generate an explicit message history that already contains a system turn, Generate's system_prompt must be empty and the profile's system prompt must be empty. One system source, or none.

    Installing

    Part of the pack - nothing extra:

    comfy node install comfyui-llamacpp
    

    Manager search "comfyui-llamacpp", or clone into ComfyUI/custom_nodes and pip install -r requirements.txt with ComfyUI's own Python, then restart. The editor is a frontend action served by the pack, so if the button doesn't appear you're probably on a stale cached frontend - hard refresh before assuming the node is broken. You'll still need a llama-server binary and a GGUF under ComfyUI/models/LLM/gguf/ for any of this to generate anything.

    Where people get burned

    "Task Profile is Missing or Changed." That's the pack telling you the workflow's snapshot no longer matches a local profile with that ID. Reopen the snapshot inspector in the editor - it shows what's actually stored in the workflow, including profiles you've since deleted. Copy it to a new profile if you want it back in the library.

    Assuming a profile makes output consistent. It fixes the input, not the sampler. Temperature, seed and model choice still decide whether two runs agree. If you want repeatability, that's sampling_mode: custom with a fixed seed, plus the profile - not the profile alone.

    Using profiles as a substitute for few-shot examples. A prefix and a suffix can't show the model what a good answer looks like. That's what Append Message and Messages from JSON are for, and the two combine well: profile for the standing rule, history for the demonstration.

    Sharing a workflow and expecting your library to travel. The snapshot travels. The library doesn't come with it. Export JSON if you want to hand someone your instructions as a set.

    CategoryLlamaCpp/Generate

    Inputs (1)

    NameTypeDefaultDescription
    profile_snapshotSTRING{"description":"No prompt transformation.","id":"freeform","name":"Freeform","prompt_prefix":"","prompt_suffix":"","schema_version":1,"system_prompt":""}Portable compact JSON copied explicitly from a local profile. The saved snapshot is authoritative during execution.

    Outputs (1)

    NameTypeDescription
    profileLLAMACPP_PROFILEValidated saved profile snapshot; execution never reloads a mutable local name.