Nodes/comfyui-PD_comfy-api-node/PD: GPT Image 2 (comfyui_AuthToken)
ComfyUI Node

PD: GPT Image 2 (comfyui_AuthToken)

GPT Image 2 with a session token — multi-image editing, no key management

By 7BEII·Created 10 months ago·Updated 9 days ago· 2
PD: GPT Image 2 (comfyui_AuthToken)
  • image
  • mask
  • files
  • image
  • info
  • price
auth_token
prompt
modelgpt-image-2
qualityauto
backgroundauto
size1024x1024
use_custom_sizefalse
custom_width0
custom_height0
num_images1
seed0

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/opaque only; GPT Image 2 has no transparent output.
  • size - presets through 3840×2160, plus Custom with custom_width/custom_height (paired, step 16, max 3840) and auto.
  • 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; info has 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 files comes from PD_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.

CategoryPD_Tools/Image_Generation

Inputs (14)

NameTypeDefaultDescription
auth_tokenSTRING
promptSTRINGDescribe what you want to generate or edit
modelCOMBOgpt-image-2Locked GPT Image 2 model
qualityCOMBOautoGPT Image 2 quality
backgroundCOMBOautoGPT Image 2 does not support transparent background
sizeCOMBO1024x1024Preset output size, or Custom with custom_width/custom_height
use_custom_sizeBOOLEANfalseEnable custom_width/custom_height size override.
custom_widthINT00–3840Custom width. Must be paired with custom_height.
custom_heightINT00–3840Custom height. Must be paired with custom_width.
num_imagesINT11–8How many images to generate
seedINT00–18446744073709550000
imageoptIMAGEInput image for editing
maskoptMASKMask for inpainting
filesoptGEMINI_INPUT_FILESPacked multi-image files input

Outputs (3)

NameTypeDescription
imageIMAGE
infoSTRING
priceSTRING