凤希AI - 角色资源单张图片获取
Pull one frame out of a character image batch by index
- 图片列表
- 输出图片
Small node, single job: give it an IMAGE batch and an index, get back the one image at that position. FxAiCharacterImageByIndex (凤希AI - 角色资源单张图片获取) is the "extract a single frame" utility in the pack's character toolbox, the inverse of the batch loaders that gather many images into one tensor. If the pack's FxAiCharacterBatchLoad loads your character's four poses as a batch, this is how you then feed pose #2 alone to a reference-aware node or a ControlNet preprocessor that wants exactly one image.
How it works
There's almost nothing to it, which is the appeal. It takes 图片列表 (an IMAGE, which in ComfyUI terms is a batched tensor where each frame is an image) and 索引 (index, default 0, min 0), and returns 图片列表[索引] - the single frame at that position, as its own IMAGE. The one safety feature is that it refuses to go out of bounds: an index at or past the batch length raises a clear error telling you the count and the max valid index, instead of wrapping around or returning garbage. That's friendlier than it sounds - a silent wrong frame in a character pipeline means a stranger's face in your scene, and you'd debug it for an hour before suspecting the index.
Where it fits
You'll mostly see it in two places:
- Multi-pose character workflows. Batch-load all of a character's poses, then select one per scene with this node (or drive the index from the pack's controllers so the scene number picks the pose).
- Reference selection. When a node needs a single reference image but your upstream only produces batches, this is the one-line extraction.
It's in the 凤希AI/工具 (tools) category rather than the character category, which is the author's way of saying it's a general index-grabber that happens to be character-flavored. It works on any image batch, character or not.
Install
Part of fxai-toolkit (凤希全能节点包), MIT-licensed, by 凤希AI. ComfyUI Manager (search "fxai") or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxai666/fxai-toolkit
# restart ComfyUI
Pack auto-installs soundfile and psutil; no models.
Gotchas
- Index is 0-based and the error message tells you the max usable index (count minus one). Read it before you re-check your math.
图片列表accepts multiple connections, so you can merge batches upstream - but the node returns one image, period. For "give me images 2 and 5," use two of these, or the batch slice nodes.- No IS_CHANGED tricks here: it's a deterministic pure function, so ComfyUI caches it normally. If it doesn't re-run when you change the index, you're looking at the classic "index is a baked widget, not an input" moment - convert the widget to an input if the index needs to come from elsewhere.
- Chinese labels: 索引 = index, 输出图片 = output image.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| 图片列表 | IMAGE | — | |
| 索引 | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 输出图片 | IMAGE | — |