DB Convert to Int
Cast a data value to a real integer for seeds and counts
- input
- output
Seeds, frame counts, batch sizes - ComfyUI has a real INT type and a pile of nodes that want it. The DBGet* family in the DataBeast pack only speaks strings, so DBConvertToInt exists to cast a data-file value into an INT you can plug straight into a seed widget or a count.
The rules
Like its float sibling, this node unwraps the DBItem and casts by type:
- a boolean becomes
1or0 - an int passes through
- a float gets truncated, not rounded -
int(3.9)is3 - a string goes through Python's
int(), so"42"works - anything unparseable defaults to
0
One input (input - DB_ITEM), one output (output - INT). In a typical batch flow, DBGetBatchList → DBGetItem → DBConvertToInt turns a seed column in your data file into the actual seed each run uses.
Where it bites
Two traps, both silent:
- Float-to-int truncates. If your data file says
seed: 3.9, you get3. Usually fine for seeds, but if you needed rounding, cast to float first and round elsewhere. - String int parsing is strict.
int("3.9")raises, and the exception is swallowed - you get0, not an error. So acfg: 3.5value routed into this node yields0, which is why the README's own guidance is to keepcfgon the float converter and reserve this one for genuinely integer data. Clean integer strings only.
This is the pattern across the whole DataBeast pack: quiet failures. The node never throws in your face; it just gives you 0 and lets your workflow run on nonsense. When a seed-controlled batch starts producing identical images or weird counts, check what your data file is actually handing this node.
Installing
It's part of ComfyUI DataBeast, which is not in ComfyUI Manager yet - clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/hanoixan/ComfyUI-DataBeast
cd ComfyUI-DataBeast
pip install -r requirements.txt
Restart and it lives under the DataBeast category. Dependencies are just pyyaml and RestrictedPython; no models to download. If you saved graphs on the V0.1 alpha, V0.2 changed DBConvert* to expect a DBItem from a DBGet* node, so re-check old wiring.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input | DB_ITEM | Input from a DBGet* node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | INT | — |