Nodes/was-node-suite-comfyui/Text Add Token by Input
ComfyUI Node Runs on cloud

Text Add Token by Input

Define your own [token] for filenames, driven by graph inputs

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Text Add Token by Input

      WAS Node Suite has its own token system, used inside Save Text File and Save Image: write [time], [hostname], [cuda_device], or [cuda_name] in a filename pattern, and the suite substitutes the real value at save time. [time(%Y-%m-%d__%I-%M%p)], for example, expands into an actual formatted date. The README shows the built-in set doing exactly this: [hostname]_[time]__[time(%Y-%m-%d__%I-%M%p)] becomes something like SKYNET-MASTER_1680897261__2023-04-07__07-54PM.

      The built-in tokens are fixed and system-derived - time, hostname, CUDA device info. Text Add Token by Input is how you add your own, computed from your own graph: per the README, it defines "a custom token by inputs representing single single line name and value of the token." Where the plain Text Add Tokens node presumably lets you type a static token/value pair by hand, this one takes the value as a node input - meaning it can change every run, driven by whatever's actually happening upstream in your workflow.

      Where this is actually useful

      Anywhere you want a filename or saved text file to carry a piece of information that's computed dynamically rather than fixed - a prompt keyword, a model name, a seed, a step count, anything you can get as a single-line string or number elsewhere in the graph. Register it as a custom token here, then reference it by name in a Save Image or Save Text File filename pattern the same way you'd use [time] or [hostname].

      How it works

      It takes a token name and a value (each expected to be a single line - no newlines) and registers that as a usable token for the rest of the run, consumable anywhere the pack's token substitution applies. The token name can be almost anything except a colon, which is reserved for the token syntax itself, and per the README it can even use simple regular expressions if you need more flexible matching.

      How to install it

      ComfyUI Manager: search "WAS Node Suite," install, restart. Manual:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      then, from inside that folder, install requirements - path/to/ComfyUI/python_embeded/python.exe -s -m pip install -r requirements.txt on portable, pip install -r requirements.txt on system Python. Restart ComfyUI; it's under WAS Suite.

      Common issues & troubleshooting

      If your custom token isn't expanding in the saved filename, the most common cause is a mismatch between the token name you registered here and the name you wrote in the filename pattern - the syntax is exact, and a typo just gets treated as literal text instead of failing loudly. Double-check the token name matches character-for-character, including case.

      Beyond that, this is a lightweight text node with no external dependency of its own, so the general pack risk is what to watch for: WAS Node Suite has had no active development since December 2023, and the recurring failure mode since then is the entire suite going "Import Failed" after a ComfyUI update - usually a shared-dependency version clash rather than anything this node does. If it happens, reinstall requirements using your embedded Python interpreter specifically, not a system one.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs