Nodes/ComfyUI-OpenAI-Fashion-Bridge/OpenAI Fashion Bridge
ComfyUI Node

OpenAI Fashion Bridge

A ComfyUI node that calls OpenAI's image API — no GPU, no local model, just a key and a credit card

By starchoi·Created 5 months ago·Updated 5 months ago· 0
OpenAI Fashion Bridge
  • image1
  • image2
  • image
  • debug_json
◄task▾►
◄promptA high-fashion editorial image.►
◄modelgpt-image-2►
◄size1024x1536►
◄qualityhigh►
◄output_formatpng►
◄api_key►
◄timeout_seconds180►

Why this node exists

Some models you can't download. GPT Image (gpt-image-1, and now gpt-image-2) is OpenAI's closed image model - there are no weights, so local ComfyUI can never run it. The only door is the API. OpenAI Fashion Bridge is one node that walks through it: it takes your prompt (and optionally your images), sends them to OpenAI's /v1/images endpoint, and drops the returned picture back into your graph like any local sampler produced it.

That's the whole thing. The README says it in its own words: it's a simple test bridge. Six fashion-flavored tasks on one node, no mask editing, no batching, no Comfy Cloud billing - just your own key and OpenAI's meter.

How it works

Under the hood it's plain requests - no OpenAI SDK to install or wrestle with. It POSTs to https://api.openai.com/v1/images/generations for text_to_image, and to /v1/images/edits for the other five tasks, with your images re-encoded to PNG and attached as multipart form fields. The key comes from the api_key field or the OPENAI_API_KEY environment variable. It grabs the first frame of whatever IMAGE tensor you feed it, so a batched input's extra frames are silently ignored.

One detail I like: the node never hard-crashes your graph. If the API call fails it returns a 1×1 black image plus a debug_json string holding the actual error - the workflow keeps running and you read what went wrong instead of staring at a red exception.

The inputs that matter

Everything except the images is required:

  • task - the six modes: text_to_image, fabric_to_garment, fabric_replace, ootd, image_edit, front_to_back. Everything but text_to_image needs image1; two-image jobs (front-to-back, some edits) also take image2.
  • model - defaults to gpt-image-2. If your account doesn't have it enabled yet, this is the first thing you switch to gpt-image-1.
  • quality - low/medium/high/auto. The default is high, which is the expensive end of the meter; the README's own first-test advice is medium. Listen to it.
  • size - 1024x1024, 1024x1536 (the default, and the natural fit for garment shots), 1536x1024, or auto.
  • timeout_seconds - 30–600, default 180. If you're getting timeouts on slow generations, this is where you bump it.

Outputs: image (a normal IMAGE tensor - wire it to SaveImage or anything downstream) and debug_json, the second output the README tells you to read the moment something fails.

Installing

The README's official path is copy-the-folder, but a normal git clone works identically:

cd ComfyUI/custom_nodes
git clone https://github.com/starchoi/ComfyUI-OpenAI-Fashion-Bridge
pip install -r ComfyUI-OpenAI-Fashion-Bridge/requirements.txt

Restart ComfyUI and search for "OpenAI Fashion Bridge" (category OpenAI/Fashion). Requirements are just requests and Pillow - numpy and torch come from ComfyUI itself, so nothing heavy to babysit. Set your key with setx OPENAI_API_KEY "..." on Windows (or a normal env var on Linux/macOS) and fully restart, or paste it into the node for a quick throwaway test.

The catch

GPT Image is closed, filtered at the source, and metered. Everything you send - prompts and reference images - leaves your machine for OpenAI's servers, and whatever their content policy refuses, refuses; there are no weights to abliterate. That's the honest trade of every API-wrapper node: the right tool for a model you can't run locally, the wrong default for a job a local model could handle. If you'd rather not ship your product photos to a third party, that's a real reason to stay local - or to look at ComfyUI's official Partner Nodes, which cover OpenAI's models on prepaid credits through a vetted path.

One more practical warning: pasting the key into the node puts it inside the workflow JSON. Fine for a test, a leak waiting to happen if you ever share that file - use the environment variable instead. And since this category has an ugly history (an "LLM vision" node that stole API keys), the reassurance worth repeating: this pack's source is ~200 lines, and it calls exactly api.openai.com/v1 and nowhere else. I checked; it's clean. The check is yours to repeat.

If it fails

The README's failure list is short and real: wrong API key, no prepaid balance, gpt-image-2 not enabled on your account (switch to gpt-image-1), or image too large / request timed out. The debug_json output names the culprit, and it's the first place to look before the ComfyUI console. And remember - for fabric_replace, ootd, and front_to_back, success depends on your prompt and source images as much as the API. It's a bridge, not a magic wand.

CategoryOpenAI/Fashion

Inputs (10)

NameTypeDefaultDescription
taskCOMBO6 options: text_to_image, fabric_to_garment, fabric_replace, ootd, image_edit, front_to_back
promptSTRINGA high-fashion editorial image.—
modelSTRINGgpt-image-2—
sizeCOMBO1024x15364 options: 1024x1024, 1024x1536, 1536x1024, auto
qualityCOMBOhigh4 options: low, medium, high, auto
output_formatCOMBOpng3 options: png, webp, jpeg
api_keySTRING—
timeout_secondsINT18030–600—
image1optIMAGE—
image2optIMAGE—

Outputs (2)

NameTypeDescription
imageIMAGE—
debug_jsonSTRING—