Extensions/Basic data handling
ComfyUI Extension

Basic data handling

Basic Python functions for manipulating data that every programmer is used to. Currently supported: BOOLEAN, FLOAT, INT, STRING and data lists.

By StableLlama·Created about a year ago·Updated about a month ago· 47
StableLlama/ComfyUI-basic_data_handling
Nodes309
On cloudLocal install
CategoryBasic/BOOLEAN, Basic/cast
Stars47
Updatedabout a month ago

Nodes (309)

and

Proceed only if both of these are true

Basic/BOOLEAN
nand

The gate nobody needs, for when you need the gate

Basic/BOOLEAN
nor

The strictest gate in the boolean family — true only when all is false

Basic/BOOLEAN
not

Flip any boolean, fix any backwards checkbox

Basic/BOOLEAN
or

Proceed if any of these are true

Basic/BOOLEAN
xor

The difference detector disguised as a logic gate

Basic/BOOLEAN
to BOOLEAN

Turn any old value into a clean true/false

Basic/cast
to DICT

Getting structured data into a DICT when the socket won't take it

Basic/cast
to FLOAT

The 'please be a decimal' node

Basic/cast
to INT

Make it a whole number — but know it truncates, it doesn't round

Basic/cast
to LIST

Wrap anything into one Python list that travels as a single value

Basic/cast
to SET

Dedupe anything in one step — order be damned

Basic/cast
to STRING

The node that lets you print, name, and debug anything

Basic/cast
compare length

Is that prompt too long? compare length answers it, and hands you the real count

Basic/comparison
continue flow

A dead-simple kill switch for a whole branch

Basic/flow control
all

One boolean for 'every item passed' — and an empty list is True

Basic/Data List
any

The 'at least one passed' check that keeps a batch alive

Basic/Data List
append

Add one item to the end of a data list, return a new list

Basic/Data List
contains

The membership test that turns 'is it in the list?' into a boolean

Basic/Data List
count

How many of these made it through? Ask, don't eyeball.

Basic/Data List
create Data List

Run a whole batch without duplicating a single node

Basic/Data List
create Data List from BOOLEANs

Build a BOOLEAN list from toggles — feed a mask without touching Python

Basic/Data List
create Data List from FLOATs

Build a FLOAT list from plain numbers — decimal values, batch-ready

Basic/Data List
create Data List from INTs

Build an INT list from plain numbers — the dynamic-input list builder

Basic/Data List
create Data List from STRINGs

Build a STRING list from text boxes — prompt batches without the regex gymnastics

Basic/Data List
enumerate

Add numbers to a list — Python's enumerate, in graph form

Basic/Data List
extend

Merge two data lists into one, the non-nesting way

Basic/Data List
filter

Filter a list with a boolean mask — and yes, the polarity is inverted

Basic/Data List
filter select

Split a list into kept and dropped — both branches, no polarity traps

Basic/Data List
first

Grab the head of a data list — or None if it's empty

Basic/Data List
get item

Pull any position out of a list — negative indices work too

Basic/Data List
index

Find where a value lives in a list — -1 when it's not there

Basic/Data List
insert

Put an item at any position — not just the end

Basic/Data List
last

Last item in the list, minus the off-by-one panic

Basic/Data List
length

How big is that list? Ask instead of guessing

Basic/Data List
create Data List of Lists

Build a list of lists, item by item

Basic/Data List
max

The biggest number in your list, without sorting for it

Basic/Data List
min

Find the floor of your list of numbers

Basic/Data List
pop

Pop an item off a list and keep the leftover list too

Basic/Data List
pop random

Pull a random item out of a list, reproducibly

Basic/Data List
range

Generate a sequence of numbers, Python-style

Basic/Data List
remove

Delete the first match of a value from your list

Basic/Data List
reverse

Flip a list end to end in one step

Basic/Data List
set item

Swap one item in a list without rebuilding it

Basic/Data List
shuffle

Randomize a list, and make the shuffle reproducible

Basic/Data List
slice

Grab a chunk of a list, not the whole thing

Basic/Data List
sort

Sort a list, ascending or descending, in one node

Basic/Data List
sum

Total up a list of numbers, as both int and float

Basic/Data List
convert to LIST

Convert a data list into a single LIST variable

Basic/Data List
convert to SET

Convert a list into a SET — say goodbye to duplicates

Basic/Data List
zip

Zip parallel lists together, element by element

Basic/Data List
compare

Diff two dictionaries and see exactly what changed

Basic/DICT
contains key

Does this dictionary have that key? Yes or no

Basic/DICT
create DICT

Build config dicts without leaving the graph

Basic/DICT
create DICT from BOOLEANs

Build a dict where you know the values are real booleans

Basic/DICT
create DICT from FLOATs

Float values in a dict, guaranteed — for the config that does math

Basic/DICT
create DICT from INTs

Integer values, locked in — build a dict that won't turn your counts into floats

Basic/DICT
create from items (data list)

Turn a pile of key-value pairs into a dict — the data list version

Basic/DICT
create from items (LIST)

From a LIST of pairs to a dict — the pair-collector that round-trips

Basic/DICT
create from LISTs

Zip two lists into a dict — keys from one, values from the other

Basic/DICT
create DICT from STRINGs

All-string dicts, cleanly typed — when every value is text

Basic/DICT
exclude keys

Cut keys out of a dict without touching the original

Basic/DICT
filter by keys

Keep only the keys you name — a whitelist for your dict

Basic/DICT
from keys

Every key, one shared value — and the mutable-default trap to avoid

Basic/DICT
get

Pull a value out of a dict without crashing when the key's missing

Basic/DICT
get keys values

Split a dict into its keys and values — two parallel lists out

Basic/DICT
get multiple

Fetch several dict values in one shot — keys in, a values list out

Basic/DICT
invert

Flip a dict — keys become values, values become keys

Basic/DICT
items

Unfold a dict into key-value pairs — the round-trip enabler

Basic/DICT
keys

Just the key names, please — a dict's labels as a LIST

Basic/DICT
length

How many entries is that dict? — the count that feeds your logic

Basic/DICT
merge

Merge up to four dicts, and the later one always wins

Basic/DICT
pop

Pop one entry out — get the value AND the trimmed dict back

Basic/DICT
pop item

Need something out of a dict, and want to know what you got? pop item's the one

Basic/DICT
pop random

Grab a random key-value pair out of a dict — reproducible when you want it

Basic/DICT
remove

Remove a key from a dict without ever seeing a KeyError

Basic/DICT
set

Add or update a key in a dict the way Python would — one node, one line

Basic/DICT
setdefault

Give me the value, or put this default in for me — setdefault is both at once

Basic/DICT
update

Merge two dicts and know exactly who wins the tie

Basic/DICT
values

All the values out of a dict in one shot — no keys attached

Basic/DICT
==

Is this the same as that? The == node for any two values in your graph

Basic/comparison
force execution order

Two nodes are racing and you're losing. Force a finish line.

Basic/flow control
add

Two floats in, one sum out — arithmetic without the mental gymnastics

Basic/FLOAT
integer ratio

The exact fraction hiding inside every float

Basic/FLOAT
create FLOAT

Type a number as text, get a float out — the string-to-number escape hatch

Basic/FLOAT
divide

Divide floats — and know that zero will kill it on purpose

Basic/FLOAT
divide (zero safe)

The zero-safe division node

Basic/FLOAT
from hex

Read a hex float back to a number — the exact opposite of rounding

Basic/FLOAT
to hex

Turn a float into its exact hex form — lossless text, no rounding

Basic/FLOAT
is integer

3.0 is an integer, 3.5 isn't — the float reality check

Basic/FLOAT
multiply

Scaling values in your graph without a calculator trip

Basic/FLOAT
power

Powers, roots, and reciprocals in one node

Basic/FLOAT
round

Rounding in ComfyUI is way more annoying than it should be. This is the fix.

Basic/FLOAT
subtract

The minus sign you keep hunting for in your graph

Basic/FLOAT
flow select

The node that routes a value AND decides what runs next

Basic/flow control
force calculation

Force ComfyUI to actually re-run its own graph

Basic/flow control
and (generic)

An AND gate that doesn't care what you feed it

Basic/BOOLEAN
or (generic)

OR with Python's truthiness, not just booleans

Basic/BOOLEAN
>

A plain > comparison node that accepts either number type

Basic/comparison
>=

The comparison node for 'at least this much'

Basic/comparison
if/elif/.../else

Real if/elif/else, without contorting your graph into a switch

Basic/flow control
if/else

Pick a path at runtime — and only compute the branch you actually take

Basic/flow control
add

Adding integers in ComfyUI without reaching for a math node

Basic/INT
bit count

The node that counts 1-bits for no good reason until you need it

Basic/INT
bit length

How many bits does this integer actually need?

Basic/INT
create INT

Create INT parses number strings

Basic/INT
create INT with base

Create INT with a base you choose

Basic/INT
divide

Divide that rounds down — and refuses to divide by zero

Basic/INT
divide (zero safe)

The 'infinity' trick

Basic/INT
from bytes

Turn raw bytes back into a number you can do math with

Basic/INT
modulus

The remainder node — what's left after you divide

Basic/INT
multiply

Multiply two integers and get back an integer, on purpose

Basic/INT
power

2 to the 10th, without the math node

Basic/INT
subtract

Subtraction, the boring node that keeps your math integer-typed

Basic/INT
to bytes

Pack an integer into raw bytes, byte order and all

Basic/INT
is connected

A node that answers 'is this wire actually plugged in?'

Basic/flow control
is null

'Why is this node silent?' — that's usually None hiding in your workflow

Basic/comparison
<

The < node for upper-bound checks

Basic/comparison
<=

The <= node nobody searches for, and the whole workflow it unlocks

Basic/comparison
all

All — the list node that turns an AND gate into one input

Basic/LIST
any

Any — the OR gate you apply to a whole list at once

Basic/LIST
append

Append — build a list one item at a time without mutating anything

Basic/LIST
contains

Contains — the membership test that ends 'is it in the list?' guesswork

Basic/LIST
count

Count — how many times does that value actually show up?

Basic/LIST
create LIST

Create LIST — the starting line for every list in your workflow

Basic/LIST
create LIST from BOOLEANs

Create LIST from BOOLEANs — a typed list that can't quietly drift

Basic/LIST
create LIST from FLOATs

Create LIST from FLOATs — decimals in, decimals out, no cast drama

Basic/LIST
create LIST from INTs

Create LIST from INTs — typed slots that catch your rounding mistakes

Basic/LIST
create LIST from STRINGs

Create LIST from STRINGs — the list type that swallows everything

Basic/LIST
enumerate

Enumerate — give every item a seat number

Basic/LIST
extend

Extend — the append you meant when you had two lists

Basic/LIST
first

First — the head of the list, without the off-by-one ceremony

Basic/LIST
get item

Get item — reach into a list and pull out exactly one thing

Basic/LIST
index

Index — find where something lives, or get a -1 that means 'nowhere'

Basic/LIST
insert

Insert — put an item in the middle, not just at the end

Basic/LIST
last

Last — the tail of the list, when the end is what matters

Basic/LIST
length

Length — the node that tells you how big your list actually is

Basic/LIST
max

Max — the biggest value in the list, with a merciful failure mode

Basic/LIST
min

The smallest item in your LIST, without the crash

Basic/LIST
pop

Pop items off a list like it's 1995

Basic/LIST
pop random

Grab a random item out of a list, reproducibly

Basic/LIST
range

Generate number sequences on the fly

Basic/LIST
remove

Delete the first match — and know whether it worked

Basic/LIST
reverse

Flip a list around in one click

Basic/LIST
set item

Replace the item at any position in a list

Basic/LIST
shuffle

Shuffle a list with a seed you can trust

Basic/LIST
slice

Cut a list down to just the slice you need

Basic/LIST
sort

Sort your list — and don't trip over the silent failure

Basic/LIST
sum

Add up a whole list in one go

Basic/LIST
convert to Data List

The bridge from LIST to ComfyUI's native data list

Basic/LIST
convert to SET

Deduplicate a list by turning it into a SET

Basic/LIST
abs

Strip the sign off any number

Basic/maths
acos

Given a ratio, get the angle

Basic/maths
asin

Given a ratio, get the angle

Basic/maths
atan

The angle whose tangent is your number

Basic/maths
atan2

The quadrant-aware angle from x and y

Basic/maths
ceil

Round up, every time, to the nearest whole number

Basic/maths
cos

Cosine of an angle — and the 90° gotcha

Basic/maths
degrees

Radians to degrees in ComfyUI, minus the mental math

Basic/maths
e (2.71828)

E, the constant node you'll forget exists until you need it

Basic/maths
exp

Your cheapest exponential curve builder

Basic/maths
floor

The int conversion that rounds the direction you expect

Basic/maths
formula

A math expression node that refuses to eval() you

Basic/maths
log

Natural logarithms when your schedule is exponential under the hood

Basic/maths
log10

Base-10 logs for when you're thinking in magnitudes

Basic/maths
max

The 'pick the bigger one' node that ends your clamp chains

Basic/maths
min

The ceiling you clamp to when things get too big

Basic/maths
pi (3.14159)

The constant you don't need to memorize

Basic/maths
radians

Stop doing the math by hand

Basic/maths
sin

Smooth waves without leaving degrees behind

Basic/maths
sqrt

Square roots for when a value needs to be a root

Basic/maths
tan

The trig node that knows when it's undefined

Basic/maths
!=

The 'is this different' check for value switches

Basic/comparison
in range

One node instead of a two-comparison tangle

Basic/comparison
abspath

Turning relative paths into ones you can trust

Basic/Path
basename

Stripping a path down to the filename

Basic/Path
common prefix

Finding what two paths share

Basic/Path
dirname

The folder half of any path

Basic/Path
exists

Does that file actually exist? Stop guessing, wire it in

Basic/Path
expand vars

Paths with $HOME and %USERPROFILE% that work on any machine

Basic/Path
get current working directory

What folder is ComfyUI actually running in?

Basic/Path
get extension

Grab the .png off a filename — no regex required

Basic/Path
get size

File size in bytes, so your workflow can make decisions

Basic/Path
glob

Grab every *.png in a folder with one node

Basic/Path
input dir

Stop hardcoding the ComfyUI input folder path

Basic/Path
is absolute

Absolute or relative? Ask the node instead of squinting

Basic/Path
is dir

Is that path a folder? Ask instead of guessing

Basic/Path
is file

Is that path a file? The node that answers

Basic/Path
join

Join path pieces the OS-safe way — no more missing slashes

Basic/Path
list dir

List everything in a folder — files only, dirs only, or both

Basic/Path
load IMAGE from file (RGB)

Load an image from any path — not just the input dropdown

Basic/Path
load IMAGE+MASK from file (RGBA)

Load an image and its alpha channel as a ready-to-use mask

Basic/Path
load MASK from alpha channel

Turn an RGBA file's alpha channel into a mask

Basic/Path
load MASK from greyscale/red

A mask from a greyscale file — or the red channel, if you prefer

Basic/Path
load STRING from file

Read a prompt or config from a text file mid-workflow

Basic/Path
normalize

Clean up messy paths without a regex in sight

Basic/Path
output dir

Where did your image actually go? Stop guessing the output folder

Basic/Path
relative

Get a path relative to another folder — or to your cwd

Basic/Path
save IMAGE to file

Save your output to a path you choose, in the format you want

Basic/Path
save IMAGE+MASK to file

Save a cutout with its mask baked into the alpha channel

Basic/Path
save STRING to file

Get a string out of ComfyUI and into a real file

Basic/Path
set extension

Swap a file extension without touching the rest of the path

Basic/Path
split

Pull the folder and the filename apart

Basic/Path
splitext

Strip the extension off a filename, properly

Basic/Path
find all (data list)

Regex findall, as a data list ComfyUI can actually fan out

Basic/STRING/regex
find all (LIST)

Regex findall when you want the results as one LIST, not fanned out

Basic/STRING/regex
search named groups

Turn a prompt or filename into a labeled dictionary

Basic/STRING/regex
search groups (data list)

Grab the capture groups from a match, as a data list

Basic/STRING/regex
search groups (LIST)

Capture groups as one LIST you can index later

Basic/STRING/regex
split (data list)

Split a string on a regex, and fan the pieces out

Basic/STRING/regex
split (LIST)

Regex split into a single LIST, for when order is the data

Basic/STRING/regex
substitute

Find-and-replace with a regex, the way your data actually needs

Basic/STRING/regex
test

Does this string match? The boolean your branches have been missing

Basic/STRING/regex
add

Add an item to a SET without mutating the original

Basic/SET
all

Are all the values in this SET truthy? Python's all(), as a node

Basic/SET
any

Did anything pass? Python's any(), as a node

Basic/SET
contains

Is this value in the set? Membership, answered with a boolean

Basic/SET
create SET

Build a SET from scratch — the dedup engine for your workflow

Basic/SET
create SET from BOOLEANs

Collect a pile of booleans into a SET — then ask it questions

Basic/SET
create SET from FLOATs

Give ComfyUI a pile of floats and get back a set with the duplicates gone

Basic/SET
create SET from INTs

Build a duplicate-free pool of integers without thinking about it

Basic/SET
create SET from STRINGs

The string-set node you'll actually reach for

Basic/SET
difference

Everything in set A that isn't in set B — a one-wire subtraction

Basic/SET
discard

The set node that never throws a fit

Basic/SET
enumerate

Numbering a set — and why that's trickier than it sounds

Basic/SET
intersection

Keep only what's in every set — intersection, up to four sets at once

Basic/SET
is disjoint

Do these two sets have zero overlap? One boolean says it all

Basic/SET
is subset

Is every element of A inside B? The containment check

Basic/SET
is superset

Does A contain all of B? The flip side of the containment check

Basic/SET
length

How many distinct items are in this set? Just count them

Basic/SET
pop

Grab any element out of a set — and get the rest back too

Basic/SET
pop random

Pop a random element — reproducibly, if you want

Basic/SET
remove

Remove an item and get a straight answer about whether it was there

Basic/SET
sum

Add up a set — and get the answer twice, once as int, once as float

Basic/SET
symmetric difference

Everything in either, nothing in both

Basic/SET
convert to Data List

The bridge from Python sets to ComfyUI's per-item processing

Basic/SET
convert to LIST

The conversion that admits it lost your order

Basic/SET
union

Merge sets and get the duplicates collapsed for free

Basic/SET
capitalize

First letter up, everything else down — Python's capitalize, exactly

Basic/STRING
casefold

The lowercase that makes 'ß' match 'ss'

Basic/STRING
center

Pad your text into neat columns

Basic/STRING
string compare

The if/else gate for text

Basic/comparison
concat

The glue for building strings in ComfyUI

Basic/STRING
count

How many times does that substring show up?

Basic/STRING
join (from data list)

Turn a data list back into one string

Basic/STRING
decode

Turn b'...' back into readable text

Basic/STRING
encode

Why your text suddenly looks like b'\\xc3\\xb6'

Basic/STRING
endswith

A cheap way to check what a string is

Basic/STRING
escape

Make your text safe for JSON, logs, and code

Basic/STRING
expandtabs

The most niche tab you'll ever fix

Basic/STRING
find

Where does that substring actually live?

Basic/STRING
format_map

Prompt templates without string gymnastics

Basic/STRING
in (contains)

The simplest 'is it in there' test

Basic/STRING
isalnum

Is this string letters and numbers only?

Basic/STRING/is
isalpha

Letters only — no digits, no spaces

Basic/STRING/is
isascii

The gatekeeper for old-school text

Basic/STRING/is
isdecimal

The pickiest number check of them all

Basic/STRING/is
isdigit

Digits, including the weird ones

Basic/STRING/is
isidentifier

Is this string a legal Python name?

Basic/STRING/is
islower

Islower — the quiet case-checker for whatever text you just built

Basic/STRING/is
isnumeric

Isnumeric — the gate that keeps bad numbers out of your INT casts

Basic/STRING/is
isprintable

Isprintable — the node that finds the invisible junk in your text

Basic/STRING/is
isspace

Isspace — the honest answer to 'is this prompt actually blank?'

Basic/STRING/is
istitle

Istitle — checking that every word behaves and capitalizes like it should

Basic/STRING/is
isupper

Isupper — the sibling of islower that checks the screaming text

Basic/STRING/is
length

Length — the string node you'll actually reach for, constantly

Basic/STRING
join (from LIST)

Join (from LIST) — turn a pile of strings into one string, with glue

Basic/STRING
ljust

Ljust — pad text on the right so your columns actually line up

Basic/STRING
lower

Lower — normalize your text before it goes anywhere that cares

Basic/STRING
lstrip

Lstrip — cut the junk off the front of your strings

Basic/STRING
removeprefix

Removeprefix — the polite way to delete the front of a string

Basic/STRING
removesuffix

Removesuffix — peel the extension off a filename without the guesswork

Basic/STRING
replace

Replace — find-and-replace for your strings, with a count dial

Basic/STRING
rfind

Rfind — the 'last time this shows up' search your filenames need

Basic/STRING
rjust

Rjust — right-align your text so the numbers line up like a ledger

Basic/STRING
rsplit (from data list)

Rsplit (from data list) — split from the end, when the tail is what matters

Basic/STRING
rsplit (from LIST)

Rsplit (from LIST) — split from the right, keeping the parts as one variable

Basic/STRING
rstrip

Rstrip — the trailing-whitespace exterminator for text that came from files

Basic/STRING
split (to data list)

Split (to data list) — one string in, a pile of parts out, each processed

Basic/STRING
splitlines (from data list)

One Prompt per Line, Rendered Separately

Basic/STRING
splitlines (to LIST)

Splitlines as One LIST You Can Manipulate as a Unit

Basic/STRING
split (to LIST)

Split a CSV Prompt Into a LIST You Can Actually Index

Basic/STRING
startswith

A True/False Gate That Routes on What a String Begins With

Basic/STRING
strip

Trim the Invisible Garbage Off Your Strings

Basic/STRING
swapcase

The Case-Flipping Node You'll Use Once (and Enjoy)

Basic/STRING
title

Title-Case Your Prompts (and Watch Out for Apostrophes)

Basic/STRING
unescape

Make the Literal '\n' Actually Mean Something

Basic/STRING
upper

Everything to Uppercase, No Surprises

Basic/STRING
zfill

Zero-Pad Numbers for Filenames That Sort Right

Basic/STRING
switch/case

The pick-an-option node

Basic/flow control
Add Time Delta

Now Plus Three Days, the Way Math Should Work

Basic/time
Create Time Delta

A Duration You Can Add, Subtract, and Measure With

Basic/time
Time Difference

The 'How Long Between These Two Dates?' Node

Basic/time
Extract Time Components

Eight Time Components From One DATETIME, All at Once

Basic/time
Format Time String

Turn a DATETIME Into the Exact String Your Filename Needs

Basic/time
Time Now

A Fresh Timestamp Every Run (Your Filenames Will Thank You)

Basic/time
Time Now (UTC)

Timestamps That Mean the Same Thing Everywhere

Basic/time
Parse Time String

From '2026-08-16' to a Real DATETIME You Can Compute With

Basic/time
Subtract Time Delta

How Long Ago? Subtract a Duration From a Date

Basic/time
Time to Unix Timestamp

A DATETIME as Seconds-Since-Epoch — For Systems That Want It

Basic/time
Unix Timestamp to Time

Stop squinting at 1767225600 — turn Unix timestamps into real times

Basic/time
Tensor Binary Op

Tensor Binary Op — add, multiply, and otherwise math your tensors

Basic/tensor
Tensor Create

Tensor Create — turning plain numbers into actual PyTorch tensors

Basic/tensor
Tensor Info

Tensor Info — the node that tells you what the hell you're actually working with

Basic/tensor
Tensor Join

Tensor Join — putting tensors together, two at a time

Basic/tensor
Tensor Permute

Tensor Permute — reordering dimensions without touching the data

Basic/tensor
Tensor Reshape

Tensor Reshape — same data, different dimensions

Basic/tensor
Tensor Slice

Tensor Slice — cutting out the parts you actually want

Basic/tensor
Tensor Unary Op

Tensor Unary Op — one tensor in, one tensor out, a whole toolbox of math

Basic/tensor
Readme

Basic Data Handling

Basic Python functions for manipulating data that every programmer is used to. These nodes are very lightweight and require no additional dependencies.

Quickstart

Recommended Installation

  1. Install ComfyUI
  2. Install ComfyUI-Manager
  3. Look up the "Basic data handling" extension in ComfyUI-Manager
  4. Restart ComfyUI

Alternative (Manual Installation)

  1. Install ComfyUI
  2. Clone this repository under ComfyUI/custom_nodes
  3. Restart ComfyUI

Node Categories

BOOLEAN

Boolean logic operations:

  • Logic operations: and, or, not, xor, nand, nor

Cast

Type conversion nodes for ComfyUI data types: to BOOLEAN, to FLOAT, to INT, to STRING, to DICT, to LIST, to SET

Comparison

Value comparison nodes:

  • Basic comparisons: equal (==), not equal (!=), greater than (>), greater than or equal (>=), less than (<), less than or equal (<=)
  • String comparison: StringComparison with case-sensitive/insensitive options
  • Special comparisons: NumberInRange, IsNull
  • Container operations: CompareLength

Control Flow

Mechanisms to direct workflow execution:

  • Conditional branching:
    • if/else - Routes based on a boolean condition
    • if/elif/.../else - Supports multiple conditional branches
    • switch/case - Selects from options based on an index
  • Execution management:
    • disable flow - Conditionally enables/disables a flow
    • flow select - Directs output to either "true" or "false" path
    • force calculation - Prevents caching and forces recalculation
    • force execution order - Controls node execution sequence

Data List

ComfyUI list manipulation nodes (for processing individual items):

  • Creation: create Data List (generic and type-specific versions)
  • Modification: append, extend, insert, set item, shuffle, remove, pop, pop random
  • Filtering: filter, filter select
  • Access: get item, first, last, slice, index, contains
  • Information: length, count
  • Operations: sort, reverse, zip, min, max
  • Conversion: convert to LIST, convert to SET

DICT

Dictionary manipulation nodes:

  • Creation: create (generic and type-specific), create from items, create from lists, fromkeys
  • Access: get, get_multiple, keys, values, items
  • Modification: set, update, setdefault, merge
  • Removal: pop, popitem, pop random, remove
  • Information: length, contains_key
  • Operations: filter_by_keys, exclude_keys, invert, compare
  • Conversion: get_keys_values

FLOAT

Floating-point operation nodes:

  • Creation: create FLOAT from string
  • Basic arithmetic: add, subtract, multiply, divide, divide (zero safe), power
  • Formatting: round (to specified decimal places)
  • Conversion: to_hex, from_hex
  • Analysis: is_integer, as_integer_ratio

INT

Integer operation nodes:

  • Creation: create INT, create INT with base
  • Basic arithmetic: add, subtract, multiply, divide, divide (zero safe), modulus, power
  • Bit operations: bit_length, bit_count
  • Byte conversion: to_bytes, from_bytes

LIST

Python list manipulation nodes (as a single variable):

  • Creation: create LIST (generic and type-specific versions)
  • Modification: append, extend, insert, remove, pop, pop random, set_item, shuffle
  • Access: get_item, first, last, slice, index, contains
  • Information: length, count
  • Operations: sort, reverse, min, max
  • Conversion: convert to data list, convert to SET

Math

Mathematical operations:

  • Generic: formula
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, atan2
  • Logarithmic/Exponential: log, log10, exp, sqrt
  • Constants: pi, e
  • Angle conversion: degrees, radians
  • Rounding operations: floor, ceil
  • Min/Max functions: min, max
  • Other: abs

Path

File system path manipulation nodes:

  • Basic operations: join, split, splitext, basename, dirname, normalize
  • Path information: abspath, exists, is_file, is_dir, is_absolute, get_size, get_extension, set_extension, input_dir, output_dir
  • Directory operations: list_dir, get_cwd
  • Path searching: glob, common_prefix
  • Path conversions: relative, expand_vars
  • File loading: load STRING from file, load IMAGE from file, load IMAGE+MASK from file, load MASK from alpha channel, load MASK from greyscale/red
  • File saving: save STRING to file, save IMAGE to file, save IMAGE+MASK to file

SET

Python set manipulation nodes (as a single variable):

  • Creation: create SET (generic and type-specific versions)
  • Modification: add, remove, discard, pop, pop random
  • Information: length, contains
  • Set operations: union, intersection, difference, symmetric_difference
  • Set comparison: is_subset, is_superset, is_disjoint
  • Conversion: convert to data list, convert to LIST

STRING

String manipulation nodes:

  • Text case conversion: capitalize, casefold, lower, swapcase, title, upper
  • Text inspection: contains, endswith, find, length, rfind, startswith
  • Character type checking: isalnum, isalpha, isascii, isdecimal, isdigit, isidentifier, islower, isnumeric, isprintable, isspace, istitle, isupper
  • Text formatting: center, expandtabs, ljust, rjust, zfill
  • Text splitting/joining: join, split, rsplit, splitlines (with data list and LIST variants)
  • Text modification: concat, count, replace, strip, lstrip, rstrip, removeprefix, removesuffix
  • Encoding/escaping: decode, encode, escape, unescape, format_map

TENSOR

PyTorch tensor manipulation nodes:

  • Creation: Tensor Create (from numbers, lists, or other tensors)
  • Arithmetic: Tensor Binary Op (add, subtract, multiply, divide, power, remainder, floor_divide)
  • Functions: Tensor Unary Op (abs, neg, exp, log, sin, cos, sqrt, sigmoid, relu)
  • Reshaping: Tensor Reshape, Tensor Permute (dims)
  • Access: Tensor Slice (supports Python-style slice strings like 0:10, :, 5)
  • Combined: Tensor Join (concatenate or stack)
  • Analysis: Tensor Info (returns shape, dtype, device)

Time

Date and time manipulation nodes:

  • DateTime creation/conversion: TimeNow, TimeNowUTC, TimeToUnix, UnixToTime
  • String formatting/parsing: TimeFormat, TimeParse
  • Time calculations: TimeDelta, TimeAddDelta, TimeSubtractDelta, TimeDifference
  • Component extraction: TimeExtract (year, month, day, hour, etc.)

Understanding Data Types

ComfyUI provides three different collection types that serve distinct purposes:

Collection Types and When to Choose Them

| Type | Description | When to Choose | |---------------|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | data list | Native ComfyUI list where items are processed individually | • When you need ComfyUI to process each item individually<br>• For batch operations with parallel processing<br>• When connecting to nodes that expect individual inputs | | LIST | Python list passed as a single variable | • When you need ordered collections with preserved duplicates<br>• When index-based access is important<br>• When you need to work with the collection as a complete unit | | SET | Python set passed as a single variable | • When you need to ensure unique values only<br>• When you need fast membership testing<br>• For set operations (union, intersection, etc.)<br>• When element order doesn't matter |