Four minor improvements flagged in the M1 holistic review:
- I7: Extract core/image_ops.py with arr_to_pil / pil_to_arr / hex_to_rgb.
Removes the three duplicated copies scattered across compositor,
batch_generator, and page_composer. Sets up cleaner reuse for M2/M3
when validator and polygon mask code need the same helpers.
- I5: Move `import torch` out of module top-level in both node files,
into the methods that actually use it. Keeps the ComfyUI node scan
cheap — torch is the heaviest dependency by far.
- I3: Rename the `retries` widget to `max_attempts` (default 3, min 1).
The old name was misleading: retries=2 meant 3 total attempts.
Log lines now read "attempt N/M" for clarity.
- I2: Add manifest_version: 1 to cache manifests. manifest_matches()
now treats missing/mismatched versions as stale, so a future hash
schema change can safely invalidate old caches by bumping the
constant in core/cache_manager.py.
Tests updated to new kwargs, plus 2 new regression tests covering the
manifest-version behaviour. 74/74 pass, ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>