Nodes/ComfyUI HiTem3D Integration/๐Ÿ”„ Dynamic Value Generator
ComfyUI Node

๐Ÿ”„ Dynamic Value Generator

A timestamp, counter, or UUID on demand โ€” the refresh trigger that keeps previews honest

By GeekatplayStudioยทCreated 10 months agoยทUpdated 8 months agoยท 22
๐Ÿ”„ Dynamic Value Generator
    • dynamic_value
    โ—„value_typetimestampโ–บ
    โ—„custom_prefixโ–บ
    โ—„counter_start1โ–บ
    โ—„format_string%Y%m%d_%H%M%Sโ–บ

    This node does one tiny thing: it generates a string that changes every time the workflow runs. A timestamp, an incrementing counter, a short UUID, a random number, or a custom value. It's the kind of "utility" node that looks pointless until you understand why it exists - it's the refresh trigger for the pack's HTML Previewer.

    Remember that ComfyUI only re-runs a node when its inputs actually change. If your preview page is built from static content, the HTML Previewer has no reason to rebuild it - the URL stays the same, so the panel shows stale results. But if you append a changing value to that URL via auto_refresh_token, the preview reloads on every queue. That's precisely what the Dynamic Value Generator produces.

    How it works

    Pick a value_type and it hands back a dynamic_value string:

    • timestamp - current date/time formatted with format_string (default %Y%m%d_%H%M%S, standard strftime). The workhorse choice for refresh tokens; every run differs.
    • counter - increments by one each run, starting from counter_start (default 1). Also changes every run, and it reads nicely if you're logging "generation #7".
    • uuid - an 8-character slice of a UUID. Unique every time, no state involved.
    • random - a random number between 1000 and 9999.
    • custom - a unix timestamp, useful when you want a big stable-ish number.

    custom_prefix (optional) prepends any text - handy for making tokens readable, e.g. job_20260816_114523.

    How you'd actually use it

    The intended loop is dead simple:

    DynamicValueGenerator โ†’ dynamic_value โ†’ HTMLPreviewer.auto_refresh_token
    

    Feed the output into the HTML Previewer's refresh-token input and your preview panel updates every run, no manual reloading. You can also drop it into a Text Template node ({{value1}} and friends) to stamp generated content with a timestamp, or use it to build unique filenames and IDs elsewhere in the graph. The pack's html_previewer_workflow.json and hitem3d_history_workflow.json examples show it wired up.

    Installing

    Same pack as everything else - ComfyUI Manager (search "ComfyUI HiTem3D Integration") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GeekatplayStudio/comfyui-hitem3d
    cd comfyui-hitem3d
    pip install -r requirements.txt
    

    Restart ComfyUI. Nothing to download, no API keys needed - this node is pure local utility and works even if you never configure a HiTem3D account.

    Where people get burned

    • "My preview never refreshes." If the token isn't actually changing, the preview won't either. Make sure you're feeding this node's output into auto_refresh_token, and that value_type isn't set to something static.
    • Counter quirks. The counter lives on the node instance for the session, so it resets when ComfyUI restarts - and it behaves a little differently on first run versus later ones. For a pure "always changes" token, timestamp or uuid is more predictable.
    • It's a string. Everything it outputs is text. That's the feature, but it's worth remembering when you wire it somewhere expecting a number.

    It's a four-line tool doing a four-line job - but as the heartbeat for auto-refreshing previews, it's the difference between a dashboard that updates itself and a stale tab you have to babysit.

    CategoryHiTem3D/Utils

    Inputs (4)

    NameTypeDefaultDescription
    value_typeCOMBOtimestamp5 options: timestamp, counter, uuid, random, custom
    custom_prefixoptSTRINGโ€”
    counter_startoptINT10โ€“999999โ€”
    format_stringoptSTRING%Y%m%d_%H%M%Sโ€”

    Outputs (1)

    NameTypeDescription
    dynamic_valueSTRINGโ€”