凤希AI - 获取资源图片
Pick one image from a list by index — and unlike its sibling, it refuses out-of-range picks
- 图片列表
- 图片
- 宽度
- 高度
FxAiImageSelectorByIndex does a deliberately small thing: give it an 图片列表 and an 索引, and it hands you that one 图片 plus its 宽度 and 高度. If that sounds like the pack's other single-frame node (FxAiImageGetSingle), look closer at the behavior - this one is stricter, and that strictness is the point.
The difference is how out-of-range indexes are handled. FxAiImageGetSingle silently wraps the index modulo the list length, so 5 on a 5-image list quietly becomes 0. This node refuses: if the index is negative or past the end of the list, it raises a RuntimeError telling you the valid range. In a batch pipeline where a wrong index would silently feed the wrong character reference into a video shot, failing loudly is the correct behavior - you want the run to stop so you notice. That's why it sits in the 凤希AI/角色 (character) category: it's built for the pack's character-asset workflows, where grabbing the wrong frame means the wrong face in the shot.
How it works
The node accepts either ComfyUI's standard [B, H, W, C] batch tensor or the pack's Python-list-of-frames format, normalizes it into a list of single frames, and picks the one at 索引. It reads the dimensions of the selected frame and returns all three outputs. Nothing gets resized or modified - it's a straight selection.
Inputs and outputs
- 图片列表 (IMAGE) - the batch or list to select from.
- 索引 (INT, default 0) - zero-based position in the list. Out of range → error.
Outputs: 图片 (IMAGE), 宽度 (INT), 高度 (INT). The width/height pair is the practical part - wire them into a resolution node so downstream sizing is computed, not retyped.
Installing it
Part of fxai-toolkit (凤希AI, MIT). Install via ComfyUI Manager (search "fxai-toolkit") or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
# restart ComfyUI
No models. The pack auto-installs soundfile and psutil on first load. Chinese labels; support via the author's QQ group (775649071) and Bilibili.
Where people get burned
The error-on-out-of-range is the feature, but it's also the friction: if your list length is dynamic (a loader feeding a folder whose contents change), an index that was fine yesterday breaks today. Handle it by driving the index from the list's count output rather than hard-coding a number, or use the modulo-wrapping sibling node if you genuinely want wrap-around. And remember the empty case - an empty list raises a RuntimeError rather than returning nothing, so don't feed it a folder with zero images and expect a graceful pass-through.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| 图片列表 | IMAGE | — | |
| 索引 | INT | 0 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 图片 | IMAGE | — |
| 宽度 | INT | — |
| 高度 | INT | — |