Nodes/ComfyUI Impact Pack/Detailer Advanced Options Hook
ComfyUI Node Runs on cloud

Detailer Advanced Options Hook

Tiled VAE, Per-Cycle Images and Upscaled Crops — Without Rewiring the Detailer

By ltdrdata·Created 4 years ago·Updated about 15 hours ago· 3,396
Detailer Advanced Options Hook
    • DETAILER_HOOK
    ◄return_by_cycle_stepfalse►
    ◄vae_encode_modeinherit►
    ◄vae_decode_modeinherit►
    ◄vae_tile_size512►
    ◄vae_tile_overlap64►
    ◄return_upscaled_cropsfalse►

    Impact Pack's detailer nodes have a lot of widgets, and yet some of the settings you actually want aren't on them. There's no tiled-VAE tile size on FaceDetailer. There's no "give me every intermediate cycle image" switch. And the crops it hands you come back at crop size, not at the size it sampled them at, which is annoying when you're inspecting a detail pass. Detailer Advanced Options Hook is the pack's answer: a hook you plug into the existing detailer_hook socket that supplies exactly those settings, leaving the node itself untouched.

    Why it's a hook at all

    Impact Pack's hook system is a row of optional callbacks the detailer fires as it works - before decode, after upscale, after encode, at each cycle, on each crop region. Most hook providers do something active in those callbacks; noise injection, unsampling, filtering, corner rounding. This one is different: it's a carrier. It holds a small package of typed options and hands them over when the detailer asks. Nothing in your graph changes except one wire.

    It's also deliberately neutral when hooks get combined. There's a rule in the pack about which hooked behaviour counts as "processing a segment" - the Lama Remover hook, for instance, only skips sampling if every processing hook agrees. Advanced-options hooks are excluded from that decision, so adding this node can't quietly change whether other hooks run.

    The settings it carries

    Six inputs, and each maps to something you'd otherwise have to work around:

    • return_by_cycle_step - off by default. Turn it on and the detailer returns a full image per cycle, ordered by input image then cycle. This is for image detailers only, not AnimateDiff. It's the fastest way to watch what an iterative detail pass is actually doing instead of guessing from the final composite.
    • vae_encode_mode / vae_decode_mode - combos with inherit, disabled, tiled. inherit leaves it to the detailer's own switch; disabled forces explicit tiling off; tiled forces tiled encode/decode at the tile size below. The encode mode also applies to inpaint conditioning, which is the bit people forget - tiling the decode but not the encode still spikes on the encode side. Normal (untiled) decode keeps its tiled fallback on failure, so the safety net is intact either way.
    • vae_tile_size - INT, default 512, 64 to 4096 in steps of 64. This is the whole reason to use this node on a big-crop workflow: memory follows the tile, not the crop. If a 1536-pixel detail crop is killing your VRAM, a 512 tile gives you the same output with a fraction of the peak.
    • vae_tile_overlap - default 64, capped at a quarter of the selected tile size. Overlap is what hides tile seams. Zero overlap is allowed and will show seams on anything with gradients; leave it at 64 unless you're chasing memory.
    • return_upscaled_crops - off by default. On, the cropped and cropped_refined outputs come back at the size the detailer sampled at instead of crop size. Great for making contact sheets of what your detailer did, or for feeding refined patches into a tiling/compositing step of your own.

    One trap in the plumbing: the tile size and overlap are only passed along if at least one of the two modes is set to tiled. Leave both on inherit and your carefully typed 256 tile does nothing at all, because the detailer's own switch is in charge. If you set a tile, set a mode to tiled with it.

    Inputs and outputs

    Nothing to connect into it. One output: DETAILER_HOOK, into FaceDetailer, Detailer (SEGS), DetailerDebug (SEGS), SEGSDetailer, or a detector's detailer_hook where relevant.

    Combining with another hook goes through DetailerHookCombine - this node is the textbook case for it, since it's the hook you add on top of the one doing the actual work.

    Install

    Ships with Impact Pack, under ImpactPack/Detailer.

    cd ComfyUI/custom_nodes
    git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
    cd ComfyUI-Impact-Pack
    pip install -r requirements.txt
    

    Windows portable: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt, then restart. Manager users search ComfyUI Impact Pack. First launch generates impact-pack.ini and downloads the default SAM checkpoint into models/sams unless you place an empty file named skip_download_model in custom_nodes. If you changed gpu_gaussian_blur or sam_editor_model in that ini, remember it only takes effect after a restart.

    Diagnosis notes

    If tiled encode is on and your output has faint grid seams, that's overlap, not the model - raise vae_tile_overlap toward a quarter of the tile and they vanish. If performance collapses, check you didn't set a tiny tile size with a big overlap; a 64-pixel tile with 16 pixels of overlap is mostly overhead.

    And if you turned on return_by_cycle_step with an AnimateDiff detailer and got nothing new, that's expected - it applies to image detailers, per the node's own tooltip.

    CategoryImpactPack/Detailer

    Inputs (6)

    NameTypeDefaultDescription
    return_by_cycle_stepBOOLEANfalseReturn a full image for each cycle, ordered by input image then cycle. Applies to image Detailers, not AnimateDiff.
    vae_encode_modeCOMBOinheritInherit the Detailer switch, disable explicit tiling, or use the specified tile. Also applies to inpaint conditioning.
    vae_decode_modeCOMBOinheritInherit the Detailer switch, disable explicit tiling, or use the specified tile. Normal decode retains its tiled fallback on failure.
    vae_tile_sizeINT51264–4096Tile size in pixels for tiled encode/decode. Memory follows the tile, not the crop, so use the largest your device holds.
    vae_tile_overlapINT640–4096Overlap in pixels; capped at one quarter of the selected tile. Zero means no overlap.
    return_upscaled_cropsBOOLEANfalseReturn cropped and cropped_refined at the size the Detailer samples at instead of the crop size.

    Outputs (1)

    NameTypeDescription
    DETAILER_HOOKDETAILER_HOOK—