TS Image Prompt Injector
Get an LLM's prompt into the sampler without rewiring anything
- image
- image
So you've wired an LLM node into your workflow to write prompts dynamically, and now you're staring at the problem everyone hits: the model writes a string, but the CLIPTextEncode feeding your sampler is still showing the hardcoded text you typed last week. TS Image Prompt Injector exists to close that gap at runtime - it writes the string into the actual text encoder that's connected to the sampler, without you hand-rewiring anything.
The name is a small lie, and it's worth knowing up front: it doesn't touch the image at all. The image input is passed through bit-for-bit unchanged. What the node edits is the workflow graph's saved metadata - the invisible prompt graph ComfyUI keeps for the run - so the prompt you injected lands in the positive CLIPTextEncode's text widget just before it executes.
How it works
Under the hood it's clever graph surgery, not image processing. The node gets ComfyUI's hidden prompt (the workflow definition) and does three things:
- Finds the samplers in the graph and walks backward from their
positiveinputs to discover the text encoder nodes feeding them. - Skips anything whose title or path smells like a negative prompt, so your injected text goes only where it belongs.
- Writes your string into any text input that's empty or unlinked.
If it can't find positive encoders, it falls back to writing into all text-encoder nodes that aren't marked negative. The image tensor is returned unchanged either way.
That means the "injector" is really "the thing that makes dynamically generated prompts behave like they were typed in". If your LLM output is already wired through a text-node adapter into the encoder, you don't need this - but most people's LLM graphs aren't, because splicing a string into a CLIPTextEncode's widget is exactly the fiddly bit nobody wants to build by hand.
Inputs and outputs
- image - required, passed through unchanged. The node needs a tensor to sit in the graph, and this is it.
- prompt - the string to write into the positive text encoders. Multiline, so a full paragraph is fine.
Output: image, identical to what came in.
Installation
This is one of the 73 nodes in the comfyui-timesaver pack. ComfyUI Manager: search "Timesaver", install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/AlexYez/comfyui-timesaver
cd comfyui-timesaver
python -m pip install -r requirements.txt
Restart after installing. It lives under TS/Image/Batch in the node menu.
When it's the right tool
The intended workflow: an LLM or prompt-builder node upstream writes a prompt → this node sits on an image path (it must be in the graph for the run) → the sampler downstream picks up the injected text. It shines when you're chaining prompt generation to image generation and you want the next sampler to use the result without manually copying text between nodes.
One honest caveat: because it edits graph metadata rather than holding a prompt in its own wire, it works best when the text encoder it's targeting has an empty or unlinked text input - if the encoder already has a hardcoded prompt wired to a text widget with content, there's nothing for it to replace. Set up the encoder with the text input left blank and let the injector fill it, and the whole chain behaves.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image passed through unchanged; only its saved workflow metadata is edited. | |
| prompt | STRING | Text written into the positive text-encoder nodes of the saved workflow metadata. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The input image, passed through unchanged. |