🦙 Ollama Kontext Prompt Generator
Turn a sentence into a usable edit instruction
- generated_prompt
OllamaKontextPromptGenerator (🦙 Ollama Kontext Prompt Generator) is the "no cloud, no API key" way to get an AI-written editing instruction out of this pack. You type what you want changed, it sends that to your local Ollama, and hands you back a clean one-sentence English edit instruction ready to feed an editing model. The name is a slight lie - it doesn't call any external API and needs no key; everything runs on your own machine.
Where it sits in a workflow: the pack's whole idea is annotations → instructions → edit. Super Canvas gives you the annotations, this node (or its siblings) writes the instructions, and whatever you're driving - Flux Kontext, an inpainting pass, a LoRA edit - consumes them. If you already run Ollama, this is the cheapest path into that loop, both financially and in setup.
How it works
The node builds a guidance prompt from your inputs: it picks from 16 editing intents (color change, object removal, face swap, style transfer, and so on) and 16 application scenarios (e-commerce, portrait, real estate…), combines those with your free-text description, and POSTs the whole thing to Ollama's /api/generate endpoint - by default at http://127.0.0.1:11434. The system prompt tells the model to output only an English instruction starting with an action verb. The model list is fetched live from Ollama's /api/tags, so whatever you've pulled shows up in the dropdown (if Ollama is unreachable it falls back to a default list: deepseek-r1:1.5b, qwen3:4b, qwen3:8b).
One nice touch: it cleans the response. DeepSeek-R1 models love to emit <think> reasoning blocks, and this node strips those before returning the actual instruction. If Ollama is down or returns garbage, it falls back to a canned template so your workflow doesn't hard-fail.
Inputs and outputs that matter
description- what you want done. The default is Chinese ("change the selected area to red"), so overwrite it with your own text; English works fine.editing_intentandapplication_scenario- the two enums that shape the guidance template. "None" is an option if you just want to free-type.ollama_model- which local model to use. The small defaults are fast but weak; a 7B+ model gives noticeably better instructions.temperature(0–2, default 0.7) andseed(default 42) - standard sampling knobs.ollama_url(optional) - point it at a remote Ollama if yours isn't on the default port.
Output: a single generated_prompt (STRING). Wire it into the text input of your editing model, or into KontextSuperPrompt if you're building the full pipeline.
Installing it
Install the pack (ComfyUI Manager → search "Kontext Super Prompt", or git clone https://github.com/aiaiaikkk/super-prompt-canvas into custom_nodes/), restart, then install Ollama separately:
# from https://ollama.com
ollama pull deepseek-r1:1.5b # or qwen3:8b if your RAM allows
ollama serve
Ollama is not bundled - the node only talks to it.
Where people get burned
Two things. First, the small default models produce instructions that are grammatical but shallow; if your edits are complex, pull a bigger Qwen. Second, the model dropdown only populates after Ollama is actually running - check the service first (OllamaServiceManager in this pack does that for you), then open the node. And the defaults are in Chinese, which surprises people who never expected a bilingual UI. None of it blocks you: just type over it.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| description | STRING | 将选定区域的颜色改为红色 | — |
| editing_intent | COMBO | 无 | 17 options: 无, 颜色修改, 物体移除, 物体替换, 物体添加, 背景更换, +11 |
| application_scenario | COMBO | 无 | 17 options: 无, 电商产品, 社交媒体, 营销活动, 人像摄影, 生活方式, +11 |
| ollama_model | COMBO | deepseek-r1:1.5b | 3 options: deepseek-r1:1.5b, qwen3:4b, qwen3:8b |
| temperature | FLOAT | 0.70–2 | — |
| seed | INT | 420–1000000 | — |
| custom_guidanceopt | STRING | — | |
| ollama_urlopt | STRING | http://127.0.0.1:11434 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| generated_prompt | STRING | — |