arkennemasis Replicate Image Gen (GPT-Image-2)
Generate, edit, and don't blow the rate limit
- image_1
- image_2
- image_3
- image_4
- settings
- image
GPT-Image-2 is a closed model - there are no weights to download, so the only way to get it into a ComfyUI graph is through an API node like this one. It generates images from a prompt and edits images you feed in (up to four of them), which makes it one of the pack's two image workhorses: the edit path is how you keep a consistent product or character, since the model looks at your reference while it works instead of re-inventing it. The cost is per call, so the two things that matter are the key and the rate limit.
How it works
Required: just prompt. Optional image inputs image_1 through image_4 switch it into edit/reference mode; omit them and it's text-to-image. One output: image, straight into a Save Image node.
The generation controls mirror the model's own API: number_of_images (1–10), aspect_ratio (a long enum - 1:1, 3:2, 16:9, specific pixel sizes, etc.), quality (low/medium/high/auto), background (auto/transparent/opaque - transparent is the product-photo mode), output_format (png/jpeg/webp), and moderation (auto/low). Everything left on default isn't sent, so the model's defaults apply - the pack's way of keeping the payload clean.
Then the two inputs that save your account:
run_mode-one at a time(default) serialises every arkennemasis API node in the graph. This exists because ComfyUI runs async nodes concurrently, and Replicate throttles to "6 requests per minute with a burst of 1" while an account holds under $5 credit - parallel calls reliably return 429.all at onceis faster when your rate limit allows it, bounded bymax_concurrent(default 2).timeout_seconds(0 = wait indefinitely),force_rerun, andapi_token(blank falls back toREPLICATE_API_TOKENenv or a.envfile).
settings is the pack's neat trick: wire one shared Image Gen Settings node into many Image Gen nodes at once, so a single aspect_ratio/quality drives 24 generators (a STRING can't be wired into a COMBO widget in ComfyUI, hence the typed ARK_IMAGE_SETTINGS socket). number_of_images is deliberately not shared - multiplying it across every wired node is rarely what you want.
Two gotchas that will actually hit you
429s are a shape of the pack, not a bug. If your account is under $5 credit and you run a 24-image batch on all at once, you'll see them. The retry layer backs off exponentially on 429s and never retries a moderation refusal, but the fix is the one at a time default - leave it until your rate limit actually allows concurrency. And watch the batch-filename trap: in a graph that names files deterministically, a number_of_images above 1 lands all the extras on the same filename and they overwrite each other. Set it per node.
Install
ReplicateOpenAIGPTImage2 is one of the 61 nodes in the comfyui-arkennemasis pack, in arkennemasis/Image Gen:
cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis
pip install -r comfyui-arkennemasis/requirements.txt # then restart ComfyUI
Get a token at https://replicate.com/account/api-tokens and paste it into api_token, set REPLICATE_API_TOKEN, or add it to a .env in ComfyUI's root. Or ComfyUI Manager → Install via Git URL with the repo URL.
And the honest alternative: the same gpt-image-2 model is reachable through the pack's Codex Image Gen node using a paid ChatGPT subscription - no API key, billed to your plan instead of per image. If you already pay for ChatGPT, that's the cheaper door to the same model.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| image_1opt | IMAGE | Optional image to edit/transform. Omit for text-to-image. Can be a batch. | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| number_of_imagesopt | INT | 11–10 | — |
| aspect_ratioopt | COMBO | 19 options: default, 1:1, 3:2, 2:3, 4:3, 3:4, +13 | |
| qualityopt | COMBO | 5 options: default, low, medium, high, auto | |
| backgroundopt | COMBO | 4 options: default, auto, transparent, opaque | |
| output_formatopt | COMBO | 4 options: default, png, jpeg, webp | |
| moderationopt | COMBO | 3 options: default, auto, low | |
| api_tokenopt | STRING | Replicate API token (optional). Blank = use REPLICATE_API_TOKEN from the environment or a .env file. | |
| timeout_secondsopt | INT | 00–86400 | Max seconds to wait for the model. 0 = wait indefinitely. |
| force_rerunopt | BOOLEAN | false | Re-call the API even if inputs are unchanged. |
| run_modeopt | COMBO | ComfyUI runs async nodes concurrently. 'one at a time' serialises every arkennemasis API node in the graph — use it when the provider throttles bursts (Replicate allows a burst of 1 under $5 credit). 'all at once' is faster when your rate limit allows it. | |
| max_concurrentopt | INT | 20–32 | Only used when run_mode is 'all at once': how many arkennemasis API calls may be in flight together. 0 = no cap. 2 is a safe default for a 24-shot batch. |
| settingsopt | ARK_IMAGE_SETTINGS | Optional: wire one 'Image Gen Settings (shared)' node in here to drive this and every other Image Gen node from a single place. Any field it leaves on "use node's own" falls back to the widgets above. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |