Nodes/comfyui_bmad_nodes/FromListGet1Model
ComfyUI Node Runs on cloud

FromListGet1Model

Index into a model list without rebuilding the graph — FromListGet1Model

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
FromListGet1Model
  • list
  • MODEL
index0

FromListGet1Model is the model-flavored member of Bmad's "get one item by index" family. A MODEL list goes in, a single model comes out, and you choose which one with an integer. It sounds niche, and honestly it is - but it's the right tool for a specific pattern: comparing model merges or LoRA-stacked variants without keeping a dozen separate KSampler branches alive.

The thing to understand is that ComfyUI's graph is static. You can't feed a KSampler a "whichever model I feel like" - it wants one MODEL object on the wire. If you're testing five merges or five checkpoints, the blunt approach is five duplicated sampler branches. The list approach is: ToModelList gathers the candidates, FromListGet1Model picks one, one sampler handles all of them. Change the index, rerun, compare. It also plays well with a random int node if you want to sample through a pool of models.

How it works

Same machinery as every other FromListGet1X node, which is the GetSingleFromListMeta metaclass shared across the pack. It's declared with INPUT_IS_LIST, and the actual pick is one line:

index = index % len(list)
return (list[index],)

The modulo is worth internalizing: negative indexes walk backwards from the end (-1 = last model), and an out-of-range index wraps around rather than throwing. index 7 on a 3-item list returns item 1. This is a convenience for driving the node from a random or stepped counter - you never have to clamp. The only true failure is an empty list.

Inputs and outputs

  • list - a MODEL list, forceInput, so it must be wired from a list producer. ToModelList (same pack, Bmad/Lists/Make or Intercalate) is the usual source.
  • index - an INT, default 0, with a range that goes down to -2147483648 to accommodate negative indexing.
  • Output: one MODEL, straight into a KSampler or a LoRA loader.

There's no type gymnastics here - the model you get out is the exact object that went in, so sampling behavior, memory and all the rest are unchanged. This node just routes.

Install

Part of the bmad4ever/comfyui_bmad_nodes pack. Via ComfyUI Manager, search "comfyui_bmad_nodes" (shown as "Bmad Nodes"), install, restart. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_bmad_nodes
cd comfyui_bmad_nodes
pip install -r requirements.txt

Then restart ComfyUI. No model files to download - the requirements are opencv-python, scikit-image, simpleeval and gray2color, all pip-installable.

Common issues

Two things trip people up. First, model lists are an unusual type in stock ComfyUI - most packs don't produce them, so if you can't find a source for the list input, that's expected. You need ToModelList (or another Bmad list node) to create one; a bare model won't connect because the input is forceInput. Second, the wrap-around indexing. If you were expecting an out-of-range index to error out so you could detect it, it won't - the node silently cycles. For most "pick one of N" use cases that's a feature, but it's worth knowing before you debug a confusing result.

CategoryBmad/Lists/Get1

Inputs (2)

NameTypeDefaultDescription
listMODEL
indexINT0

Outputs (1)

NameTypeDescription
MODELMODEL