Files
tackcrypto1031-tk_comfyui_c…/tk_comfyui_batch_image
tackandClaude Opus 4.7 1aef0f2ced refactor: M1 polish pass (I2, I3, I5, I7)
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>
2026-04-23 14:43:00 +08:00
..