Recourse (IMAGE)...
Swap your img2img source without touching a single wire
- img_opt_a
- img_opt_b
- img_opt_c
- img_opt_d
- img_opt_e
- img_opt_f
- img_opt_g
- img_opt_h
- IMAGE
RecourseImage is the most boring node in the comfyui-selector pack, and I mean that as a compliment. It takes up to eight IMAGE inputs and passes through the first one that's actually carrying data. That's the entire job. No model detection, no numbers to sync, no trickery - and that simplicity is exactly why you'll reach for it more than you expect.
The use case: you're iterating on an img2img workflow and you keep swapping the input image to test a different source, a different style reference, a previous output you want to remix. Normally that means rewiring the image input of your Load Image or whatever feeds the sampler. With RecourseImage you pre-wire your candidates into img_opt_a through img_opt_h, then just disconnect the ones you don't want - the node walks the ports in order and serves the first live one. It's a small thing, but in a graph with a dozen nodes between the image and the sampler, "unplug one wire instead of retracing the whole chain" adds up fast.
How it works
Under the hood it's the same "recourse" logic the whole pack runs on: for each type, take the lowest-numbered input that has a signal, and emit it. img_opt_a wins if it's connected, otherwise img_opt_b, and so on down to h. Because every input is the IMAGE type - no wildcard anything here - ComfyUI still type-checks your wires, so you can't accidentally feed it a latent and get silence later.
Inputs & outputs that matter
Honestly, only one input and one output matter:
- img_opt_a … img_opt_h (IMAGE, all optional) - your candidate images, in priority order.
- IMAGE output - the first live one, ready for a
VAE Encode, a ControlNet preprocessor, or a KSampler's latent pipeline.
You'll rarely use more than three of the eight ports. The rest are headroom.
Pair it with the pack's other nodes
This node shines in the same graphs as the rest of the pack. Let a RecourseCkpt pick the model and broadcast MODEL_TYPE, and let RecourseImage carry whichever reference image survives - both are "first active wins" failsafes, so a workflow built from them keeps running when something upstream fails rather than dying on an empty port. The README's framing ("safety first") is literally this.
Installing it
Same routine as every node in this pack, which means trivial. ComfyUI Manager → search comfyui-selector → install → restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/exdysa/comfyui-selector
Then restart ComfyUI. It appears under Selector_Recourse/Recourse. No requirements.txt, no model downloads, no network access - pure Python on ComfyUI's own types.
Gotchas
- "First live input" means lowest port number, not "whichever is newest." If both
img_opt_aandimg_opt_bare connected,aalways wins. Unplug the ones you don't want; that's the whole UX. - It only cares whether a port is connected, not whether the image is "good." A black frame or a corrupted load is still a signal and will be passed through. The node is a connection failsafe, not a content judge.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| img_opt_aopt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_bopt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_copt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_dopt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_eopt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_fopt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_gopt | IMAGE | The lowest number port with an active signal is used. | |
| img_opt_hopt | IMAGE | The lowest number port with an active signal is used. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |