APNext Custom Prompts
Load system-prompt templates for the LLM nodes
- STRING
This is the quiet glue node that makes the rest of dagthomas's LLM tooling reusable. It's a single dropdown of the .txt prompt templates that ship in the pack's data/custom_prompts/ folder - 43 of them - and it outputs the chosen template as a string. On its own it does nothing visible. Its whole job is to feed a battle-tested system prompt into the custom_prompt slot of the Gemini, GPT and Claude vision/text nodes so you're not re-typing a 200-word instruction every time.
If you've read the KB's take on LLM-assisted prompting, this is the practical shape of it: the community has largely moved from "paste your image into a chat tab" to "run a prompt-writing node inside ComfyUI," and a template loader is what turns a one-off instruction into a repeatable part of the graph. The included templates aren't filler either - they encode real, model-specific prompt shapes.
How it works
Pure Python, no model, no API key. You pick a filename from the prompt_file dropdown and it reads that file out of data/custom_prompts/ and returns its contents as a STRING. That's it. You then wire the string into a downstream LLM node's custom-prompt input. Many of these templates contain the pack's dynamic-substitution tokens - ##TAG##, ##SEX##, ##PRONOUNS##, ##WORDS## - which get filled in by the vision/text node when you enable its dynamic_prompt toggle.
The inputs and outputs that matter
prompt_file- the dropdown of 43 templates. The ones worth knowing:t5xxl_w_text.txtandt5xxl.txt(prompts shaped for Flux's T5 encoder),image_analyze_w_text.txt(general image description),gemini_ohwx.txt/gemini_2_5_pro_ohwx.txt(LoRA-trigger-aware captioning forohwx-style training),qwen_next_scene_simple.txtandqwen_next_scene_video.txt(scene-transition prompts), and thezimage_vision_*set for Z-Image chat-format output.
The single output is STRING - the raw template text, into an LLM node's custom_prompt.
How to install it
ComfyUI Manager: search comfyui_dagthomas, install, restart. Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas && pip install -r requirements.txt
then restart. The requirements.txt pulls the full pack stack (openai, anthropic, google-generativeai, transformers, decord, scipy). This loader itself needs none of it, but the LLM nodes you'll pair it with do - so it's worth getting the whole install to go through. decord is the usual build failure; the loader loads regardless.
Where people get burned
- It doesn't call anything. The loader only emits text. If you wire its output into a Save Text node you'll just see the template; the actual generation happens in the Gemini/GPT/Claude node you feed it into.
- Roll your own. The best use is adding your own
.txtfile todata/custom_prompts/- a house style, a captioning format you like - and it shows up in the dropdown after a restart. That's the intended workflow, and it's how you stop fighting the built-in templates. - Match the template to the model. A
t5xxltemplate is written for Flux's encoder; azimage_visionone emits Z-Image chat tokens. Feeding a Z-Image template into an SDXL workflow gives you garbage in the CLIP box. Pick the template for the model you're actually prompting. - Dynamic tokens need the toggle.
##TAG##and friends only get substituted if the downstream node'sdynamic_promptis on; otherwise they pass through literally.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_file | COMBO | 43 options: qwen_next_scene_video.txt, zimage_vision_analysis.txt, qwen_next_scene_simple.txt, zimage_vision_merger.txt, gemini_2_5_pro_ohwx.txt, image_analyze_w_text.txt, +37 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |