GPT Text Sampler [π -π ’π €π π £π ]
Same node, now it can look at pictures
- model
- image
- STRING
The current-generation partner to GPT-Loader-Simple [n-suite], and the schema tells you exactly what's new: prompt moved from required to optional, and there's now an image input. That's because this version doesn't just run text-in-text-out GGUF chat models - it's what actually drives joytag and moondream, the vision models the updated loader can fetch automatically, plus any Llava checkpoint you've paired with a projector through Llava Clip Loader [n-suite].
How it works, and the two ways to use it
If you're running a plain GGUF chat model, use it like any local LLM sampler: wire model in from the loader, write your prompt, and leave image disconnected. If you're running joytag or moondream instead, flip the usage around - connect image, and you can skip prompt entirely for joytag, since its whole job is looking at a picture and returning tags, not answering a written question. max_tags (default 50) is specific to that use case - straight from the README, it caps how many tags joytag hands back, and it does nothing when you're not running joytag.
The rest of the sampling controls carry over unchanged from the older GPTSampler: temperature, top_p, top_k, tfs_z for how much variety you get; frequency_penalty, presence_penalty, repeat_penalty to discourage looping; stop_token to end generation early; prefix/suffix (Alpaca-style by default - ### Instruction: / ### Response: ) to wrap the prompt in whatever instruction format the model expects; cached to skip regenerating on an unchanged input.
The output - worth noticing it's different
Unlike the bare GPTSampler, this one's STRING output is a list, not a single string. That matters if something downstream is expecting one plain string and you get a type mismatch - you may need to pick the first item, or handle it as a list explicitly, depending on what you're wiring it into. This is likely there for joytag's use case, where "generate N tags" naturally reads as a list of results rather than one blob of text.
Installing the pack
- ComfyUI Manager - search "ComfyUI-N-Nodes," install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Nuked88/ComfyUI-N-Nodes.git, then restart ComfyUI.
Common issues & troubleshooting
Type mismatch error wiring the output into something expecting a plain string. That's the list-vs-string difference above - this node's output is a list even when there's only one result in it. Check what the receiving node actually expects and adjust accordingly.
joytag output looks truncated or you want more/fewer tags. That's max_tags - bump it up for more, down for fewer. It's the one setting on this node that's specific to that model rather than general LLM sampling.
Text-model output reads like nonsense. Same root cause as the older sampler - check prefix/suffix against your model's actual expected chat template. The Alpaca-style default doesn't suit every GGUF checkpoint, and a mismatched template is the most common reason output looks broken even though nothing "errored."
model came from the bare GPT-Loader-Simple and includes a model_path you don't know what to do with. That output doesn't plug in here - this sampler only takes model. Pair the bare loader with the bare GPTSampler instead, or switch to GPT-Loader-Simple [n-suite] if you want this sampler's vision-model support.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| model | CUSTOM | β | |
| max_tokens | INT | 2048 | β |
| temperature | FLOAT | 0.700.2β1 | β |
| top_p | FLOAT | 0.500.1β1 | β |
| logprobs | INT | 0 | β |
| echo | COMBO | disable | 2 options: enable, disable |
| stop_token | STRING | STOPTOKEN | β |
| frequency_penalty | FLOAT | 0.00 | β |
| presence_penalty | FLOAT | 0.00 | β |
| repeat_penalty | FLOAT | 1.18 | β |
| top_k | INT | 40 | β |
| tfs_z | FLOAT | 1.00 | β |
| print_output | COMBO | disable | 2 options: enable, disable |
| cached | COMBO | NO | 2 options: YES, NO |
| prefix | STRING | ### Instruction: | β |
| suffix | STRING | ### Response: | β |
| max_tags | INT | 50 | β |
| promptopt | STRING | β | |
| imageopt | IMAGE | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |