ComfyUI/comfy_api_nodes
Kristen T. Tran e4dbc95a73
Main (#3)
* Add prompt_id to progress_text binary WS messages

Add supports_progress_text_metadata feature flag and extend
send_progress_text() to accept optional prompt_id param. When
prompt_id is provided and the client supports the new format,
the binary wire format includes a length-prefixed prompt_id field:

  [4B event_type][4B prompt_id_len][prompt_id][4B node_id_len][node_id][text]

Legacy format preserved for clients without the flag.

Both callers (nodes_images.py, client.py) updated to pass prompt_id
from get_executing_context().

Part of COM-12671: parallel workflow execution support.

Amp-Thread-ID: https://ampcode.com/threads/T-019c79f7-f19b-70d9-b662-0687cc206282

* refactor: add prompt_id as hidden type, fix imports, add docstrings

- Add PROMPT_ID as a new hidden type in the Hidden enum, HiddenHolder,
  HiddenInputTypeDict, and execution engine resolution (both V3 and legacy)
- Refactor GetImageSize to use cls.hidden.prompt_id instead of manually
  calling get_executing_context() — addresses reviewer feedback
- Remove lazy import of get_executing_context from nodes_images.py
- Add docstrings to send_progress_text, _display_text, HiddenHolder,
  and HiddenHolder.from_dict

Amp-Thread-ID: https://ampcode.com/threads/T-019ca1cb-0150-7549-8b1b-6713060d3408

* fix: send_progress_text unicasts to client_id instead of broadcasting

- Default sid to self.client_id when not explicitly provided, matching
  every other WS message dispatch (executing, executed, progress_state, etc.)
- Previously sid=None caused broadcast to all connected clients
- Format signature per ruff, remove redundant comments
- Add unit tests for routing, legacy format, and new prompt_id format

Amp-Thread-ID: https://ampcode.com/threads/T-019ca3ce-c530-75dd-8d68-349e745a022e

* remove send_progress_text stub tests

Copy-paste stub tests don't verify the real implementation and add
maintenance burden without meaningful coverage.

Amp-Thread-ID: https://ampcode.com/threads/T-019ca3ce-c530-75dd-8d68-349e745a022e

* fix: always send new binary format when client supports feature flag

When prompt_id is None, encode as zero-length string instead of falling
back to old format. Prevents binary parse corruption on the frontend.

Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI/pull/12540#discussion_r2923412491

---------

Co-authored-by: bymyself <cbyrne@comfy.org>
2026-03-19 06:19:21 +07:00
..
apis fix(api-nodes): add support for "thought_image" in Nano Banana 2 and corrected price badges (#13038) 2026-03-18 10:21:58 -07:00
util Main (#3) 2026-03-19 06:19:21 +07:00
__init__.py [API nodes] Add backbone for supporting api nodes in ComfyUI (#7745) 2025-04-23 02:18:08 -04:00
nodes_bfl.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_bria.py feat(api-nodes): add Bria RMBG nodes (#12465) 2026-02-15 17:22:30 -08:00
nodes_bytedance.py feat(api-nodes): add NanoBanana2 (#12660) 2026-02-26 15:52:10 -05:00
nodes_elevenlabs.py [API Nodes] add ElevenLabs nodes (#12207) 2026-02-19 22:12:28 -08:00
nodes_gemini.py fix(api-nodes): add support for "thought_image" in Nano Banana 2 and corrected price badges (#13038) 2026-03-18 10:21:58 -07:00
nodes_grok.py feat(api-nodes-xAI): updated models, pricing, added features (#12756) 2026-03-05 04:29:39 -08:00
nodes_hitpaw.py [API Nodes] HitPaw API nodes (#12117) 2026-02-02 19:17:59 -08:00
nodes_hunyuan3d.py fix(api-nodes): Tencent TextToModel and ImageToModel nodes (#12680) 2026-03-13 10:10:40 -07:00
nodes_ideogram.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_kling.py feat: add essentials_category to nodes and blueprints for Essentials tab (#12573) 2026-03-15 16:18:04 -07:00
nodes_ltxv.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_luma.py chore(api-nodes): remove non-used; extract model to separate files (#11927) 2026-01-17 18:52:45 -08:00
nodes_magnific.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_meshy.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_minimax.py chore(api-nodes): remove non-used; extract model to separate files (#11927) 2026-01-17 18:52:45 -08:00
nodes_moonvalley.py fix(Moonvalley-API-Nodes): adjust "steps" parameter to not raise exception (#12370) 2026-02-09 21:58:27 -05:00
nodes_openai.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_pixverse.py chore(api-nodes): remove non-used; extract model to separate files (#11927) 2026-01-17 18:52:45 -08:00
nodes_recraft.py feat: add essentials_category to nodes and blueprints for Essentials tab (#12573) 2026-03-15 16:18:04 -07:00
nodes_reve.py feat(api-nodes): add Reve Image nodes (#12848) 2026-03-11 09:53:55 -07:00
nodes_rodin.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_runway.py chore(api-nodes): remove non-used; extract model to separate files (#11927) 2026-01-17 18:52:45 -08:00
nodes_sora.py [API Nodes] add TencentHunyuan3D nodes (#12026) 2026-01-24 17:10:09 -08:00
nodes_stability.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_topaz.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_tripo.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_veo2.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_vidu.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_wan.py feat: mark 429 widgets as advanced for collapsible UI (#12197) 2026-02-19 19:20:02 -08:00
nodes_wavespeed.py feat(api-nodes): add WaveSpeed nodes (#11945) 2026-01-20 13:05:40 -08:00