Commit Graph
87 Commits
Author SHA1 Message Date
Robert Wojciechowski 59ccbabe79 Merge main into feat/runpod-serverless-workers
Resolve nodes/collector.py: keep the serverless manager accessor and
main's compressed result transfer. Update test stubs for the merged
code: fetch_worker_has_node (#99) in the serverless integration test,
and the real aiohttp.web in the transfer integration test.
2026-10-13 22:16:16 +00:00
Robert Wojciechowski 7060e31edb fix(serverless): disable Clear saved API key while the worker is enabled
The checkbox read "Clear saved API key (disable pool first)", but the
panel never defines "pool" and saving with it ticked on an enabled worker
was rejected by the backend.

- Disable the checkbox while the worker is enabled, with a tooltip saying
  to turn the worker off first. Also disable it when no key is saved.
- Use "worker" instead of "pool" in user-facing serverless errors, the
  serverless guide and the README entry.
2026-10-13 21:01:57 +00:00
Robert Wojciechowski 9345a8e71b docs: link community add-ons and forks 2026-10-12 01:20:46 +00:00
Robert Wojciechowski a630f55bd9 docs: move compressed result transfer guide out of README 2026-10-11 20:55:37 +00:00
6edd3fda38 feat(collector): optional compressed worker → master result transfer (#97)
* feat(collector): compressed worker -> master result transfer

Workers sent every frame as an uncompressed PNG (compress_level=0),
base64-encoded inside a JSON request, one request per frame. For cloud
workers this makes result download (egress) the dominant transfer cost:
a 121-frame 720p batch is ~446 MB per worker.

Add `transfer_format` / `transfer_quality` optional widgets to
Distributed Collector:

- legacy_png (default): unchanged behaviour
- png, ffv1: lossless, bit-identical master tensors to legacy_png
- jpeg, webp: lossy stills
- h264, h265, av1: lossy video of the whole batch

Compressed results are posted as multipart/form-data chunks (binary, no
base64, ~32 MB soft cap per request, configurable with
COMFYUI_DISTRIBUTED_TRANSFER_CHUNK_BYTES). The master decodes each chunk
off the event loop and enqueues one item per frame, so collection,
ordering and audio handling are unchanged. Encoding also runs in an
executor on the worker.

Compatibility:
- /distributed/job_complete still accepts the legacy JSON envelope.
- A worker talking to an older master gets a 400 on the first chunk and
  resends everything as legacy_png.
- Missing video encoders fall back to h264 (lossy) or png (ffv1).

Measured on 121 frames at 1280x720: png 163 MB (2.7x), ffv1 128 MB
(3.5x), h264 q90 2.4 MB (186x, 40.2 dB), av1 q90 0.4 MB.

Also clips IMAGE values before 8-bit quantization on the new path so
out-of-range values no longer wrap around.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0166t8T3CVaxZkJbP2RtSpo6

* fix(collector): wire transfer options through V3 node; bound finalized payload size

Addresses review on #97.

V3 integration
- Add optional `transfer_format` / `transfer_quality` inputs to the
  registered nodes/v3.py DistributedCollector schema (legacy defaults) and
  accept/forward them in execute() to the runtime helper.
- tests/test_v3_collector_transfer.py checks the registered node's public
  schema and argument forwarding without a ComfyUI checkout; the opt-in
  real-runtime acceptance (tests/helpers/v3_runtime_check.py) now allows
  exactly these appended optional inputs, verifies their contract, and
  checks forwarding through the real executor.

Payload size bound
- encode_chunks() enforces limits on finalized bytes (after encoder flush
  and muxer finalization). Encoder lookahead kept the pre-flush buffer
  near zero, so a chunk could hold the whole batch and finalize far above
  the limit. Oversized video chunks are re-encoded with proportionally
  fewer frames; the next chunk is sized from observed bytes/frame.
- Multi-frame chunks stay within TRANSFER_MAX_CHUNK_BYTES (32 MiB); a
  single frame may use up to TRANSFER_MAX_REQUEST_BYTES (96 MiB, new,
  COMFYUI_DISTRIBUTED_TRANSFER_MAX_REQUEST_BYTES) minus envelope reserve.
  A frame that cannot fit raises FrameTooLargeError.
- The worker encodes all chunks before sending, so an unfittable frame
  fails before anything is delivered (no partial batch on the master).
- Audio rides on the last chunk only when the request stays in bounds;
  otherwise it is sent as a final audio-only completion.
- Legacy fallback triggers only on an older master's rejection
  ("Invalid JSON payload"); other errors, e.g. size limits, raise with a
  pointer to the limit settings instead of resending as legacy_png.
- The master returns 413 when a request exceeds --max-upload-size.

Tests: codec flush-overshoot and single-frame cases, worker fallback /
nothing-sent / audio placement, and real aiohttp server tests with
client_max_size covering bounded high-entropy video, 413 reporting, and
unfittable frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0166t8T3CVaxZkJbP2RtSpo6

---------

Co-authored-by: ymiyad <ymiyad@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:50:23 +00:00
Robert Wojciechowski 1093818327 feat: add Runpod serverless image collector pools 2026-10-11 04:55:01 +00:00
Robert Wojciechowski 32ac027e0e docs: align selected copy with current behavior 2026-07-12 11:13:22 +00:00
Robert Wojciechowski 27e08de94c Document ComfyUI Desktop support 2026-04-04 06:06:59 +00:00
Robert Wojciechowski e7ab67733b Add ComfyUI Desktop worker support 2026-04-03 21:54:51 +00:00
Robert Wojciechowski a6d0b82d35 Update README.md 2026-03-02 16:10:42 +11:00
Robert Wojciechowski ff7bfb5ef5 Update docs for load balance, logs, and Distributed Value 2026-02-28 04:53:20 +00:00
Robert Wojciechowski 4911ead630 Update README.md 2026-01-25 18:26:38 +11:00
Robert Wojciechowski a00be15304 Update README.md 2026-01-25 18:23:06 +11:00
Robert Wojciechowski d353d118d7 Update README.md 2025-12-28 10:54:16 +11:00
Robert Wojciechowski 1e3e094cdb Update README.md 2025-10-25 09:40:53 +11:00
Robert Wojciechowski 6aec567071 Update README.md 2025-09-15 12:01:27 +10:00
Robert Wojciechowski 701c6de9eb Update README.md 2025-09-15 11:44:08 +10:00
Robert Wojciechowski c1928ebd09 Update README.md 2025-09-13 10:41:52 +10:00
Robert Wojciechowski 98a63938c8 Update README.md 2025-09-13 10:40:03 +10:00
Robert Wojciechowski 27b73fd280 Update README.md 2025-09-13 10:38:55 +10:00
Robert Wojciechowski b90c3e42ac Update README.md 2025-09-12 09:49:27 +10:00
Robert Wojciechowski c032de224b Update README.md 2025-08-05 07:58:40 +10:00
Robert Wojciechowski 68f8627b0b Update README.md 2025-08-04 11:09:36 +10:00
Robert Wojciechowski 0e3c04fba7 Update README.md 2025-08-04 11:02:55 +10:00
Robert Wojciechowski 51e9a03dd5 Update README.md 2025-07-31 17:55:41 +10:00
Robert Wojciechowski 960c44b095 Update README.md 2025-07-31 12:39:15 +10:00
Robert Wojciechowski f5d7307aef Update README.md 2025-07-31 12:30:28 +10:00
Robert Wojciechowski a884527ad3 Update README.md 2025-07-31 09:56:22 +10:00
Robert Wojciechowski 53be3e0c18 Update README.md 2025-07-31 09:31:51 +10:00
Robert Wojciechowski 8f87d1ac29 Update README.md 2025-07-31 08:01:05 +10:00
Robert Wojciechowski 33fbe4cb62 Update README.md 2025-07-30 12:58:57 +10:00
Robert Wojciechowski b13c78ad71 Update README.md 2025-07-29 16:31:16 +10:00
Robert Wojciechowski f589a723fe Update README.md 2025-07-29 15:59:30 +10:00
Robert Wojciechowski 0fe8485c6c Update README.md 2025-07-29 15:28:06 +10:00
Robert Wojciechowski ccb00a7142 Update README.md 2025-07-29 14:01:52 +10:00
Robert Wojciechowski 285710bb28 Update README.md 2025-07-29 13:51:31 +10:00
Robert Wojciechowski ff02c88224 Update README.md 2025-07-29 13:45:49 +10:00
Robert Wojciechowski f7efde4eb5 Update README.md 2025-07-29 13:40:18 +10:00
robertvoy 0a480c143a readme 2025-07-29 13:36:49 +10:00
Robert Wojciechowski fb46d32e39 Update README.md 2025-07-14 07:05:00 +10:00
Robert Wojciechowski acf166fe6c Update README.md 2025-07-11 09:54:12 +10:00
Robert Wojciechowski 17f67d17fe Update README.md 2025-07-10 08:56:28 +10:00
Robert Wojciechowski aa43f18e3d Update README.md 2025-07-10 08:03:59 +10:00
Robert Wojciechowski b7a785a99d Update README.md 2025-07-09 22:20:55 +10:00
Robert Wojciechowski 0dfe34a9dc Update README.md 2025-07-09 18:39:32 +10:00
Robert Wojciechowski 99e4d094c4 Update README.md 2025-07-09 17:15:00 +10:00
Robert Wojciechowski 79cdf4f4c7 Update README.md 2025-07-09 13:19:59 +10:00
Robert Wojciechowski ed5a55be9a Update README.md 2025-07-09 11:28:16 +10:00
Robert Wojciechowski c0be51025c Update README.md 2025-07-09 11:27:29 +10:00
Robert Wojciechowski 7e412701a4 Update README.md 2025-07-09 11:15:24 +10:00