Concurrent Submit | Zhenzhen ChatGPT Api
Parallel GPT-image calls through the shared 30-worker pool
- files
- images
- task
The ComflyChatGPTApi node is the pack's OpenAI-format workhorse - chat completions with image support, gpt-4o-image being the default model, multi-turn editing via clear_chats, that whole flexible mess. It's also, in its blocking form, strictly one generation per wait. This submit node is the concurrent version: same inputs, same chat-completions call under the hood, but each request drops into the shared 30-worker image pool and returns a task handle instead of blocking until the image is done.
Where this earns its keep is prompt-variation batches - you want ten spins on the same idea with different temperature / seed / max_tokens combos, and you'd rather they all run at once. Or you're building a small "generate many, pick the best" pipeline, which is the pattern the concurrent system exists for. One structural quirk worth knowing: because the primary output is an image, this node is classified into the image pool (30 workers), not the video pool, even though it's an OpenAI chat call.
How it works
Same auto-generated concurrent machinery as every node in this pack: the submit class copies the base node's full input list at import time, wraps the original process() in a bounded ThreadPoolExecutor (30 image workers by default, set via COMFLY_IMAGE_CONCURRENCY), and returns a COMFLY_IMAGE_FUTURE. You collect with ComflyConcurrent_Image_Await ("Concurrent Collect Images (30)"), which waits for the batch and hands back real IMAGE tensors in slot order.
Inputs mirror the base node: prompt and model (required), then api_key, files, image_url, images, temperature (0.7), max_tokens (4096), top_p, frequency_penalty, presence_penalty, seed (default -1, i.e. random), image_download_timeout, clear_chats, and skip_error. clear_chats matters more than people expect: with it on (default), each call is stateless - fresh context every time; with it off, the node keeps conversation history so you can iterate on a previous result.
Installing it
The whole pack, one clone:
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-zhenzhen
Restart ComfyUI, or install "Comfyui-zhenzhen" via ComfyUI Manager. No model downloads - the calls go to the Zhenzhen proxy, which routes to OpenAI.
Common issues
Pack-level: you need a Zhenzhen account with credit; 443 errors from some networks mean VPN with TUN mode; and the README has a specific note that if you hit repeated 500s with a 401 in the code, the token itself may be flagged - create a fresh one. For concurrency: 30 parallel GPT-image calls are 30 paid calls, so the pool is your speed, not your discount. And if clear_chats is off across concurrent submits, the shared conversation state can get tangled - keep batches stateless unless you genuinely need multi-turn.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | STRING | gpt-4o-image | — |
| api_keyopt | STRING | — | |
| filesopt | FILES | — | |
| image_urlopt | STRING | — | |
| imagesopt | IMAGE | — | |
| temperatureopt | FLOAT | 0.700–2 | — |
| max_tokensopt | INT | 40961–16384 | — |
| top_popt | FLOAT | 1.000–1 | — |
| frequency_penaltyopt | FLOAT | -2.00-2–2 | — |
| presence_penaltyopt | FLOAT | 0.00-2–2 | — |
| seedopt | INT | -1-1–2147483647 | — |
| image_download_timeoutopt | INT | 600300–1200 | — |
| clear_chatsopt | BOOLEAN | true | — |
| skip_erroropt | BOOLEAN | false | 开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| task | COMFLY_IMAGE_FUTURE | — |