ComfyUI Node

FAL GPT Image 2 (Soze)

Call OpenAI's gpt-image-2 from your graph, no OpenAI SDK needed

By SozeInc·Created 2 years ago·Updated 8 days ago· 10
FAL GPT Image 2 (Soze)
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_batch
  • mask
  • images
  • image_urls
  • image_count
  • status
prompt
image_sizeauto
qualityhigh
num_images1
output_formatpng
sync_modefalse

GPT Image 2 is the model that made "an image that has actual text in it" a solved problem, and the cleanest way to reach it from ComfyUI is through fal, the hosted GPU API. FAL GPT Image 2 is a one-node wrapper around openai/gpt-image-2/text-to-image - and it's smarter than a plain API call, because the moment you connect a reference image it silently switches to the edit endpoint instead. One node, two modes, zero code.

The catch up front: this is a paid API. No local model, no GPU load on your machine - you're renting fal's hardware, and every run costs you money at fal's per-image pricing. If you're expecting a free local node, stop reading; if you want a hosted frontier image model inside your graph, this is a well-built way to get it.

How it works

The flow is: your prompt (and any reference images) get uploaded to fal, the API does the work, and the results are downloaded back into ComfyUI as a real IMAGE batch - not a URL you have to fetch yourself. That's the nice part: downstream nodes like a preview, save, or upscaler just work.

The required inputs are the ones you'd expect: prompt, image_size (auto infers from input images in edit mode, or pick square, portrait_16_9, etc.), quality (auto/low/medium/high), num_images (1–8), and output_format (png/jpeg/webp). Worth knowing: a blank prompt doesn't error - the node skips cleanly and returns a placeholder, so a partially-wired workflow won't hard-crash mid-batch.

The optional inputs are where the mode-switching lives. Up to ten image_N slots, or an image_batch (individual slots win if both are connected). Connect any of them and the node hits the edit endpoint, passing your images as references. A mask input is sent as the edit mask. sync_mode makes fal return images as data URIs instead of public URLs - useful when you want everything self-contained rather than hosted on fal's CDN.

Outputs: images (the IMAGE batch), image_urls (newline-joined URLs), image_count, and status - and like the rest of the Soze pack, the node streams progress (uploading, submitting, downloading) live onto its own body so you're never staring at a frozen graph during a long generation.

Getting it running

Install the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt

Then the key part - the FAL_KEY. Grab one from the fal dashboard, then set it in your environment, or add it to a config.ini in the pack root under [API]:

[API]
FAL_KEY = your_key_here

A .env file in the repo root works too. If you see "FAL_KEY is not configured" on the node body, that's the first thing to fix - the node genuinely needs it, and there's no offline mode.

Gotchas

  • Upload failures are the classic failure mode: reference images that can't reach fal surface as per-slot errors in status, and if every upload fails the node says so plainly rather than sending a broken request.
  • Image sizes differ across outputs? The node aligns returned images into one batch so ComfyUI can handle them.
  • Cost: every num_images increment multiplies the bill. Set num_images deliberately, not on autopilot.
CategoryFAL/ImageGeneration

Inputs (18)

NameTypeDefaultDescription
promptSTRING
image_sizeCOMBOauto'auto' infers size (from input images in edit mode).
qualityCOMBOhigh4 options: auto, low, medium, high
num_imagesINT11–8
output_formatCOMBOpng3 options: png, jpeg, webp
image_1optIMAGEReference image slot 1. Connecting any image switches to edit mode. Overrides image_batch.
image_2optIMAGEReference image slot 2. Connecting any image switches to edit mode. Overrides image_batch.
image_3optIMAGEReference image slot 3. Connecting any image switches to edit mode. Overrides image_batch.
image_4optIMAGEReference image slot 4. Connecting any image switches to edit mode. Overrides image_batch.
image_5optIMAGEReference image slot 5. Connecting any image switches to edit mode. Overrides image_batch.
image_6optIMAGEReference image slot 6. Connecting any image switches to edit mode. Overrides image_batch.
image_7optIMAGEReference image slot 7. Connecting any image switches to edit mode. Overrides image_batch.
image_8optIMAGEReference image slot 8. Connecting any image switches to edit mode. Overrides image_batch.
image_9optIMAGEReference image slot 9. Connecting any image switches to edit mode. Overrides image_batch.
image_10optIMAGEReference image slot 10. Connecting any image switches to edit mode. Overrides image_batch.
image_batchoptIMAGEOptional IMAGE batch. Each frame is uploaded as a reference. Ignored if any image_N slot is connected.
maskoptMASKOptional mask (edit mode only). Sent as mask_url.
sync_modeoptBOOLEANfalseIf True, FAL returns images as data URIs instead of public URLs.

Outputs (4)

NameTypeDescription
imagesIMAGE
image_urlsSTRING
image_countINT
statusSTRING