Nodes/arkennemasis Nodes/arkennemasis Spec Library (resolve + cache references)
ComfyUI Node

arkennemasis Spec Library (resolve + cache references)

The reference-image cache that stops a batch from drifting silently

By Hishamahmer·Created 2 months ago·Updated 8 days ago· 9
arkennemasis Spec Library (resolve + cache references)
    • library_json
    • previews
    • report
    • unresolved
    • value_count
    intake_json{}
    library_dirvariation/library
    refreshfalse
    swatch_size512
    timeout_seconds120
    stricttrue

    A variation batch is only as stable as its references. If your run pulls a material reference image from a URL every time, and that URL changes between day one and day thirty, you don't get a warning - you get a batch that drifts silently, and the client's "why does this look different" is how you find out. ArkSpecLibrary is the pipeline's answer: it downloads every reference once, caches it locally, content-hashes it, renders a swatch per hex - and from that moment the run reads only local files. Two runs a month apart against the same library produce the same inputs, guaranteed by hashing rather than hope.

    How it works

    Two required inputs: intake_json (from Variation Intake) and library_dir (default variation/library, resolved inside ComfyUI's output directory). The important guidance in the tooltip: the library is shared across products for one client - don't make it per-run. It accumulates. The source docstring is blunt about why: generation tooling is rentable by anyone, but a validated per-brand material library built over dozens of products is the most defensible asset this pipeline creates, so it lives as a first-class directory, not a temp folder.

    Reference URLs accept http(s)://, file://, or a bare local path. Multi-reference values stay as lists with explicit roles rather than being merged - averaging a flat material swatch with a lit in-situ photo produces a third material matching neither.

    Optional inputs: refresh (re-download even cached references - off is correct almost always; "the cache is the point"), swatch_size (default 512px, the rendered hex swatch size), timeout_seconds (default 120), and strict (default true - an unresolvable reference stops the run, because a missing material is the one thing that must never be guessed).

    Outputs: library_json (the resolved library the whole run reads from), previews (the swatches as an IMAGE, handy for eyeballing on the canvas), report, unresolved (what couldn't be resolved, if anything), and value_count.

    The honest value

    Most of this node is bookkeeping, but the bookkeeping is the product. The guarantee it gives is "a reference that changes upstream cannot silently change a batch" - which is precisely the failure the rest of the pipeline's verification steps exist to catch late and expensively. Download once, hash, freeze. If you've ever debugged a "why did this render change" that turned out to be a URL, this node is the fix you wish you'd had.

    Install

    ArkSpecLibrary is one of the 61 nodes in the comfyui-arkennemasis pack, in arkennemasis/Variation:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Hishamahmer/comfyui-arkennemasis
    pip install -r comfyui-arkennemasis/requirements.txt   # then restart ComfyUI
    

    Or ComfyUI Manager → Install via Git URL with the repo URL. It needs network for the initial reference downloads (and the pack's API credentials if an LLM is involved earlier in the intake), but after caching, the run itself is local. The pipeline's colour module does the real work of rendering hexes into swatches; this node just makes sure the hex is recorded, rendered, and never re-fetched.

    Categoryarkennemasis/Variation

    Inputs (6)

    NameTypeDefaultDescription
    intake_jsonSTRING{}From Variation Intake.
    library_dirSTRINGvariation/libraryWhere cached references live. Relative paths resolve inside ComfyUI's output directory. Shared across products for one client — do not make it per-run.
    refreshoptBOOLEANfalseRe-download references that are already cached. Off is correct almost always: the cache is the point.
    swatch_sizeoptINT51264–2048Pixel size of a rendered hex swatch.
    timeout_secondsoptINT1205–3600
    strictoptBOOLEANtrueOn: an unresolvable reference stops the run. A missing material is the one thing that must never be guessed.

    Outputs (5)

    NameTypeDescription
    library_jsonSTRING
    previewsIMAGE
    reportSTRING
    unresolvedSTRING
    value_countINT