Nodes/Comfyui-zhenzhen/Concurrent Submit | Zhenzhen ChatGPT Api
ComfyUI Node

Concurrent Submit | Zhenzhen ChatGPT Api

Parallel GPT-image calls through the shared 30-worker pool

By T8mars·Created about a year ago·Updated 2 days ago· 740
Concurrent Submit | Zhenzhen ChatGPT Api
  • files
  • images
  • task
prompt
modelgpt-4o-image
api_key
image_url
temperature0.70
max_tokens4096
top_p1.00
frequency_penalty-2.00
presence_penalty0.00
seed-1
image_download_timeout600
clear_chatstrue
skip_errorfalse

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.

Categoryzhenzhen/Openai/Concurrent Submit

Inputs (15)

NameTypeDefaultDescription
promptSTRING
modelSTRINGgpt-4o-image
api_keyoptSTRING
filesoptFILES
image_urloptSTRING
imagesoptIMAGE
temperatureoptFLOAT0.700–2
max_tokensoptINT40961–16384
top_poptFLOAT1.000–1
frequency_penaltyoptFLOAT-2.00-2–2
presence_penaltyoptFLOAT0.00-2–2
seedoptINT-1-1–2147483647
image_download_timeoutoptINT600300–1200
clear_chatsoptBOOLEANtrue
skip_erroroptBOOLEANfalse开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。

Outputs (1)

NameTypeDescription
taskCOMFLY_IMAGE_FUTURE