Nodes/ComfyUI_Fill-Nodes/FL Fal GPT-Image-2 Edit
ComfyUI Node

FL Fal GPT-Image-2 Edit

Multi-reference image compositing via OpenAI's gpt-image-2

By filliptm·Created 3 years ago·Updated a day ago· 630
FL Fal GPT-Image-2 Edit
  • image_ref_1
  • mask
  • images
  • image_urls
  • status_msg
api_key
image_count1
promptA cozy scene with all these elements combined.
image_sizeauto
custom_width1024
custom_height1024
qualityhigh
num_images1
output_formatpng
max_retries3
sync_modefalse
retry_indefinitelyfalse

OpenAI's newest image model, gpt-image-2, reached through Fal.ai rather than OpenAI directly - and built specifically for compositing multiple reference images against one prompt rather than single-image edits. Think "here's a person, here's a jacket, here's a background, put them together" in one call.

The mechanism

image_count controls how many reference-image sockets the node exposes - raise it and more image_ref_N inputs appear, dynamic-socket style, the same pattern this pack uses on a few of its other multi-image API nodes. Every reference you plug in gets composed against the single shared prompt through Fal's openai/gpt-image-2/edit endpoint. Unlike some of this pack's other multi-image nodes, at least one reference (image_ref_1) is required - this is an editing/compositing tool by design, not a pure text-to-image node. mask (optional) restricts the edit to a specific region if you want part of the composite left untouched.

Inputs and outputs that matter

api_key is your Fal.ai key, required with no environment-variable fallback shown here. image_count (1-10) sets how many reference images you're feeding in. prompt is the shared instruction across all of them. image_size is either auto, one of six fixed presets (square_hd, square, portrait/landscape at 4:3 and 16:9), or custom - which is the only case where custom_width/custom_height (64-4096px each) actually apply; leave image_size on a preset and those two fields are dead weight. quality (low/medium/high) is the cost/speed lever - high costs the most. num_images (1-4) sets outputs per call, output_format is png/jpeg/webp, and max_retries (1-5) handles transient failures. retry_indefinitely is the nuclear option for a call that keeps failing - use it deliberately, since paired with a flaky connection it'll just burn API calls in a loop.

Outputs: images, image_urls (the Fal-hosted URLs), and status_msg.

Installing it

ComfyUI Manager: search Fill-Nodes, install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/filliptm/ComfyUI_Fill-Nodes, then restart.

Where people get burned

image_count and the number of reference sockets you've actually wired need to match - set it to 3 and only fill in two, and you'll either get an error or a silently-ignored third slot depending on validation, so keep the count honest. And custom_width/custom_height only mean anything once image_size is explicitly set to custom - a common miss is setting a custom size and forgetting to flip that switch, and getting a preset dimension instead of what you configured.

Category🏵️Fill Nodes/AI

Inputs (14)

NameTypeDefaultDescription
api_keySTRING
image_countINT11–10
promptSTRINGA cozy scene with all these elements combined.
image_sizeCOMBOauto8 options: auto, square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, +2
custom_widthINT102464–4096
custom_heightINT102464–4096
qualityCOMBOhigh3 options: low, medium, high
num_imagesINT11–4
output_formatCOMBOpng3 options: png, jpeg, webp
max_retriesINT31–5
image_ref_1IMAGE
maskoptIMAGE
sync_modeoptBOOLEANfalse
retry_indefinitelyoptBOOLEANfalse

Outputs (3)

NameTypeDescription
imagesIMAGE
image_urlsSTRING
status_msgSTRING