Nodes/ComfyUI DataBeast/DB Convert to Int
ComfyUI Node

DB Convert to Int

Cast a data value to a real integer for seeds and counts

By hanoixan·Created 2 years ago·Updated 2 years ago· 2
DB Convert to Int
  • 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 1 or 0
  • an int passes through
  • a float gets truncated, not rounded - int(3.9) is 3
  • 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, DBGetBatchListDBGetItemDBConvertToInt 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 get 3. 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 get 0, not an error. So a cfg: 3.5 value routed into this node yields 0, which is why the README's own guidance is to keep cfg on 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.

CategoryDataBeast

Inputs (1)

NameTypeDefaultDescription
inputDB_ITEMInput from a DBGet* node.

Outputs (1)

NameTypeDescription
outputINT