Nodes/ComfyUI Impact Pack/ImpactConvertDataType
ComfyUI Node Runs on cloud

ImpactConvertDataType

Coerce any value into STRING, FLOAT, INT, and BOOLEAN at once

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
ImpactConvertDataType
  • value
  • STRING
  • FLOAT
  • INT
  • BOOLEAN

ComfyUI's typed sockets are usually a good thing - they stop you from wiring an IMAGE into a MODEL slot by accident. They're a nuisance when you're building the logic and loop nodes Impact Pack's Logics (experimental) section provides (ImpactCompare, ImpactConditionalBranch, ImpactInt, ImpactBoolean, and friends) and a value from one part of the graph needs to land in a socket typed differently than wherever it came from. ImpactConvertDataType takes one input of any type and hands back all four common primitive representations at once, so you connect whichever output actually matches the socket you're feeding.

How it works

You wire in a value of essentially any type - a wildcard-typed connection, in ComfyUI's own terms - and the node attempts to represent it as a string, a float, an integer, and a boolean, all simultaneously. Which conversions are meaningful depends entirely on what you fed it: a numeric value converts cleanly across all four; a string converts trivially to STRING and may or may not parse sensibly as FLOAT/INT/BOOLEAN depending on its contents. You pick the output socket that matches what the downstream node actually wants and ignore the rest.

The input and outputs

  • value (*, required) - any typed value. This is the pack's wildcard type, the same mechanism the README's own "Limitation" section flags: it "will be replaced once ComfyUI officially supports dynamic types," and until then "type validation may still produce error messages" even when the connection works fine at runtime.

Four outputs, all computed from the same input: STRING, FLOAT, INT, BOOLEAN.

How to install it

Ships with the Impact Pack. ComfyUI Manager: search ComfyUI Impact Pack, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
pip install -r requirements.txt

then restart. No models - pure type conversion.

Common issues & troubleshooting

Type-mismatch warning even though the connection works. This is the wildcard-type caveat the README calls out directly for this style of node - the warning can appear even when execution runs fine, because ComfyUI's static type checker doesn't yet fully understand Impact Pack's * inputs. If your workflow runs and produces the right result, the warning is usually noise; only chase it further if the output value is actually wrong.

A numeric string doesn't convert the way you expect on INT or FLOAT. Conversion depends on the input being genuinely parseable as that type - a string like "12" converts fine, but arbitrary text won't. If you're feeding text that isn't meant to represent a number, only use the STRING output and ignore the others.

BOOLEAN output isn't what you'd expect. Boolean coercion from a non-boolean value follows whatever "truthy" rule the underlying conversion applies - don't assume it matches Python's bool() behavior on every type without checking the specific value you're feeding.

You only ever need one type. If you always know in advance which type a value should be, the dedicated single-purpose nodes (ImpactInt, ImpactFloat, ImpactBoolean) or Impact Pack's other logic primitives are more explicit and less likely to surprise you. Reach for this converter specifically when a value's downstream type isn't fixed, or when you want to route the same value to sockets expecting different types without rebuilding the connection each time.

CategoryImpactPack/Logic

Inputs (1)

NameTypeDefaultDescription
value*

Outputs (4)

NameTypeDescription
STRINGSTRING
FLOATFLOAT
INTINT
BOOLEANBOOLEAN