PR #15 shipped four NameError-class bugs that crash at call time but slip
past import-only CI: validate_node_params, log, _log_gpu_memory, and
invert_mask were referenced without being defined.
This commit:
- Adds schemas.py with Pydantic v2 NodeParams (ranges mirror INPUT_TYPES)
and a dataclass fallback so minimal envs still validate.
- Adds a structlog-or-stdlib logging guard and _log_gpu_memory helper at
the top of grabcut_nodes.py; the stdlib adapter preserves exc_info
semantics.
- Exposes invert_mask on both AutoGrabCutRemover and GrabCutRefinement —
INPUT_TYPES, function signature, and applied to the alpha channel in
every success/fallback path.
- Fixes torch.stack shape mismatch in GrabCutRefinement.refine_mask: all
branches now run through the same resize so batches can stack when
output_size != ORIGINAL.
- Narrows the validation exception handler to (ValidationError,
ValueError, TypeError).
- Adds OUTPUT_NODE, DESCRIPTION, and IS_CHANGED (deterministic sha256
hash over scalar inputs) to all four node classes.
- Adds test_node_smoke.py with 9 tests that actually invoke each node's
FUNCTION, plus parameter validation and regression tests for the
invert_mask / resize-stack bugs.
- Wires pytest test_node_smoke.py into CI and drops continue-on-error
from flake8 so real syntax/name errors now block.
- Fixes __init__.py relative imports so pytest can collect tests whose
parent dir name isn't a valid Python identifier.
- Adds pydantic>=2.0 and structlog>=23.0 to requirements.txt.
- Add OUTPUT_NODE=True to all 5 node classes for ComfyUI execution triggers
- Add DESCRIPTION attributes for ComfyUI 0.19+ frontend info panel
- Add IS_CHANGED with deterministic hash for execution caching (H100 compute savings)
- Guard structlog import in grabcut_nodes.py with stdlib logging fallback
- Update CI Python matrix to 3.10-3.12 (drop EOL 3.8/3.9)
- Remove dead RGBA loop in GrabCutRefinement (redundant alpha multiply)
- Wire all Pydantic-validated params in AutoGrabCutRemover