3 Commits
Author SHA1 Message Date
limbicnation faab680db5 chore: lint cleanup and artifact removal
- Remove unused imports (ruff F401)
- Fix f-strings without placeholders (ruff F541)
- Resolve E402 import ordering in grabcut_nodes.py
- Fix B108 hardcoded /tmp fallback in nodes.py (use tempfile.gettempdir())
- Delete untracked artifacts: .claude/, node.zip, __pycache__/
- Add .claude/ and *.zip to .gitignore
2026-04-22 04:57:18 +02:00
limbicnation a27550b7f3 fix: address code review issues from PR #13
Bugs:
- Remove unused edge_sensitivity param from remove_background_pil()
- Add try/except fallback for structlog import (was ImportError outside ComfyUI)

Warnings:
- Subsample pixels in _kmeans_colors() to prevent OOM on 4K images
- Set OUTPUT_NODE = True (node produces terminal IMAGE+MASK output)
- Narrow except Exception to except ImportError in __init__.py

Suggestions:
- Extract ScalingMixin to shared scaling.py (used by both nodes)
- Remove unused comfy.utils import and _COMFY_AVAILABLE flag
2026-04-20 07:08:10 +02:00
limbicnation 36e20e6052 feat: add RemoveBackgroundAndResizeNode — standalone PIL-only background removal with resize
- Single-file node combining background removal + resize (no external background_remover.py dependency)
- PIL-only implementation: k-means colour clustering, dominant-bg estimation from edges, alpha binarisation
- ScalingMixin from grabcut_nodes.py: power-of-8 resize, 6 preset sizes + ORIGINAL
- ComfyUI contract: INPUT_TYPES, RETURN_TYPES (IMAGE + MASK), FUNCTION, CATEGORY
- Registered in __init__.py alongside existing TransparencyBackgroundRemover and GrabCut nodes
- structlog logging, torch.no_grad() guard, full validation
2026-04-20 00:11:30 +02:00