[PR #4] [MERGED] feat(serialization): decode image:png_base64_batch envelope #4

Closed
opened 2026-10-26 22:28:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-remote-nodes/pull/4
Author: @Kosinkadink
Created: 5/14/2026
Status: ✅ Merged
Merged: 5/14/2026
Merged by: @Kosinkadink

Base: main ← Head: feat/batch-image-envelope


📝 Commits (1)

  • ed63c5a feat(serialization): decode image:png_base64_batch envelope

📊 Changes

3 files changed (+88 additions, -3 deletions)

View changed files

📝 client.py (+8 -2)
📝 protocol.py (+6 -0)
📝 serialization.py (+74 -1)

📄 Description

Track 1 (client side) — multi-image envelope

Companion PR to comfy-rnp-server#7. Implements the proxy_node side of the multi-image envelope contract so providers whose upstream returns n > 1 (Ideogram pilot in this round; Recraft / Grok / OpenAI to follow) surface as real batched [B, H, W, C] tensors in the workflow runtime.

What's in this PR

  • Capability.IMAGE_PNG_BASE64_BATCH (image:png_base64_batch) added to protocol.Capability, mirroring comfy_rnp_protocol/constants.py.
  • decode_image_envelope() now dispatches png_base64_batch to a new _decode_image_batch_envelope() helper that stacks each PNG frame into a [B, H, W, C] tensor.
  • Frame-count integrity check vs declared shape[0]; per-frame H/W mismatch is also a hard error. Both surface as RnpProtocolError rather than silently dropping or padding frames — matches the SVG decoder's count integrity check.
  • IMAGE_PNG_BASE64_BATCH added to client.CLIENT_CAPABILITIES so the server's per-request negotiator (client_advertises_capability in comfy_rnp_protocol.capabilities) lights up the batch path.

Back-compat

Single-frame encodings (png_base64 / jpeg_base64 / webp_base64) decode unchanged. Servers that don't advertise the batch encoding (older versions, future providers that haven't migrated yet) keep working.

Verification

End-to-end synthetic test (white + black 32×64 PNGs):

batch shape (2, 32, 64, 3) batch decode ok single-frame regression ok mismatch err ok: image batch envelope frame count 2 does not match declared s empty-frames err ok: image batch envelope missing or empty 'frames' list capability token ok

Companion PR


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-remote-nodes/pull/4 **Author:** [@Kosinkadink](https://github.com/Kosinkadink) **Created:** 5/14/2026 **Status:** ✅ Merged **Merged:** 5/14/2026 **Merged by:** [@Kosinkadink](https://github.com/Kosinkadink) **Base:** `main` ← **Head:** `feat/batch-image-envelope` --- ### 📝 Commits (1) - [`ed63c5a`](https://github.com/Comfy-Org/comfy-remote-nodes/commit/ed63c5ae49d639eb43458655b9c22185290eb036) feat(serialization): decode image:png_base64_batch envelope ### 📊 Changes **3 files changed** (+88 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `client.py` (+8 -2) 📝 `protocol.py` (+6 -0) 📝 `serialization.py` (+74 -1) </details> ### 📄 Description ## Track 1 (client side) — multi-image envelope Companion PR to [comfy-rnp-server#7](https://github.com/Comfy-Org/comfy-rnp-server/pull/7). Implements the proxy_node side of the multi-image envelope contract so providers whose upstream returns `n > 1` (Ideogram pilot in this round; Recraft / Grok / OpenAI to follow) surface as real batched `[B, H, W, C]` tensors in the workflow runtime. ### What's in this PR - `Capability.IMAGE_PNG_BASE64_BATCH` (`image:png_base64_batch`) added to `protocol.Capability`, mirroring `comfy_rnp_protocol/constants.py`. - `decode_image_envelope()` now dispatches `png_base64_batch` to a new `_decode_image_batch_envelope()` helper that stacks each PNG frame into a `[B, H, W, C]` tensor. - Frame-count integrity check vs declared `shape[0]`; per-frame H/W mismatch is also a hard error. Both surface as `RnpProtocolError` rather than silently dropping or padding frames — matches the SVG decoder's `count` integrity check. - `IMAGE_PNG_BASE64_BATCH` added to `client.CLIENT_CAPABILITIES` so the server's per-request negotiator (`client_advertises_capability` in `comfy_rnp_protocol.capabilities`) lights up the batch path. ### Back-compat Single-frame encodings (`png_base64` / `jpeg_base64` / `webp_base64`) decode unchanged. Servers that don't advertise the batch encoding (older versions, future providers that haven't migrated yet) keep working. ### Verification End-to-end synthetic test (white + black 32×64 PNGs): ` batch shape (2, 32, 64, 3) batch decode ok single-frame regression ok mismatch err ok: image batch envelope frame count 2 does not match declared s empty-frames err ok: image batch envelope missing or empty 'frames' list capability token ok ` ### Companion PR - Server: https://github.com/Comfy-Org/comfy-rnp-server/pull/7 (Ideogram V1/V2/V3 pilot, `num_images=2` SxS workflow under `notes/sxs_ideogram_batch.json`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:28:50 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-remote-nodes#4
No description provided.