Nodes/import-to-hydrus/Hydrus Image Exporter
ComfyUI Node

Hydrus Image Exporter

Pull a generation out of Hydrus, model and all

By dsxsh·Created 2 years ago·Updated 7 months ago· 0
Hydrus Image Exporter
    • image
    • model
    • clip
    • vae
    • positive
    • negative
    • modelname
    • seed
    • loras
    images
    tag
    hash
    usetagfalse
    usehashfalse

    Most "load my old generation" tools hand you a picture. This one hands you the whole stack: the image, the checkpoint as a MODEL, CLIP and VAE, plus the positive prompt, negative, seed, checkpoint name, and LoRAs - each as its own output. If you've been archiving generations into Hydrus with full metadata, Hydrus-Image-Exporter is how you pull one back out months later and actually do something with it: re-run it, remix it, fix a prompt, tweak a seed.

    It's the reverse of the pack's importer. The importer saves what you make; the exporter reaches into your Hydrus library, grabs a file, reads the tags the importer wrote, and rebuilds a usable generation in your graph. Same pack (ryphon/import-to-hydrus), same install, same one-way trip back and forth.

    How it works

    The node finds a file three ways, chosen by its two boolean toggles:

    • usetag + tag - search every file in Hydrus carrying that tag, fetch the matches
    • usehash + hash - fetch one file by its SHA-256
    • neither - pick a file from ComfyUI's input/ directory; the node hashes it locally and fetches that hash from Hydrus

    Then it reads the file's tags and looks for the namespaced metadata the importer writes: modelname:, positive:, negative:, seed:, lora:. Those become your text outputs. It builds a checkpoint path from the modelname tag (append .safetensors) and loads it from your local models/checkpoints folder using ComfyUI's own loader. That's the clever part and the gotcha: the node can only rebuild a generation whose checkpoint still exists on your machine. Deleted the model? The node errors out. You're not remixing that one without re-downloading.

    Inputs and outputs that matter

    All inputs are optional - the toggles are the ones you'll actually touch:

    • usetag / usehash - flip exactly one on to choose fetch mode
    • tag / hash - the search term or file hash for those modes
    • images - a dropdown of files already sitting in your input/ directory (the "neither toggle" mode)

    The outputs are where this node shines: image (IMAGE), model, clip, vae, and the strings positive, negative, modelname, seed, loras. Wire model/clip/vae into a KSampler chain exactly like a checkpoint loader, and the string outputs into your text encoders. If you just want the picture, take image and ignore the rest - but the rest is the point.

    Two honest warnings

    First, tag mode is a bit of a lie: the code collects every match but only returns the first one's outputs. Fine for "process these one at a time" upscale queues (the repo's submit.py feeds hashes in one by one), misleading if you expect the node to batch. Second, the metadata parse assumes the importer wrote those namespaced tags. Files you tagged manually with plain cat, landscape tags will hit a parse error, not produce prompt outputs. This node is a round-trip companion, not a general Hydrus browser.

    Install is the shared pack install - ComfyUI Manager, search import-to-hydrus:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ryphon/import-to-hydrus
    

    restart, and set HYDRUS_KEY / HYDRUS_URL (or drop a hydrus_api.txt in the pack folder). Dependencies are hydrus-api, Pillow, and numpy - no model downloads, the models it loads are the checkpoints you already have. The README flags the whole pack as a work in progress with no guarantees, and this node in particular is the rough edge of the set - expect the round-trip to work best when everything came from the pack's own importer.

    Categoryimage

    Inputs (5)

    NameTypeDefaultDescription
    imagesoptCOMBO1 options: example.png
    tagoptSTRING
    hashoptSTRING
    usetagoptBOOLEANfalse
    usehashoptBOOLEANfalse

    Outputs (9)

    NameTypeDescription
    imageIMAGE
    modelMODEL
    clipCLIP
    vaeVAE
    positiveSTRING
    negativeSTRING
    modelnameSTRING
    seedSTRING
    lorasSTRING