Adv Image Selector by Prompt -- HooToo
Pick Your Reference Images From the Prompt, Not a Rewire
- image_A
- image_B
- image_C
- image_D
- image_E
- image_F
- image_G
- image_H
- image_I
- image_J
- image_K
- image_L
- image_M
- image_N
- image_O
- output_1
- output_2
- output_3
- output_4
- output_5
- prompt
You've built a Qwen-Edit 2509 batch workflow with a pile of character and scene reference images wired in, and you're tired of rewiring the graph every time you want a different shot to use a different reference. That's exactly the job this node exists for. It's a switch, but the "switch" lives inside your prompt text: you tag each reference image with a keyword, then mention that keyword in your prompt and the right image flows through. Same idea as the Switch nodes in the rgthree-style utility packs, except the selection is prompt-driven instead of toggled by hand. It doesn't generate anything, it doesn't call an API, and it needs no key - it's pure plumbing, and plumbing is the whole point.
The README for the pack (from colorAi, the same author who posts on r/comfyui as Hongtao_A) is built around a single workflow: Qwen Edit 2509 with a TextEncodeQwenimageEditPlus encoder. If you're not running that, most of this node's value evaporates - worth knowing before you bother.
How it works
The mechanism is refreshingly simple once you read the source (image_selector_node.py). You write placeholders in your prompt using {@name} syntax, like 近景,{@A}和{@D}并肩坐在洒满阳光的地毯上…. A regex pulls out every {@...} in order, and each one is matched against your connected reference images. The first five matched images come out of output_1 through output_5, in the order the placeholders appear - not the order you wired the inputs. Meanwhile the node rewrites your prompt, swapping each {@A} for 参考图1, {@B} for 参考图2, and so on. That Chinese "reference image 1" label is the exact scheme Qwen-Edit's text encoder expects, which is why this slots in cleanly: the rewritten prompt goes straight into TextEncodeQwenimageEditPlus, and the images ride along on their own wires.
The inputs and outputs that matter
There are only two things you actually set. Everything else is optional and wires up in seconds:
prompt- the required multiline string holding your{@name}placeholders. This is where the selection happens.image_Athroughimage_Owith matchingname_Athroughname_O- up to 15 reference images. Leave a name empty and that image is addressed by its letter (A,B, …); set a name and you can write{@明日香}instead of{@A}.
The outputs are five IMAGE slots plus a STRING prompt output. Wire output_1…output_5 into the encoder's image inputs and the rewritten prompt into its text input, and you're done.
Install
No dependencies, no model downloads - the pyproject.toml lists zero dependencies and there's no requirements.txt, which makes this one of the rare custom nodes that can't drag your environment into dependency hell. Two ways in:
# ComfyUI Manager: search "Image Selector by Prompt"
cd ComfyUI/custom_nodes
git clone https://github.com/colorAi/comfyui-ImageSelectorbyPrompt
Restart ComfyUI, search the node menu for "Adv Image Selector by Prompt -- HooToo" (the display name is more ornate than the node deserves), and you're set.
Gotchas
Three things will bite you, all visible in the source. First, a placeholder that doesn't match any connected image doesn't error - it silently emits a 64×64 black image. Feed that into the encoder and your "missing reference" becomes a black patch in the output, which is at least a loud clue. Second, only the first five placeholders in your prompt get images; if you write {@A}{@B}{@C}{@D}{@E}{@F}, the sixth is dropped while your rewritten prompt still references 参考图6. Keep your prompt to five placeholders or fewer. Third, custom-name matching is exact, so {@asuka} won't find 明日香 - the letters are the more forgiving path.
It's a niche tool with a narrow audience: if you're batch-producing shots with per-shot character references in Qwen Edit, it genuinely saves you from rewiring, and the zero-dependency install is a relief. If you're not on that workflow, it's just a curiosity. The author also built a standalone front-end doing the same thing outside ComfyUI (linked in the README), if that workflow sounds good but the graph doesn't.
Inputs (31)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A photo of {@cat_image} and {@dog_image}. | — |
| image_Aopt | IMAGE | — | |
| name_Aopt | STRING | — | |
| image_Bopt | IMAGE | — | |
| name_Bopt | STRING | — | |
| image_Copt | IMAGE | — | |
| name_Copt | STRING | — | |
| image_Dopt | IMAGE | — | |
| name_Dopt | STRING | — | |
| image_Eopt | IMAGE | — | |
| name_Eopt | STRING | — | |
| image_Fopt | IMAGE | — | |
| name_Fopt | STRING | — | |
| image_Gopt | IMAGE | — | |
| name_Gopt | STRING | — | |
| image_Hopt | IMAGE | — | |
| name_Hopt | STRING | — | |
| image_Iopt | IMAGE | — | |
| name_Iopt | STRING | — | |
| image_Jopt | IMAGE | — | |
| name_Jopt | STRING | — | |
| image_Kopt | IMAGE | — | |
| name_Kopt | STRING | — | |
| image_Lopt | IMAGE | — | |
| name_Lopt | STRING | — | |
| image_Mopt | IMAGE | — | |
| name_Mopt | STRING | — | |
| image_Nopt | IMAGE | — | |
| name_Nopt | STRING | — | |
| image_Oopt | IMAGE | — | |
| name_Oopt | STRING | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| output_1 | IMAGE | — |
| output_2 | IMAGE | — |
| output_3 | IMAGE | — |
| output_4 | IMAGE | — |
| output_5 | IMAGE | — |
| prompt | STRING | — |