v0.52.0 — Smart Detailer + no-pack-deps cleanup
v0.52.0 — Smart Detailer + no-pack-deps cleanup
What's new
🔬 GrimmRibbity Smart Detailer (new node)
Self-contained one-node face/eyes/hands/skin detailer. Replaces the 3-node Impact-Pack FaceDetailer chain with target toggles, in-node YOLO loading by filename, optional SAM mask refinement, and ComfyUI's built-in sampler. Zero ComfyUI custom-node deps — uses ultralytics + sam2 / segment_anything from PyPI directly.
Six rounds of perf optimisation:
- Round 1 — SAM
set_imagehoisted to per-target, conditional tiled VAE decode (full for ≤1024px, tiled above), ProgressBar across all bboxes, single image-to-uint8 conversion shared YOLO+SAM+preview, empty-detection fast path. - Round 2 — module-level CLIP encode LRU (survives across calls), edge-aware feathering (no rect seam at image borders),
mask_strengthwidget, optionaltiled_encode, hot-path imports hoisted,same_seed_per_targettoggle. - Round 3 — YOLO
model.fuse()(Conv+BN, 10–20% inference speedup), explicit GPU pin, per-pass wall-time logging. - Round 4 — SAM2 batched-prompt predict (one forward instead of N for crowd scenes), lazy preview clone,
nms_iouwidget,yolo_imgszwidget. - Round 5 — per-target steps overrides, text-labelled bboxes on preview output, SAM mask cache shared across passes (face+skin stop double-SAMing identical bboxes).
- Round 6 — SAM v1 batched predict via
predict_torch(parity with SAM2), soft-cancel between bboxes,draw_previewtoggle,max_bbox_area_pctsanity cap on whole-image false positives.
NaN-scrub on every refined-image path so downstream nodes never see NaN → uint8 cast garbage. Outputs: image, mask, detections_preview.
🧹 No-pack-deps cleanup
- Character Anchor — IPAdapter Plus import is lazy at
anchor()call time. Module loads cleanly without IPAdapter installed; node always visible in the picker. - SDXL Sampler — dropped efficiency-nodes city96/ttl_nn neural latent upscalers. Legacy strings retained on the dropdown so saved workflows still validate; runtime falls back to bicubic with a console warning.
- Detailer — idempotently registers
ultralytics_bbox/segm/samsfolder paths so dropdowns work even without Impact Subpack installed.
🛡️ Code-scanning fixes (CodeQL)
py/mismatched-multiple-assignment— explicit 8-tuple in_unpack_sdxl_tuple.js/xss-through-dom— addedf.type.startsWith("image/")guard beforeURL.createObjectURLin the upload handler.py/multiple-definition— removed deadpending_sincevariable from the watcher loop.py/overly-permissive-file— prompt-log fd mode0o644→0o600(owner-only).py/unused-import× 3 — dropped unusedtimefromcivitai_save.py+tools/screenshots/run.py,Pathfromtests/test_civitai_save.py.
🎨 Web + theme
- Smart Detailer (#d8754a burnt orange) and Character Anchor (#8eaa3e olive) added to
NODE_COLORS. - Selection-state diagnostic logging in
promptLibrary.jsfor the multi-Library ghost-select bug investigation; toggle off viawindow._plDebugSelect = false.
✅ Tests
299 passing (up from 263). New tests/test_detailer.py covers helpers, bypass/passthrough, INPUT_TYPES shape, edge-aware feather mask, wildcard cache LRU, conditional tiled-decode policy, font drawer.
Install
Clone or unzip into your ComfyUI custom_nodes/ directory and restart ComfyUI. The Smart Detailer node appears under right-click → Add Node → GrimmRibbity → Detailer → Smart Detailer.
Requires ultralytics (already installed via Impact Pack typically). Optional: sam2 or segment_anything for mask refinement.