2 Commits
Author SHA1 Message Date
limbicnation 3168ecdd67 fix: remove schemas.py, use src.validation consistently
- Remove duplicate schemas.py (near-duplicate of src/validation.py)
- Update test_node_smoke.py to import from src.validation
- All 9 smoke tests pass
2026-04-24 05:29:36 +02:00
limbicnation 84deeb20bf fix: wire up PR #15 validation/logging and add smoke tests
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.
2026-04-24 04:34:14 +02:00