Skip to content

v0.52.0 — Smart Detailer + no-pack-deps cleanup

Choose a tag to compare

@Deaththegrim Deaththegrim released this 07 May 05:12
· 47 commits to main since this release

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_image hoisted 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_strength widget, optional tiled_encode, hot-path imports hoisted, same_seed_per_target toggle.
  • 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_iou widget, yolo_imgsz widget.
  • 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_preview toggle, max_bbox_area_pct sanity 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/sams folder 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 — added f.type.startsWith("image/") guard before URL.createObjectURL in the upload handler.
  • py/multiple-definition — removed dead pending_since variable from the watcher loop.
  • py/overly-permissive-file — prompt-log fd mode 0o6440o600 (owner-only).
  • py/unused-import × 3 — dropped unused time from civitai_save.py + tools/screenshots/run.py, Path from tests/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.js for the multi-Library ghost-select bug investigation; toggle off via window._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.