PD: GPT Image 2 (comfyui_AuthToken)
GPT Image 2 with a session token — multi-image editing, no key management
- image
- mask
- files
- image
- info
- price
GPT Image 2, the multi-image-editing flagship, has both auth flavors in the comfyui-PD_comfy-api-node pack - and this is the token one. Same engine, same ComfyUI-hosted proxy, same up-to-3840 output sizes and multi-image files input. The difference is you authenticate with your logged-in ComfyUI session token instead of a ComfyUI API key.
The token trade, briefly
You grab the auth_token_comfy_org JWT with the pack's bundled Tampermonkey userscript (temperay/PD_comfyui_token_grabber.user.js), log into the ComfyUI app, and the script lifts the token and copies it. Paste it into auth_token; the node sends it as Authorization: Bearer <token>.
The usual trade applies, and it's sharper here because GPT Image 2 edits can be multi-step: tokens expire, and a workflow that was working Tuesday will 401 on Thursday. The API-key sibling is the one to use for pipelines and anything you'll revisit. The token node is for "I want this now and I'm logged in anyway."
Inputs
They match the API-key twin, field for field:
- auth_token - the grabbed session token.
- prompt - generation or edit instructions.
- model - locked to
gpt-image-2. - quality -
auto/low/medium/high. - background -
auto/opaqueonly; GPT Image 2 has no transparent output. - size - presets through 3840×2160, plus
Customwithcustom_width/custom_height(paired, step 16, max 3840) andauto. - num_images - 1–8.
- seed - full range here; results stay non-deterministic in practice.
- Optional image, mask (white = replaced), and files (packed multi-image input from
PD_comfyplus_image).
Outputs: image, info, price.
Installing and gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/comfyui-PD_comfy-api-node.git
Restart, find it under PD_Tools/Image_Generation. The README's pip install -r requirements.txt is a no-op (no file ships); the pack's real dependency is ComfyUI's official API nodes, bundled with Desktop.
Token-specific troubleshooting:
- 401/403 - expired token. Re-run the grabber and re-paste.
- Black output - error placeholder;
infohas the message. - Multi-image edit fails - check you're on a recent pack version (v2.0.1 fixed MIME handling for packed files) and that
filescomes fromPD_comfyplus_image.
If you're going to build anything you'll reuse, the ComfyUI-key version of GPT Image 2 is the same node minus the expiry clock.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| auth_token | STRING | — | |
| prompt | STRING | Describe what you want to generate or edit | |
| model | COMBO | gpt-image-2 | Locked GPT Image 2 model |
| quality | COMBO | auto | GPT Image 2 quality |
| background | COMBO | auto | GPT Image 2 does not support transparent background |
| size | COMBO | 1024x1024 | Preset output size, or Custom with custom_width/custom_height |
| use_custom_size | BOOLEAN | false | Enable custom_width/custom_height size override. |
| custom_width | INT | 00–3840 | Custom width. Must be paired with custom_height. |
| custom_height | INT | 00–3840 | Custom height. Must be paired with custom_width. |
| num_images | INT | 11–8 | How many images to generate |
| seed | INT | 00–18446744073709550000 | — |
| imageopt | IMAGE | Input image for editing | |
| maskopt | MASK | Mask for inpainting | |
| filesopt | GEMINI_INPUT_FILES | Packed multi-image files input |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| info | STRING | — |
| price | STRING | — |