Nodes/KIE.ai Nodes Next/Flux-2 - Image to Image
ComfyUI Node

Flux-2 - Image to Image

Multi-image editing by index number

By felipederosilva·Created about a month ago·Updated a day ago· 3
Flux-2 - Image to Image
  • input_urls
  • image
  • url
  • all_urls_json
  • task_id
  • raw_json
  • credits_consumed
  • credits_left
◄promptReplace the can in image 2 with the can from image 1►
◄aspect_ratio1:1►
◄resolution1K►
◄nsfw_checkerfalse►
◄timeout_seconds1200►
◄callback_url►

Instruction editing ate most of the traditional img2img job over the last year - Kontext, Qwen-Image-Edit and Klein mean you now describe the change instead of fighting a denoise slider. FLUX.2 does generation and editing in one model with up to ten reference images, which is the capability that makes it interesting: properly compositing, not just restyling one picture.

This node is the Flex tier of that, and its default prompt tells you exactly what it's for. It ships as "Replace the can in image 2 with the can from image 1."

How it works

input_urls is where the magic is. It's an IMAGE socket, and the field name is plural, so a ComfyUI image batch - two, three, five images stacked - gets uploaded frame by frame and sent as a list of URLs. The model then refers to them positionally: image 1, image 2, and so on, in the order they came out of the batch.

The rest is the usual hosted round trip. KIE runs the job, the node polls it, downloads the result, and returns a native IMAGE tensor that behaves like any other image in the graph.

That positional reference is the whole interface. There's no masking, no region selection, no control image - you're writing English about numbered inputs, and the model decides what "the can" means. When it works it's startling; when it doesn't, the fix is almost always a more specific prompt, not a different node.

Inputs

input_urls - required. Wire a batch here. Build the batch in the order you want the indices to fall: image 1 is batch position 1.

prompt - required, 3 to 5000 characters. Name the images by number and say what moves where. "Put the jacket from image 2 on the person in image 1, keep the background of image 1" is the register it wants.

aspect_ratio - dropdown, default 1:1, with auto meaning "match the first input image." On an editing node auto is usually the right answer, since you want the edit to come back in the shape you fed it. If you set it explicitly you're asking the model to reframe, which is a different job.

resolution - dropdown, default 1K. Higher means more detail and a bigger bill.

nsfw_checker - defaults to false, which per the tooltip means KIE's content filtering is off and the model's output comes back as-is. There's no promise it filters everything when enabled either; it's a mitigation, not a guarantee.

Plus timeout_seconds (default 1200) and callback_url (empty, for webhook people).

Outputs

image is the edited result as a native tensor. url is the hosted copy, all_urls_json lists every URL returned, task_id names the job, raw_json is the provider response for debugging, and credits_consumed / credits_left are floats - the node also displays both on its body after each run.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next

Or find it in ComfyUI Manager as "KIE.ai Nodes Next". Restart. Requirements are requests, Pillow, numpy, PyYAML - no weights, because the model is remote. Add the key once under Settings → KIE.ai Nodes Next → Connection; it's validated before being saved and never lands in your workflow file. KIE_API_KEY still wins for headless installs.

Practical notes

  • Uploads happen automatically. You never touch URLs: whatever is on the socket is converted to PNG and pushed to KIE before the request, and the hosted URL goes in the payload.
  • Repeated edits degrade. The recurring complaint about full-image editors is that they shift details you didn't ask about and soften the picture after a few passes. Keep an untouched original in the graph and re-edit from it rather than chain edits through the output.
  • Keep the batch small and deliberate. Reference-order mistakes are the number one cause of "the model did something insane," and a five-image batch is five chances to get the order wrong.
  • Unresolved endpoint errors mean the live catalog sync hasn't filled in this op yet - restart ComfyUI or run the pack's catalog refresh node.
CategoryKIE Next/Image/Black Forest Labs/Flux 2

Inputs (7)

NameTypeDefaultDescription
input_urlsIMAGE—
promptSTRINGReplace the can in image 2 with the can from image 1 Must be between 3 and 5000 characters. (Max length: 5000 characters)
aspect_ratioCOMBO1:1Aspect ratio for the generated image. Select 'auto' to match the first input image ratio (requires input image).
resolutionCOMBO1KOutput image resolution.
nsfw_checkeroptBOOLEANfalseDefaults to false. You can set it to false based on your needs. If set to false, our content filtering will be disabled, and all results will be returned directly by the model itself. Note: There is no guarantee that everything can be filtered out; if you are not satisfied with the results, you will need to make your own arrangements.
timeout_secondsoptINT120030–7200—
callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

Outputs (7)

NameTypeDescription
imageIMAGE—
urlSTRING—
all_urls_jsonSTRING—
task_idSTRING—
raw_jsonSTRING—
credits_consumedFLOAT—
credits_leftFLOAT—