Nodes/ComfyUI-SplatKit/Prepare Repair Batch
ComfyUI Node

Prepare Repair Batch

Feed a Qwen repair graph one genuinely damaged cube face at a time

By mickmumpitz·Created about a month ago·Updated about 19 hours ago· 17
Prepare Repair Batch
    • damaged
    • reference
    • frame_name
    • job
    • remaining
    • report
    dataset_dir
    selection_methodrank_by_damage
    max_frames200
    every_nth8
    skip_featurelesstrue
    featureless_threshold8.0
    use_pose_matched_referencetrue
    auto_continuetrue

    Some cube faces in a SphereSfM dataset are always going to be stretched - the ones at the edge of a big fly-through, where the pano is being pulled hardest. Repairing them is a targeted job for an image-editing model (Qwen-Image-Edit is the one the pack's workflows use), but feeding a repair graph every face wastes it on sky and floor. Prepare Repair Batch is the node that chooses which faces need repairing and emits each one next to a pristine reference, so the repair model has something to aim at.

    The default selection_method is rank_by_damage, and it's smarter than it looks: it ranks faces by how soft they are relative to their own pristine reference. That handles sky and floor for free - a sky face is flat in both frame and reference, so it isn't "damaged," unlike ranking by absolute sharpness, which would pick every sky face. The other methods are every_nth (content-blind, cheap) and furthest (faces whose camera is furthest from the viewpoint - displacement as a physical proxy for reprojection damage). skip_featureless (default on) drops true sky/blank-floor directions judged from the reference, and featureless_threshold (Laplacian variance, default 8) is the cutoff for that.

    How it works

    The reference output is the part that matters for quality. With use_pose_matched_reference on (default), image 2 is the pristine frame-0 face whose optical axis best matches this one - the correct reference from the COLMAP poses. Off, it reuses the damaged frame as its own reference (no pose match), which is lower quality and only for when poses are unavailable. auto_continue (default on) auto-queues the next frame after each finishes, so one Queue press does the whole set - turn it off to advance one frame per press instead.

    Outputs: damaged (the IMAGE to repair), reference (what it should look like), frame_name, job, remaining, and report. It's is_output_node: false, so wire damaged + reference into your Qwen repair graph, and send the result to WriteBackRepairedFrame (same pack) to write it back into the dataset under the original filename. RepairMetrics (same pack) is the honest way to check the repair didn't just repaint the geometry.

    Install & gotchas

    cd ComfyUI/custom_nodes
    git clone https://github.com/mickmumpitz/ComfyUI-SplatKit
    python_embeded\python.exe -m pip install -r ComfyUI-SplatKit/requirements.txt
    

    Restart; no model downloads here - the Qwen checkpoint is yours. The node needs a dataset with images/ and sparse/0/ (it reads poses for the reference matching). If you're wondering whether a repair pass is even helping, run RepairMetrics on the before/after pair; a big sharpness gain with big drift means the model repainted geometry rather than deblurring, which for a splat is usually a regression. The pack's frame-repair stage is genuinely optional - it's the polish pass after the HiRes work, not part of the base pipeline.

    CategorySplatKit

    Inputs (8)

    NameTypeDefaultDescription
    dataset_dirSTRINGThe dataset to repair -- wire Dataset Project -> dataset_dir, or type the folder path / bare name under ComfyUI/output. Needs images/ and sparse/0/.
    selection_methodoptCOMBOrank_by_damageHow to choose which faces to repair. rank_by_damage is the recommended default: it repairs only genuinely stretched faces and skips sky/floor automatically.
    max_framesoptINT2000–100000How many faces to repair (rank_by_damage / furthest). 0 = every eligible face. Ignored by every_nth.
    every_nthoptINT81–10000every_nth method only: keep every Nth eligible face.
    skip_featurelessoptBOOLEANtrueSkip sky / blank-floor faces so a repair is never spent on them. Judged from each face's pristine REFERENCE (a flat reference = a sky direction), so a badly smeared wall is kept while true sky is dropped. Applies to every method.
    featureless_thresholdoptFLOAT8.00–1000Laplacian-variance below which the REFERENCE counts as featureless (measured at <=1024px). Raise it to skip more flat directions.
    use_pose_matched_referenceoptBOOLEANtrueON (recommended): image 2 is the pristine frame-0 face whose optical axis best matches this one -- the correct reference. OFF: reuse the damaged frame as its own reference (no COLMAP axis match); lower quality, use only if poses are unavailable.
    auto_continueoptBOOLEANtrueAuto-queue the next frame after each one finishes, until all selected frames are repaired -- so one Queue press does the whole set (no batch-count needed). Needs the web UI open. Turn OFF to advance one frame per Queue press instead.

    Outputs (6)

    NameTypeDescription
    damagedIMAGE
    referenceIMAGE
    frame_nameSTRING
    jobSTRING
    remainingINT
    reportSTRING