1aef0f2ced9edf18845bf8b4cccbb187e535d7cf
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>
tk_comfyui_batch_image
ComfyUI custom node set for batch comic-page generation from a JSON script.
Status: M1 — Rectangle vertical-stack. See docs/superpowers/specs/2026-04-23-comfyui-comic-batch-node-design.md for the full design; docs/superpowers/plans/ for milestones.
Install
Clone this repo into ComfyUI/custom_nodes/, then:
pip install -e .[dev]
Restart ComfyUI.
Nodes
| Node | Purpose |
|---|---|
Comic Script Loader |
Load + validate JSON; emits COMIC_SCRIPT. Modes: file / path / inline. |
Comic Batch Generator |
Inner for-loop over panels. Connect MODEL / CLIP / VAE; no KSampler needed. Supports resume via panel-hash cache. |
Comic Page Composer |
Assemble panels into full pages. Outputs composed IMAGE batch + bbox metadata + pass-through panels. |
Example workflow
Drop examples/workflows/m1_basic_vertical_stack.json into ComfyUI.
Place basic.json (see tests/fixtures/scripts/) at ComfyUI/input/comics/basic.json.
Running tests
pytest tk_comfyui_batch_image/tests/ -v
ruff check tk_comfyui_batch_image
Current limitations (M1)
- Shapes: rectangle only (no
split/polygonyet → M3/M4) - Layout modes:
vertical_stackonly (nocustom_gridyet → M3) - No debug overlay (→ M5)
- No standalone JSON-validation CLI (→ M2)
- No SKILL.md skill package for AI script generation (→ M2)
Languages
Python
100%