Nodes/DIGIT Nodes/DIGIT Drift Gate (Paths)
ComfyUI Node

DIGIT Drift Gate (Paths)

The same drift QC gate, but pointed straight at files on disk

By thedepartmentofexternalservices·Created 7 months ago·Updated 2 months ago· 0
DIGIT Drift Gate (Paths)
    • passed
    • confidence
    • drift_report
    • qc_json
    • qc_filepath
    • gated_image
    • qc_sheet
    • diff_heatmap
    • edge_diff
    • reference_aligned
    • generated_aligned
    ◄resize_modefit_reference►
    ◄fit_methodstretch►
    ◄compare_width0►
    ◄compare_height0►
    ◄grid_size6►
    ◄detail_weight0.65►
    ◄confidence_threshold75.0►
    ◄diff_threshold30►
    ◄reject_modepassthrough►
    ◄save_qcfalse►
    ◄qc_output_dir►
    ◄qc_filename►
    ◄show_qc_previewtrue►
    ◄reference_path►
    ◄generated_path►

    DIGIT Drift Gate (Paths) is the file-based twin of the Drift Gate node. Where the original takes reference and generated as IMAGE tensors from your graph, this one takes two absolute file paths - reference_path and generated_path - and loads the images itself. Same comparison math, same outputs, zero tensor plumbing.

    Why does that variant exist? Because in a production pipeline the reference plates live on disk, not in a graph. Think render farms, automated review loops, or a script that drops a fresh render into a folder and expects the gate to judge it against a locked plate. If your workflow is already file-based - render lands in shots/dev_0010/, reference sits next to it - this node skips the "load it, wire it, convert it" dance entirely.

    How it works

    Under the hood it's the exact same engine as the tensor version: resize-align, pixel SSIM + edge SSIM scoring with detail_weight, grid-based hotspot detection, and a pass/fail decision against confidence_threshold. All the same tuning knobs are here - resize_mode, fit_method, compare_width/compare_height, grid_size, diff_threshold, reject_mode, and the save_qc/qc_output_dir/qc_filename trio for writing the burn-in QC sheet and JSON sidecar.

    The one difference in setup: the two paths are required inputs, and qc_filename (when you save QC) auto-derives a base name from generated_path if you leave it empty - output is always <name>_qc.png/.json. That's a nice touch for keeping QC artifacts tied to the file they judged.

    Outputs are identical to the tensor gate: passed, confidence, drift_report, qc_json, qc_filepath, gated_image, qc_sheet, diff_heatmap, edge_diff, reference_aligned, and generated_aligned. So you can build the same rejection logic and the same interactive review (wired into DIGIT Drift QC Preview) whether the image arrived as a tensor or a path.

    Installing it

    Standard pack install:

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

    Or ComfyUI Manager → search comfyui-digit → install → restart. Local-only, no API keys.

    Which version to pick

    Honestly, it comes down to where your images are. If they're already outputs in a ComfyUI graph (a freshly generated render right off a node), use the tensor gate. If they're files - a reference plate on disk, or renders being dropped into a watch folder - the paths version removes a whole step. The path-based gate is also the one you'd script against: you can drive it purely by changing which files it points at, no graph rewiring. And because it produces the same QC artifacts, your downstream record-keeping doesn't care which one produced them.

    CategoryDIGIT

    Inputs (15)

    NameTypeDefaultDescription
    resize_modeCOMBOfit_reference4 options: fit_reference, fit_generated, fit_largest, custom
    fit_methodCOMBOstretch3 options: stretch, letterbox, crop_center
    compare_widthINT00–16384Used when resize_mode is custom. 0 = ignored.
    compare_heightINT00–16384Used when resize_mode is custom. 0 = ignored.
    grid_sizeINT62–24Grid resolution for hotspot drift report.
    detail_weightFLOAT0.650–1How much edge/detail SSIM affects confidence (badge/logo sensitivity).
    confidence_thresholdFLOAT75.00–100Pass when confidence >= threshold.
    diff_thresholdINT301–255Pixel delta treated as visible drift.
    reject_modeCOMBOpassthroughblackout = gated_image goes black on reject. passthrough = gated_image always forwards generated. Use the passed output for branching.
    save_qcBOOLEANfalseWrite burn-in QC PNG + JSON sidecar to qc_output_dir.
    qc_output_dirSTRINGFolder for QC artifacts. Example: .../shots/dev_0010/qc
    qc_filenameSTRINGOptional base name (no extension, no _qc). Auto-derived from generated_path. Output is always <name>_qc.png/.json.
    show_qc_previewBOOLEANtrueShow the burn-in QC sheet in ComfyUI's preview panel after run.
    reference_pathSTRINGAbsolute path to reference / plate image.
    generated_pathSTRINGAbsolute path to generated image.

    Outputs (11)

    NameTypeDescription
    passedBOOLEAN—
    confidenceFLOAT—
    drift_reportSTRING—
    qc_jsonSTRING—
    qc_filepathSTRING—
    gated_imageIMAGE—
    qc_sheetIMAGE—
    diff_heatmapIMAGE—
    edge_diffIMAGE—
    reference_alignedIMAGE—
    generated_alignedIMAGE—