arkennemasis Codex Image Gen (ChatGPT login)
Gpt-image-2 in ComfyUI — with your ChatGPT subscription, no API key
- image_1
- image_2
- image_3
- image_4
- settings
- image
- account
The name is the pitch: ArkCodexImageGen generates or edits images with OpenAI's gpt-image-2 inside ComfyUI, using your existing ChatGPT/Codex login instead of an API key. If you already pay for ChatGPT, you get gpt-image-2 generations billed against your plan rather than per call. No API key field exists. No OAuth flow exists inside ComfyUI - the node reads the login the Codex CLI already wrote on this machine.
That "no API key" claim is the headline, but the honest caveat sits right next to it: it requires a paid ChatGPT plan (the free tier can't call the hosted image tool), and you have to install the Codex CLI and run codex login once in your own terminal:
codex login
That writes ~/.codex/auth.json, which the node reads directly. codex logout and the node stops working; log in as a different account and it follows. It's one login, reused - the same OAuth credentials, not a copy. The pack also ships ArkCodexLoginStatus so you can confirm the account and plan before spending anything.
The inputs that matter
prompt- required, your text-to-image prompt or the edit instruction.image_1throughimage_4- optional reference/edit images (can be batches). This is the edit path: give it an image and a "change the background to X" prompt.aspect_ratio- stated in the prompt, because this backend ignores the size field. The tooltip is blunt about the tradeoff: wide/tall targets land close but not exact (16:9 came back as 7:4). If the ratio must be precise, use the pack's Replicate node instead - that's the honest recommendation, and it's why both paths exist.qualityandbackground- defaults, low/medium/high, and opaque/transparent/auto.codex_home- point at a specific account's auth folder for multi-account setups. Blank =$CODEX_HOME, else~/.codex.allow_refresh- default on: refresh an expired token and save it back atomically. Off = fail instead of writing to auth.json.run_mode/max_concurrent-one at a time(default) serialises every arkennemasis API node via an asyncio lock;all at oncewithmax_concurrent(default 2) runs calls concurrently. Under $5 credit Replicate drops to ~6 req/min, so parallel calls without a cap reliably 429 - that's why the lock exists.on_failure- what to do when the backend definitively returns no image after every retry (usually a moderation refusal).fail the runis right for a single image; inside a 24-scene loop one refusal on the 23rd image threw away 22 finished images and 36 minutes of work, which is whyuse the reference imageexists - it substitutes the input image so the run completes, and says so loudly in the log.settings- wire the shared Image Gen Settings node here to drive several generators from one place.
Outputs: image (the IMAGE tensor) and account (the signed-in email that produced it - the way to tell which login made which image in a multi-account graph).
Installing and expectations
It's part of comfyui-arkennemasis:
cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis
pip install replicate httpx
restart, and it's under arkennemasis/Image Gen. It needs the httpx dependency to load, and the Codex CLI + a paid plan to run.
Where people get burned: expecting pixel-exact aspect ratios (use Replicate for that), running a batch without checking the login first, and forgetting that availability is account-dependent - not every plan or region can call the hosted image tool, and the node says so plainly rather than dumping an HTTP error. Also note the node distinguishes a finished image from a partial_images preview, so a stream cut mid-render can never be saved as if it were the final result. That's the kind of defensive detail that makes a paid-API node trustworthy.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| image_1opt | IMAGE | Optional reference / image to edit. Can be a batch. | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| aspect_ratioopt | COMBO | Stated in the prompt, because this backend ignores the size field. Wide/tall targets land close but not exact (16:9 came back as 7:4). Use the Replicate node when the ratio must be precise. | |
| qualityopt | COMBO | 4 options: default, low, medium, high | |
| backgroundopt | COMBO | 4 options: default, opaque, transparent, auto | |
| codex_homeopt | STRING | Folder holding auth.json. Blank = CODEX_HOME, else ~/.codex. Give each ChatGPT account its own folder and point here to switch account. | |
| allow_refreshopt | BOOLEAN | true | Refresh an expired token and save it back. Off = fail instead of writing to auth.json. |
| timeout_secondsopt | INT | 3000–86400 | 0 = wait indefinitely. |
| force_rerunopt | BOOLEAN | false | Call again 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. | |
| 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. |
| on_failureopt | COMBO | What to do when the backend definitively returns no image after every retry - usually a moderation refusal. 'fail the run' is right for a single image. Inside a multi-scene loop it is catastrophic: one refusal on the 23rd image threw away 22 finished images and 36 minutes of work. 'use the reference image' substitutes the input image for that scene so the run completes, and says so loudly in the log so you can re-render just that scene. | |
| settingsopt | ARK_IMAGE_SETTINGS | Optional: the shared 'Image Gen Settings' node, so this and the Replicate nodes follow one place. Codex uses aspect_ratio / quality / background / run_mode / timeout_seconds; output_format, moderation and api_token do not apply and are ignored. | |
| speedopt | COMBO | The Codex CLI's Speed setting. 'fast' sends service_tier=priority (its '1.5x speed, increased usage' option). Worth far less here than on the text step: an image is dominated by generation time, not by queueing, so this mostly just spends plan quota faster. Leave it on standard unless you are waiting on a single hero image. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| account | STRING | — |