Nodes/ComfyUI_EmAySee_CustomNodes/EmAySee Image Logger V1
ComfyUI Node

EmAySee Image Logger V1

A run log that appends itself — prompt, filename, and state, every generation

By EmAySee·Created about a year ago·Updated 4 months ago· 2
EmAySee Image Logger V1
    • log_entry
    log_directoryuser/default/emaysee_logs
    log_filenameproduction_log.txt
    history_text
    current_prompt
    generated_name

    If you run automated generations - a batch loop, a queue, something unattended - you eventually need a record of what got made and with what. That's what this node is for: it takes the current prompt, the generated filename, and any state/history text you want to preserve, and appends a formatted entry to a log file on disk. Every run adds one block. It's a lightweight audit trail that survives restarts, because it's just text on disk, and it's designed for the pack's automated workflows.

    How it works

    The node's name says "Image Logger" but it's really a run logger that records what happened around an image. On execution it joins the ComfyUI root with log_directory, creates that directory if missing, and appends an entry to {log_directory}/{log_filename} with this shape:

    --- NEW ENTRY ---
    FILE: <generated_name>
    PROMPT: <current_prompt>
    STATE HISTORY:
    <history_text>
    

    It uses append mode with UTF-8 encoding, so nothing is ever overwritten - the file grows run by run, and you get a chronological log you can grep. The log_entry output returns the exact text that was written, which makes it easy to route into other nodes or verify the entry after the fact. It's an output node (the OUTPUT_NODE = True flag), so it doesn't need to connect onward to run.

    Inputs and outputs

    • log_directory (STRING, default user/default/emaysee_logs) - relative to the ComfyUI root, so ComfyUI/user/default/emaysee_logs on disk. Change it to whatever you want.
    • log_filename (STRING, default production_log.txt)
    • history_text (STRING, forced input) - the state/history block to record.
    • current_prompt (STRING, forced input) - the prompt that produced the image.
    • generated_name (STRING, forced input) - the output filename.

    Output: log_entry (STRING) - the formatted entry that was appended.

    Where it fits

    Wire it into a Save Image workflow: generated_name from your filename builder, current_prompt from the positive prompt, history_text from EmAySee_GlobalStringReader or any state text. Long batches become self-documenting - you can answer "what did I generate at 3 a.m., and with what prompt and state?" by reading one file. It complements the file-based state system (GlobalString nodes) naturally: state out of the reader, straight into the log.

    Install

    Part of ComfyUI_EmAySee_CustomNodes. ComfyUI Manager → search "EmAySee" → install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
    

    No dependencies, no models - pure file I/O. Restart and you'll see the pack's "SPECTRE v5.0" banner.

    Gotchas

    The log file grows without bound, so a long unattended run produces a big file - rotate by changing log_filename periodically or prune it. log_directory is relative to the ComfyUI root, so "user/default/..." maps under your ComfyUI install, not the system user - that trips people up when they go looking for the file. And the defaults are clearly the author's own (production_log.txt), so pick names that mean something to you before you build a workflow around it.

    CategoryEmAySee_Automation/Logging

    Inputs (5)

    NameTypeDefaultDescription
    log_directorySTRINGuser/default/emaysee_logs
    log_filenameSTRINGproduction_log.txt
    history_textSTRING
    current_promptSTRING
    generated_nameSTRING

    Outputs (1)

    NameTypeDescription
    log_entrySTRING