Nodes/arkennemasis Nodes/arkennemasis Story History (never cover the same thing twice)
ComfyUI Node

arkennemasis Story History (never cover the same thing twice)

The memory that stops your daily video covering yesterday's story

By Hishamahmer·Created about a month ago·Updated a day ago· 6
arkennemasis Story History (never cover the same thing twice)
    • covered
    • urls
    • count
    • report
    history_file
    remember40

    A daily news channel that picks the same story every morning isn't a channel, it's a bug. ArkStoryHistory is the part of the arkennemasis avatar pipeline that keeps that from happening: it reads the file of already-covered stories and hands the picker a "do not repeat these" list, so today's choice is actually new.

    The whole trick is a shared history file. ArkStoryHistory reads it at the start of the run; ArkStoryPick checks the model's choice against it; ArkStoryRecord appends to it at the end. Same path on all three, and the pipeline never covers the same thing twice.

    How it works

    The node takes a history_file path and a remember count (default 40). It reads every recorded entry but only shows the most recent remember of them to the picker - the file keeps everything, and the cap exists because an unbounded list would eventually be most of what the model reads in its prompt.

    The output worth understanding is covered: a block of lines in the shape headline<TAB>url, prefixed with "ALREADY COVERED - do NOT pick any of these again, and do not pick a different article about the same development." Note that last clause - it tells the model to avoid the same story from another publisher, not just the same URL. That's why headline gets recorded alongside the URL, not just the URL.

    The genuinely clever bit is the IS_CHANGED method. ComfyUI caches aggressively, and a node that reads a file will happily serve you the same result forever unless something marks it dirty. This node stamps the file's mtime and size, so appending a story at the end of one run invalidates it at the start of the next - otherwise the whole "never repeat" feature would quietly stop working after run one. That's the always-rerun pattern from the ComfyUI plumbing playbook, done right: it re-reads when the file changes and not a moment sooner.

    Outputs: covered (the do-not-repeat block for the picker's prompt), urls (just the URLs, for ArkStoryPick's covered_urls socket), count (total covered), and a report line.

    Installing

    Same pack install as the rest:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hishamahmer/comfyui-arkennemasis
    pip install replicate httpx
    

    Restart ComfyUI. Nothing extra needed here.

    Troubleshooting

    • It repeats anyway: check the history_file path is identical on this node, ArkStoryPick, and ArkStoryRecord. Three nodes, one path - if any of them has a typo or a relative path that resolves differently, the loop is open.
    • Nothing is ever marked covered: ArkStoryRecord is deliberately gated on the finished video existing. A failed render records nothing, by design - that's the "a run that produced nothing covered nothing" rule. If the video saves somewhere else, feed that node the right path.
    • First run: the covered output literally says "ALREADY COVERED: nothing yet. This is the first run against this history file." That's expected, not an error.
    Categoryarkennemasis/Avatar

    Inputs (2)

    NameTypeDefaultDescription
    history_fileSTRINGWhere the covered stories are recorded. The same path goes on ArkStoryPick, which appends to it.
    rememberINT400–1000How many recent stories to show the picker. The file keeps everything; this only limits how much reaches the prompt, because an unbounded list would eventually be most of what the model reads.

    Outputs (4)

    NameTypeDescription
    coveredSTRING
    urlsSTRING
    countINT
    reportSTRING