FL Fal GPT-Image-2 Edit
Multi-reference image compositing via OpenAI's gpt-image-2
- image_ref_1
- mask
- images
- image_urls
- status_msg
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.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| image_count | INT | 11–10 | — |
| prompt | STRING | A cozy scene with all these elements combined. | — |
| image_size | COMBO | auto | 8 options: auto, square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, +2 |
| custom_width | INT | 102464–4096 | — |
| custom_height | INT | 102464–4096 | — |
| quality | COMBO | high | 3 options: low, medium, high |
| num_images | INT | 11–4 | — |
| output_format | COMBO | png | 3 options: png, jpeg, webp |
| max_retries | INT | 31–5 | — |
| image_ref_1 | IMAGE | — | |
| maskopt | IMAGE | — | |
| sync_modeopt | BOOLEAN | false | — |
| retry_indefinitelyopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| image_urls | STRING | — |
| status_msg | STRING | — |