2026-10-11 11:42:32 +02:00
2026-10-11 11:42:32 +02:00
2026-10-11 11:42:32 +02:00
2026-10-11 11:42:32 +02:00
2026-10-11 11:42:32 +02:00
2026-03-21 11:16:39 +01:00
2026-03-21 11:16:39 +01:00
2026-10-11 11:42:32 +02:00
2026-06-01 10:37:30 +02:00
2026-10-11 11:42:32 +02:00
2026-10-11 11:42:32 +02:00
2026-06-27 09:34:07 +02:00

ComfyUI Nifty Nodes

A ComfyUI node pack focused on workflow organisation and flexibility. The centrepiece is a Bundle system for passing arbitrary named values through a single wire, alongside smart media loaders with built-in resize, a multi-LoRA loader, a full set of logic and switch nodes, image processing tools, latent utilities, and various quality-of-life helpers.

Installation

Clone the repository into your ComfyUI custom_nodes folder:

cd ComfyUI/custom_nodes
git clone https://github.com/Stibo/comfyui-nifty-nodes

Then restart ComfyUI. Optional dependencies for certain nodes:

pip install kornia        # reinhard_lab_gpu and perceptual_crossfade in Image Color Match
pip install color-matcher # additional color transfer methods in Image Color Match

Features

  • ComfyUI v3 native — built entirely on the comfy_api.latest API with proper define_schema, lazy evaluation, fingerprint_inputs caching and async execution where applicable
  • Bundle system — pass any number of named values through a single BUNDLE wire, with dot-notation support for nested structures
  • Smart media loaders — load images, videos or both with an integrated resize pipeline, optional frame rate control and embedded meta bundle extraction; use Embed Media Meta Bundle to inject metadata into saved PNGs
  • Multi-LoRA loader — manage an entire LoRA stack in one node with per-row enable/disable and strength controls; or build reusable stacks with Lora Stack and Apply nodes
  • Full logic suite — lazy and eager input switches, output routers, indexed combo switches, boolean operators, string/number comparisons and more
  • Image Color Match — 10 color transfer methods including GPU-accelerated options, batch multithreading and selective channel transfer
  • Model guidance — WAN-native NAG (Normalized Attention Guidance) and SLG/STG nodes for WAN 2.1 / 2.2 video models
  • CLIP Text Encode — combined positive/negative prompt encoding in a single node
  • Dynamic Prompt — wildcard-based prompt generation with deterministic seeds, powered by the dynamicprompts library
  • Search aliases on every node for fast discovery via the node search

Note

  • Tested with ComfyUI frontend 1.39.
  • Untested with Nodes 2.0.
  • The promotion of the special widgets to the subgraph node does not work correctly in version 1.39+.

Nodes

Bundle

The Bundle system lets you pack multiple values of any type into a single BUNDLE wire and unpack or access them wherever needed. This keeps graphs clean when many values need to travel together.

Bundle Pack

Packs up to 32 values of any type into a Bundle. An optional incoming Bundle can be merged — new values are added to it or overwrite existing keys.

Inputs
Name Type Required Default Description
bundle BUNDLE No — Existing bundle to merge into. New slot values overwrite keys with the same name.
value1 … value32 ANY No — Values to pack. Controlled by count.
count INT No 1 Number of value slots to show (1–32).
hide_links BOOL No False Hide the connection wires going into this node to reduce visual clutter.
Outputs
Name Type Description
bundle BUNDLE The resulting bundle containing all packed values.

Bundle Unpack

Unpacks a Bundle back into up to 32 individual outputs. Output labels are set by renaming the slots, matching the keys used when packing.

Inputs
Name Type Required Default Description
bundle BUNDLE Yes — The bundle to unpack.
count INT No 1 Number of output slots to show (1–32).
hide_links BOOL No False Hide the connection wires going out of this node to reduce visual clutter.
Outputs
Name Type Description
bundle BUNDLE The original bundle, passed through unchanged.
value1 … value32 ANY Unpacked values. Slots beyond count output None.

Bundle Get

Reads a single value from a Bundle by key.

Inputs
Name Type Required Default Description
bundle BUNDLE Yes — The bundle to read from.
key STRING Yes value1 Key to read. Supports dot notation for nested keys, e.g. settings.width.
Outputs
Name Type Description
value ANY The value at the given key, or None if the key does not exist.

Bundle Set

Writes or overwrites a single key in a Bundle.

Inputs
Name Type Required Default Description
bundle BUNDLE Yes — The bundle to update.
key STRING Yes value1 Key to write. Supports dot notation for nested keys, e.g. settings.width.
value ANY Yes — Value to store at the given key.
Outputs
Name Type Description
bundle BUNDLE Updated bundle. The original is not modified — a new copy is returned.
Slot Labels and Key Names

When you rename a slot in Bundle Pack or Bundle Unpack (double-click the slot label), the new name becomes the key used inside the bundle. The same label must be used on both ends for values to align correctly.

Dot Notation and Nesting

Keys use . as a path separator, allowing you to read and write into nested structures. For example:

Bundle Pack  →  slot label: "camera.fov"   →  value: 90
Bundle Get   →  key: "camera.fov"          →  returns: 90

You can nest arbitrarily deep: "render.output.format", "lora.0.strength", etc. Bundle Get and Bundle Set both support full dot-path access.

Merging Bundles

Bundle Pack accepts an optional incoming Bundle. Any values you pack are merged on top of it — existing keys are overwritten, other keys are preserved. This makes it easy to incrementally build up a shared parameter object across multiple nodes.


Media

Load & Resize Media

The most versatile loader — accepts images and videos in a single node, with a built-in resize pipeline. A is_video boolean output lets you route the result differently depending on what was loaded.

Inputs
Name Type Required Default Description
file COMBO Yes none File to load. Supports image formats (jpg, png, webp, …), animated formats (gif, apng, webp, avif) and video formats (mp4, mkv, webm, …).
force_frame_rate INT No 0 Enforce a specific frame rate. 0 = keep original. Values like 24, 30 or 60 resample the video during loading.
resize DYNAMIC No off Resize mode to apply after loading — see Resize Modes.
Outputs
Name Type Description
IMAGE IMAGE Loaded frames as a batch tensor. None if file is none.
frames INT Total number of frames (1 for still images).
width INT Output width after any resize.
height INT Output height after any resize.
frame_rate INT Frame rate of the source (or the forced rate if set).
audio AUDIO Extracted audio track. Silent if the file has no audio.
is_video BOOL True if the loaded file is a video or animation, False for still images.
meta_bundle BUNDLE Meta bundle embedded in the file's PNG metadata, if any. Empty dict if none found.

Load & Resize Video

Same as Load & Resize Media but restricted to video and animation file types.

Inputs / Outputs

Same as Load & Resize Media, minus the is_video output.

Load & Resize Image

Same as Load & Resize Media but restricted to image and animation file types. No frames, frame_rate or audio outputs.

Outputs
Name Type Description
IMAGE IMAGE Loaded image as a tensor. None if file is none.
width INT Output width after any resize.
height INT Output height after any resize.
meta_bundle BUNDLE Meta bundle embedded in the file's PNG metadata, if any. Empty dict if none found.

Embed Media Meta Bundle

Injects a BUNDLE dict into the workflow's extra_pnginfo so it gets embedded into any PNG saved downstream. Place this node in the wire between a loader and a Save Image node. Passes the input value through unchanged.

Inputs
Name Type Required Default Description
input ANY Yes — Any value to pass through unchanged.
meta_bundle BUNDLE Yes — The bundle to embed into the saved PNG metadata.
mode COMBO No overwrite overwrite = replace any existing meta_bundle entirely. merge = combine with an existing bundle — new keys override old ones, keys not present in the new bundle are kept.
Outputs
Name Type Description
output ANY The input value, passed through unchanged.
Resize Modes

All three loaders share the same resize pipeline, available via the resize dropdown:

Mode Description
off No resize — load at original dimensions.
scale dimensions Scale to exact width × height. Optional center crop to avoid stretching.
scale by multiplier Scale both dimensions by a float multiplier.
scale longer dimension Scale so the longer side equals the given size, preserving aspect ratio.
scale shorter dimension Scale so the shorter side equals the given size, preserving aspect ratio.
scale width Scale to a specific width, preserving aspect ratio.
scale height Scale to a specific height, preserving aspect ratio.
scale total pixels Scale to a target megapixel count.
make divisible by Round dimensions to the nearest multiple (e.g. 16 for WAN).

All modes include a divisible_by option and separate scale method selectors for upscaling and downscaling:

Scale Method Best for
nearest-exact Fastest, pixel art / sharp pixel edges
bilinear / bicubic General purpose
area Downscaling — sharp, minimal aliasing
lanczos Upscaling — smooth, good detail retention
mitchell-netravali Sharp upscaling with minimal ringing
bilinear (antialias) / bicubic (antialias) Smooth downscaling with anti-aliasing
nvidia-rtx-vsr AI upscaling — requires an NVIDIA RTX GPU and the nvidia-vfx package

Nifty Upscale Image

Loads an upscale model and upscales an image with it in a single node. Merges the core UpscaleModelLoader and ImageUpscaleWithModel nodes and adds tile parameters. On out-of-memory the tile size is halved automatically.

Inputs
Name Type Required Default Description
image IMAGE Yes — Image to upscale.
model COMBO Yes — Upscale model from the upscale_models folder.
tile_size INT No 512 Tile size used for tiled upscaling (64–4096).
overlap INT No 32 Overlap between tiles (0–4096).
Outputs
Name Type Description
IMAGE IMAGE Upscaled image.
model_name STRING Name of the used model without file extension.

Nifty Save Image

Saves images as PNG to a freely chosen folder. Optionally embeds the workflow metadata and a meta_bundle.

Inputs
Name Type Required Default Description
images IMAGE Yes — The images to save.
meta_bundle BUNDLE No — Embedded under the key meta_bundle together with the prompt and workflow metadata (only if save_metadata is enabled).
filename STRING No ComfyUI Filename prefix. Supports date placeholders like %date:yyyy-MM-dd% and %width%, %height%, %year%, %month%, %day%, %hour%, %minute%, %second%, %batch_num%.
filename_suffix STRING No `` Appended to filename before the counter, e.g. _upscaled.
folder STRING No output Absolute path or relative to the ComfyUI root (e.g. ../output). Folders outside the registered output directory show no preview thumbnail, but the file is still saved.
save_metadata BOOL No True Embed prompt, workflow and meta_bundle as PNG text chunks.
overwrite BOOL No False False = a counter (_00001, _00002, …) is appended so existing files are never replaced. True = no counter, an existing file with the same name is overwritten. Ignored for batches with more than one image.
Outputs
Name Type Description
images IMAGE The input images, passed through unchanged.
filename STRING Comma-separated list of all saved filenames.

Batch Image Loader Start

Loads one image per loop iteration from a directory. Connect loop to Batch Image Loader End; everything between the two nodes runs once per image.

Inputs
Name Type Required Default Description
directory STRING No output Absolute path or relative to the ComfyUI root.
limit INT No -1 Number of images to process. -1 = all, 0 = none.
start_index INT No 0 Number of images to skip at the start of the sorted list.
orderby COMBO No name Sort criterion: name (natural order: 1, 2, 10, 100), date modified, date created, size or type.
order COMBO No ascending ascending or descending.
recursive BOOL No False Also read images from subdirectories.
value1 … value16 ANY No — Auto-growing list of initial values. From the second iteration on, the value of the same slot on Batch Image Loader End is used instead.
Outputs
Name Type Description
loop NIFTY_BATCH_LOOP Connect to Batch Image Loader End.
image IMAGE Image of the current iteration.
filename STRING Path relative to the directory, including subfolders.
meta_bundle BUNDLE Meta bundle embedded in the PNG metadata of the current image, if any.
value1 … value16 ANY Value of the current iteration. Pass it on to the same slot of Batch Image Loader End.

Batch Image Loader End

Applies a file action and a rename action to the image of the current iteration, then starts the next iteration or finishes the loop.

Inputs
Name Type Required Default Description
loop NIFTY_BATCH_LOOP Yes — Connect to Batch Image Loader Start.
file_action DYNAMIC Yes none none = keep the file · move = move it to target_directory (absolute or relative to the loader's directory, default done, created if missing, subfolders are preserved) · delete = delete the file. Runs before rename_action.
rename_action DYNAMIC No none Applied after the file action (in the new location if moved), not available when the file is deleted. none · rename = filename prefix plus counter (name_00001_.ext) · suffix = appends suffix to the file name · regex = applies regex_search / regex_replace to the file name without extension.
value1 … value16 ANY No — Auto-growing list of values passed to the same slot of Batch Image Loader Start in the next iteration. Unconnected slots keep their current value.
Outputs
Name Type Description
count INT Number of processed images.
filenames STRING All processed file names, one per line. Only available after the last iteration.
value1 … value16 ANY Value of this slot after the last iteration.

Crop Image

Crops one or more images without scaling. Width and height can be cropped independently from the left, center or right / top, center or bottom.

Inputs
Name Type Required Default Description
image IMAGE Yes — Image or image batch to crop.
width INT No 512 Target crop width in pixels. 0 = keep original width.
height INT No 512 Target crop height in pixels. 0 = keep original height.
crop_width COMBO No center Horizontal crop position: left, center or right.
crop_height COMBO No center Vertical crop position: top, center or bottom.
Outputs
Name Type Description
IMAGE IMAGE Cropped image.

Lora

Nifty Lora Loader

Applies a full LoRA stack to a model and CLIP in one node. Each row has its own enable toggle and strength slider. Rows with strength 0.0 or disabled are skipped entirely.

Inputs
Name Type Required Default Description
model MODEL Yes — Base model to apply LoRAs to.
clip CLIP No — CLIP model to apply LoRAs to.
loras NIFTY_LORA_LOADER Yes — LoRA stack widget. Add rows, pick a LoRA file, set strength and toggle enabled. Strength 1.0 = full effect, 0.5 = half, negative values invert.
Outputs
Name Type Description
MODEL MODEL Model with all enabled LoRAs applied in order.
CLIP CLIP CLIP with all enabled LoRAs applied in order.

Nifty Lora Stack

Builds a reusable NIFTY_LORA_STACK wire that can be passed to Nifty Apply Lora Stack. Accepts an optional incoming stack to chain multiple Lora Stack nodes together — new rows are appended. Rows with strength 0.0 or disabled are skipped.

Inputs
Name Type Required Default Description
lora_stack NIFTY_LORA_STACK No — Existing stack to extend. New rows are appended after it.
loras NIFTY_LORA_LOADER Yes — LoRA stack widget. Add rows, pick a LoRA file, set strength and toggle enabled. Strength 1.0 = full effect, 0.5 = half, negative values invert.
Outputs
Name Type Description
lora_stack NIFTY_LORA_STACK Combined LoRA stack ready to be passed to Nifty Apply Lora Stack.

Nifty Apply Lora Stack

Applies a NIFTY_LORA_STACK to a model and optional CLIP. Separates stack definition from application — useful when the same stack needs to be applied to multiple models or at different points in a workflow.

Inputs
Name Type Required Default Description
lora_stack NIFTY_LORA_STACK Yes — The LoRA stack to apply.
model MODEL Yes — Base model to apply LoRAs to.
clip CLIP No — CLIP model to apply LoRAs to.
Outputs
Name Type Description
MODEL MODEL Model with all LoRAs from the stack applied in order.
CLIP CLIP CLIP with all LoRAs from the stack applied in order.

Conditioning

Nifty CLIP Text Encode (Prompt)

Encodes positive and negative text prompts using a CLIP model in a single node. Both outputs are CONDITIONING wires ready for a sampler.

Inputs
Name Type Required Default Description
clip CLIP Yes — The CLIP model used for encoding the text.
positive STRING No `` Positive text prompt. Leave empty for an unconditional embedding.
negative STRING No `` Negative text prompt. Leave empty for an unconditional embedding.
Outputs
Name Type Description
positive CONDITIONING Positive conditioning from the encoded prompt.
negative CONDITIONING Negative conditioning from the encoded prompt.

Model

WAN-specific model patching nodes. Both are marked experimental and live in the nifty/model category.

Wan Video NAG

Applies Normalized Attention Guidance (NAG, NeurIPS 2025) to WAN 2.1 / 2.2 video models (T2V and I2V). Replaces or complements CFG by applying guidance directly in attention space — stable at low step counts. Forked and significantly reworked from KJNodes.

Inputs
Name Type Required Default Description
enable BOOL No True When False, model and conditioning pass through unchanged.
model MODEL Yes — WAN model to patch.
conditioning CONDITIONING Yes — Negative conditioning (empty or negative prompt). NAG uses this as its internal reference — the direction guidance is pushed away from in attention space. Do not connect positive conditioning here.
nag_scale FLOAT No 11.0 Guidance strength (φ), analogous to CFG scale. Good range: 8–15. 0 disables NAG. Tune last — settle on nag_tau and nag_alpha first.
nag_alpha FLOAT No 0.25 Blend weight (α) between NAG-guided and original positive attention. 0 = no effect, 1 = full NAG. Lower for I2V (0.10–0.20) to preserve the reference image.
nag_tau FLOAT No 2.5 L1-norm clipping threshold (τ): caps how far guided attention deviates from positive attention. Lower = safer. Higher = stronger. Lower for I2V (1.5–2.0); higher for few-step Lightning LoRA (3–5).
nag_sigma_end FLOAT No 0.0 NAG is skipped when sigma drops below this value. 0.0 = always active (correct for two-model HN/LN pipelines). For single-model pipelines, 0.75 gives near-identical quality with less compute.
nag_scale_end FLOAT No 0.0 Adaptive scale end: linearly interpolates from nag_scale (sigma=1.0) to this value (sigma=0.0). 0.0 = disabled (constant scale).
input_type COMBO No default default = sampler sends a [positive, negative] batch pair (standard CFG). batch = single conditioning without a paired negative (use for CFG=1 / few-step WAN with Lightning LoRA).
inplace BOOL No False Modify tensors in-place to reduce peak VRAM. Slightly alters numerical results — enable only if out of memory.
cond_zero_out BOOL No True Output a zeroed neutral conditioning instead of the input conditioning. Recommended — NAG handles guidance internally so the sampler's negative slot should be empty to avoid interference. Disable only if intentionally stacking NAG on top of CFG.
Outputs
Name Type Description
MODEL MODEL Patched model with NAG applied to every cross-attention block.
CONDITIONING CONDITIONING The input conditioning, zeroed out if cond_zero_out is True.
Scenario nag_scale nag_tau nag_alpha
T2V multi-step 11 2.5 0.25
T2V few-step (Lightning LoRA) 11–15 2.5–5 0.25–0.5
I2V (any) 11 1.5–2.0 0.10–0.20

Nifty Wan Video SLG

Applies Spatiotemporal Skip Guidance (STG / SLG) to WAN video models. No TeaCache required. Works at CFG=1 (e.g. LightX2V). Paper: arxiv 2411.18664 (CVPR 2025). Forked and significantly reworked from KJNodes.

Inputs
Name Type Required Default Description
enabled BOOL No True When False, the model is passed through unchanged.
model MODEL Yes — WAN model to patch.
blocks STRING No 9, 10 Comma-separated block indices. Supports ranges (9-11 = 9, 10, 11). WAN 2.2 has 40 layers. Blocks 9, 10 are empirically recommended. Start with 10 alone if flickering occurs.
mode COMBO No STG-A STG-A — zeros self-attention only (cross-attn and FFN still run). Less perturbation, lower flickering risk. Recommended for WAN + few-step. STG-R — entire block becomes identity. Stronger but more prone to flickering at 2–3 steps.
scale FLOAT No 1.0 Guidance strength. Works at CFG=1. LightX2V (2–3 HN steps): STG-A max ~2.0–2.5, STG-R max ~1.5.
start_percent FLOAT No 0.0 Start of active range as a fraction of the full denoising schedule (HN + LN combined). Percentages are absolute.
end_percent FLOAT No 1.0 End of active range. Formula: HN_steps / total_steps. 4-step (2+2): 0.5. Default 1.0 = active for all sigmas this model processes.
rescaling_scale FLOAT No 0.0 Normalises correction std to match cond_pred std before applying scale. 0.0 = disabled. 0.3–0.5 recommended if scale causes flickering.
scale_end FLOAT No 0.0 Adaptive scale end: interpolates from scale at start_percent to scale_end at end_percent. 0.0 = disabled (constant scale).
Outputs
Name Type Description
MODEL MODEL Model with a post_cfg_function patched in to apply STG on each sampler step.

Logic

A full set of flow control nodes. Most come in two variants: lazy (only evaluates the branch that will actually be used) and eager (evaluates both branches regardless).

Input Switch

Routes one of two inputs to the output based on a boolean. Lazy — the unused branch is never executed.

Inputs
Name Type Required Default Description
on_true ANY No — Passed through when boolean is True.
on_false ANY No — Passed through when boolean is False.
boolean BOOL Yes — Selector.
Outputs
Name Type Description
output ANY The selected input value.

Input Switch (Eager)

Same as Input Switch but both branches are always evaluated.

None Input Switch

Routes between on_exists and on_none depending on whether value is None. Lazy.

Inputs
Name Type Required Default Description
on_exists ANY No — Passed through when value is not None.
on_none ANY No — Passed through when value is None.
value ANY No — The value to check.
Outputs
Name Type Description
output ANY The selected branch.

None Input Switch (Eager)

Same as None Input Switch but both branches are always evaluated.

Index Input Switch

Routes one of up to 16 inputs to the output by index. Lazy — only the selected input is evaluated.

Inputs
Name Type Required Default Description
index INT Yes 1 Which input to pass through (1–16).
value1 … value16 ANY No — Auto-growing input list.
Outputs
Name Type Description
output ANY The value at the selected index, or None if the slot is not connected.

Index Input Switch (Eager)

Same as Index Input Switch but all inputs are always evaluated.

Output Switch

Routes a single input to either on_true or on_false. The unselected output is blocked (downstream nodes do not execute).

Inputs
Name Type Required Default Description
input ANY Yes — Value to route.
boolean BOOL No True True = route to on_true, False = route to on_false.
Outputs
Name Type Description
on_true ANY Active when boolean is True, blocked otherwise.
on_false ANY Active when boolean is False, blocked otherwise.

None Output Switch

Routes input to either on_exists or on_none depending on whether value is None.

Inputs
Name Type Required Default Description
input ANY No — Value to route.
value ANY No — Value to check for None.
Outputs
Name Type Description
on_exists ANY Active when value is not None.
on_none ANY Active when value is None.

Index Output Switch

Routes a single input to one of up to 16 outputs by index. All other outputs are blocked.

Inputs
Name Type Required Default Description
input ANY No — Value to route.
index INT Yes 1 Which output to route to (1–16).
Outputs
Name Type Description
value1 … value16 ANY Only the output at index is active; all others are blocked.

Signal Switch

Simple on/off gate. When passthrough is False, the output is blocked and all downstream nodes skip execution.

Inputs
Name Type Required Default Description
input ANY Yes — Value to gate.
passthrough BOOL No True True = pass through, False = block.
Outputs
Name Type Description
output ANY The input value, or blocked if passthrough is False.

First Switch

Returns the first non-None value from a list of up to 16 inputs. Lazy — inputs are evaluated one by one until a non-None value is found.

Inputs
Name Type Required Default Description
value1 … value16 ANY No — Auto-growing input list checked in order from top to bottom.
Outputs
Name Type Description
output ANY First non-None value found, or None if all inputs are None.

String Compare

Compares a string against a match value and returns a boolean.

Inputs
Name Type Required Default Description
string STRING Yes — The string to test.
match STRING Yes `` The value to compare against. An empty match always returns False.
comparison DYNAMIC Yes exact exact = full equality · contains = substring · starts with / ends with = prefix/suffix · regex = regular expression
case_sensitive BOOL No False Enable case-sensitive comparison.
negate BOOL No False Invert the result.
Outputs
Name Type Description
BOOL BOOL Result of the comparison.

Number Compare

Compares two numbers and returns a boolean.

Inputs
Name Type Required Default Description
a INT / FLOAT Yes — Left-hand operand.
b INT / FLOAT Yes — Right-hand operand.
comparison DYNAMIC Yes a == b a == b · a != b · a < b · a > b · a <= b · a >= b · a <= b <= c (range check)
negate BOOL No False Invert the result.
Outputs
Name Type Description
BOOL BOOL Result of the comparison.

Is None

Returns True if the input is None (not connected or explicitly None).

Inputs
Name Type Required Default Description
input ANY No — Value to check.
negate BOOL No False Invert — returns False when None, True otherwise.
Outputs
Name Type Description
BOOL BOOL True if input is None, False otherwise (before negation).

Int Switch / Float Switch / String Switch

Each returns one of two primitive values based on a boolean.

Inputs
Name Type Required Default Description
boolean BOOL No True Selector.
on_true INT / FLOAT / STRING No 0 / 0.0 / `` Returned when boolean is True.
on_false INT / FLOAT / STRING No 0 / 0.0 / `` Returned when boolean is False.

Combo Switch

Switches between two combo (dropdown) values based on a boolean. Each side has its own options list, defined as a pipe-separated string (option1|option2|option3). Also outputs the selected value as a STRING and the index within its option list.

Inputs
Name Type Required Default Description
boolean BOOL No True Selector.
on_true COMBO No — Selected value when True.
true_options STRING No — Available options for on_true, separated by |.
on_false COMBO No — Selected value when False.
false_options STRING No — Available options for on_false, separated by |.
Outputs
Name Type Description
COMBO COMBO Selected combo value.
string STRING The selected combo value as a string.
index INT Index of the selected value within its option list. -1 if not found.

Index Combo Switch

Like Index Input Switch but selects the active branch via a named dropdown instead of a raw integer. Each branch gets a custom label defined by the option1–option16 string inputs — the dropdown (choise) is built from those labels at runtime. Lazy — only the selected branch is evaluated.

Inputs
Name Type Required Default Description
values ANY No — Auto-growing input list. Only the selected branch is evaluated (lazy).
choise COMBO Yes — Dropdown showing the labels defined by option1–option16.
option1 … option16 STRING No Option N Label for each corresponding value input. Defines the available dropdown options.
Outputs
Name Type Description
output ANY Value of the selected branch, or None if not connected.
COMBO COMBO The selected label as a COMBO value.
string STRING The selected label as a string.
index INT 0-based index of the selected option. -1 if not found.

Index Combo Switch (Eager)

Same as Index Combo Switch but all inputs are always evaluated regardless of which option is selected.

Boolean AND / OR / XOR

Standard two-input boolean gates.

Boolean AND All / OR Any

Multi-input variants using an auto-growing input list (up to 16). AND All returns True only if every connected input is True. OR Any returns True if at least one is True.

Boolean NOT

Inverts a boolean value.

None

Outputs a None value. Useful as an explicit empty input for optional slots.


Image

Image Color Match

Transfers the color distribution of a reference image onto a target image. Supports 10 transfer methods, selective channel transfer, adjustable strength and batch multithreading.

Inputs
Name Type Required Default Description
image_target IMAGE No — Image whose colors will be adjusted.
image_ref IMAGE No — Reference image providing the color distribution.
enabled BOOL No True When disabled, image_target passes through unchanged.
method COMBO No mkl Color transfer algorithm — see Methods below.
transfer_mode COMBO No all all = full color transfer · color = hue/chroma only, keep original luminance · luminance = brightness only, keep original colors
strength FLOAT No 1.0 Blend amount. 1.0 = full match, 0.5 = half-way blend, values above 1.0 exaggerate the effect. Range 0.0–10.0.
multithread BOOL No True Process batch frames in parallel using multiple CPU threads. Recommended for large batches.
Outputs
Name Type Description
IMAGE IMAGE Color-matched image batch. None if either input is not connected.
Color Match Methods
Method Notes
mkl Monge-Kantorovich linear map — best overall quality, recommended default for most use cases
reinhard_lab Fast statistical LAB match — good for natural/photographic content where speed matters. CPU only
reinhard_lab_gpu Same quality as reinhard_lab but GPU-accelerated — prefer this over reinhard_lab when kornia is available. Requires kornia
wavelet Transfers low-frequency color while preserving structure — best when texture and fine detail must stay intact
adain Adaptive instance normalisation — fast and consistent, well suited for video/animation frame batches
hm Histogram matching — fast broad tonal correction, less accurate for complex or saturated palettes
reinhard Classic Reinhard RGB — quick and simple, struggles with complex colour distributions
mvgd Multivariate Gaussian — high-accuracy statistical match, good complement to mkl for tricky scenes. Requires color-matcher
hm-mvgd-hm Histogram + MVGD combo — robust for challenging distributions when mkl alone falls short. Requires color-matcher
hm-mkl-hm Histogram + MKL combo — highest overall quality among the combo methods. Requires color-matcher

Merge Image Batches

Concatenates two image batches with optional blending at the transition. Useful for stitching video segments.

Inputs
Name Type Required Default Description
source_images IMAGE No — First batch.
new_images IMAGE No — Second batch, appended after source.
overlap_mode DYNAMIC No none Transition mode — see below.
Overlap Mode Description
none Simple concatenation, no blending.
cut Remove overlap frames from the selected side before concatenating.
linear_blend Simple linear crossfade over the overlap region.
ease_in_out S-curve (smoothstep) crossfade — more natural motion.
filmic_crossfade Gamma-correct (2.2) crossfade — preserves perceived brightness.
perceptual_crossfade LAB color space crossfade — perceptually even transition. Requires kornia.
Outputs
Name Type Description
images IMAGE Merged batch. None if both inputs are disconnected.

Resize Image

Resizes an image or mask using the full Nifty resize pipeline. Accepts both IMAGE and MASK types.

Inputs
Name Type Required Default Description
input IMAGE / MASK Yes — Image or mask to resize.
resize DYNAMIC Yes — Resize mode — see Resize Modes.
Outputs
Name Type Description
resized IMAGE / MASK Resized output (same type as input).
width INT Output width.
height INT Output height.

Image From Batch

Extracts a slice from an image batch by start index and length.

Inputs
Name Type Required Default Description
image IMAGE Yes — Input batch.
batch_index INT No 0 Start index. Positive = from beginning, negative = from end (-1 = last image). Range −4096–4096.
length INT No 1 Number of images to take. -1 = all from start to end of batch. Range −1–4096.
Outputs
Name Type Description
IMAGE IMAGE Extracted slice.

Last Image From Batch

Shortcut to take the last N images from a batch.

Inputs
Name Type Required Default Description
image IMAGE Yes — Input batch.
length INT No 1 Number of images to take from the end (1–4096).
Outputs
Name Type Description
IMAGE IMAGE Last length images from the batch.

Latent

VAE Encode

Encodes an image batch into latents. Automatically detects the temporal compression factor of the VAE and can optionally encode only a subset of frames specified by a target latent count.

Inputs
Name Type Required Default Description
pixels IMAGE Yes — Image frames to encode.
vae VAE Yes — VAE model to use for encoding.
target_latents INT No 0 0 = encode all frames. Positive = encode only the first N latents' worth of frames. Negative = encode only the last N latents' worth. The temporal factor is detected automatically from the VAE.
Outputs
Name Type Description
LATENT LATENT Encoded latent samples.
IMAGE IMAGE The original pixel frames, passed through unchanged.

Normalize Video Latent Start

Normalises the statistics (mean and standard deviation) of the first few latent frames to match the subsequent frames. Helps reduce flicker or discontinuity at the beginning of a generated video.

Inputs
Name Type Required Default Description
latent LATENT Yes — Video latent to process. Passthrough if the latent has only 1 frame.
enabled BOOL No True When disabled, the latent is passed through unchanged.
start_frame_count INT No 4 Number of latent frames from the start to normalise (1–max).
reference_frame_count INT No 5 Number of frames immediately after the start region to use as the normalisation reference (1–max).
Outputs
Name Type Description
LATENT LATENT Latent with normalised start frames.

Latent From Batch

Extracts a slice from a latent batch by start index and length. Supports both 4D (image) and 5D (video) latents.

Inputs
Name Type Required Default Description
samples LATENT Yes — Input latent batch.
batch_index INT No 0 Start index. Positive = from beginning, negative = from end (-1 = last frame). Range −4096–4096.
length INT No 0 0 = all from start to end. Positive = first N frames. Negative = trim N frames from the opposite end (e.g. -1 = all except the last).
Outputs
Name Type Description
LATENT LATENT Extracted latent slice.

Last Latent From Batch

Shortcut to take the last N latents from a batch.

Inputs
Name Type Required Default Description
samples LATENT Yes — Input latent batch.
length INT No 1 Number of latents to take from the end (1–4096).
Outputs
Name Type Description
LATENT LATENT Last length latents from the batch.

Sampling

Nifty Random Noise

Generates reproducible random noise from a seed for use with advanced sampler nodes that accept a NOISE input.

Inputs
Name Type Required Default Description
seed INT No 0 Seed value for noise generation (0–1125899906842624).
Outputs
Name Type Description
NOISE NOISE Noise object ready for use in an advanced KSampler node.

Flux 2 Sampler

Experimental all-in-one Flux.2 sampler. Combines FluxGuidance, BasicGuider, KSamplerSelect, Flux2Scheduler, Empty Flux 2 Latent and SamplerCustomAdvanced. Lives in the sampling/custom_sampling category.

Inputs
Name Type Required Default Description
model MODEL Yes — Model to sample with.
conditioning CONDITIONING Yes — Positive conditioning without embedded guidance. The guidance value is embedded internally (same as FluxGuidance).
latent_image LATENT No — Latent to denoise. If unconnected, an empty latent is generated from width / height.
sampler SAMPLER No — Sampler override. If unconnected, sampler_name is used.
noise_seed INT No 0 Seed for noise generation (0–1125899906842624).
steps INT No 20 Number of sampling steps (1–4096).
guidance FLOAT No 3.5 Flux guidance embed strength (0.0–100.0).
sampler_name COMBO No — Sampler used when no sampler input is connected.
width INT No 1024 Latent width. Used for the sigma schedule and the empty latent only if latent_image is unconnected.
height INT No 1024 Latent height. Used for the sigma schedule and the empty latent only if latent_image is unconnected.
Outputs
Name Type Description
latent LATENT Sampled latent.
time INT Duration of the sampling call only, in milliseconds.

Selectors

Lightweight selector nodes that output a filename or name string. They exist to keep your actual loader nodes clean — connect these to a loader and swap models or settings without touching the loader itself.

Diffusion Model Selector

Selects a diffusion model file from the unet / diffusion_models folder. Supports .safetensors, .gguf, .pt, .pth, .bin.

Outputs
Name Type Description
model ANY Selected model filename string.
is_gguf BOOL True if the selected file has a .gguf extension.

Clip Selector

Selects a CLIP / text encoder model file from the clip / text_encoders folder.

Outputs
Name Type Description
clip ANY Selected model filename string.
is_gguf BOOL True if the selected file has a .gguf extension.

CLIP Type Selector

Selects a CLIP type string from a dropdown. Covers all model families supported by ComfyUI's dual-CLIP loader (stable_diffusion, wan, flux2, sd3, and many more). Connect the output to a CLIP loader's type input.

Outputs
Name Type Description
type ANY The selected CLIP type as a string.

Sampler Selector

Selects a sampler name from the full list of available ComfyUI samplers.

Scheduler Selector

Selects a scheduler name from the full list of available ComfyUI schedulers.

Upscale Model Selector

Selects an upscale model file from the upscale_models folder without loading it.

Outputs
Name Type Description
model_name ANY Selected model filename string. None if none is selected.

String

Any To String

Converts one or more values of any type to a single string. Booleans become true/false, None becomes "none", everything else uses str().

Inputs
Name Type Required Default Description
value1 … value16 ANY No — Auto-growing list of values to convert. None values are excluded.
mode DYNAMIC No delimiter delimiter = join all values with a separator string · pattern = insert values into a template using $1, $2, … placeholders (e.g. "$1_$2" with hello and world → "hello_world")
Outputs
Name Type Description
string STRING Resulting string.

Bundle To String

Combines the scalar values (string, int, float, bool) of a Bundle into a single string. Booleans become true/false.

Inputs
Name Type Required Default Description
bundle BUNDLE Yes — Bundle to convert.
mode DYNAMIC No delimiter delimiter = join all scalar values of the first level with a separator string (default -) · pattern = insert bundle values into a template using {key} placeholders (default {name}). Nested values are accessed with {key.subkey}. Missing keys and non-scalar values produce an empty string.
Outputs
Name Type Description
string STRING Resulting string.

String Split

Splits a string into a list by a delimiter.

Inputs
Name Type Required Default Description
string STRING Yes — String to split. Must be connected.
delimiter STRING No \n Split character or string. Use \n for newline, \t for tab.
trim BOOL No False Trim leading and trailing whitespace from each part.
Outputs
Name Type Description
list STRING List of string parts.

String Join

Joins a list of strings into a single string.

Inputs
Name Type Required Default Description
list STRING Yes — List to join. Must be connected.
delimiter STRING No \n Separator inserted between each item. Use \n for newline, \t for tab.
Outputs
Name Type Description
string STRING Joined string.

Nifty Dynamic Prompt

Generates a resolved prompt string from a template using the dynamicprompts library. Supports wildcard files, random choices, weighted variants, combinatorial expansion and more — see the dynamicprompts documentation for the full syntax.

Wildcards are text files containing one option per line. Place them in your ComfyUI user directory at user/default/wildcards/ (create the folder if it doesn't exist). Reference them in your template with double underscores: __style__ loads user/default/wildcards/style.txt. Subdirectories work too: __artists/painters__ loads user/default/wildcards/artists/painters.txt.

The seed input makes generation deterministic — the same template and seed always produce the same result. If dynamicprompts is not installed, the template is returned unchanged.

The prompt field acts as a manual override: if it contains text, it is passed through directly without running the generator. Clear it to re-generate from template.

See full syntax reference: https://pypi.org/project/dynamicprompts/

Inputs
Name Type Required Default Description
prompt STRING No `` Manual prompt override (socketless). If non-empty, bypasses the template generator and passes this value through directly.
template STRING No `` Dynamic prompt template (socketless). Used when prompt is empty. Supports wildcard syntax, {a|b|c} choices, weights, ranges and more.
enabled BOOL No True When False, prompt and template pass through unchanged without generation.
seed INT No 0 Deterministic seed. Same template + seed always produces the same output.
cleanup_prompt BOOL No True Cleans up the generated prompt: removes unnecessary whitespaces, commas, periods and empty brackets.
Outputs
Name Type Description
prompt STRING The resolved final prompt string.
template STRING The original template, passed through unchanged.
seed INT The seed value, passed through unchanged.

Number

Nifty Math

Evaluates a free-form mathematical expression using up to 16 named inputs (a–p). Unconnected slots default to 0. The result is cast to all three output types simultaneously.

Inputs
Name Type Required Default Description
a … p INT / FLOAT No 0 Auto-growing variable inputs. The first two (a, b) are always visible; additional slots appear as needed up to 16.
expression STRING Yes a + b Expression to evaluate. See supported syntax below.
Outputs
Name Type Description
int INT Result cast to integer (truncated, not rounded).
float FLOAT Result as a float.
boolean BOOL False if result is 0 or 0.0, True otherwise.
Supported Syntax
Category Examples
Arithmetic a + b, a - b, a * b, a / b, a // b, a % b, a ** b
Comparisons a == b, a != b, a < b, a > b, a <= b, a >= b
Boolean logic a and b, a or b, not a
Ternary a if a > 0 else b
Math functions abs, round, min, max, pow, sqrt, floor, ceil, log, log2, log10, exp
Trig sin, cos, tan, asin, acos, atan, atan2, radians, degrees, hypot
Helpers clamp(v, lo, hi), lerp(a, b, t), remap(v, a, b, c, d)
Constants pi, tau, e, inf

Division by zero returns 0. Any other expression error raises a descriptive exception.


Nifty Seed

A seed node with integrated New Seed and Random on Prompt controls. Clicking New Seed immediately randomises the seed. Random on Prompt automatically generates a new random seed every time the queue is triggered.

Inputs
Name Type Required Default Description
seed INT No 0 Seed value (0–1125899906842624).
Outputs
Name Type Description
seed INT The seed value, clamped to the valid range.

Output List

Nodes that output a list. Downstream nodes run once per list item.

Bundle Grid List

Generates every combination (cartesian product) of the given fields as a list of Bundles, e.g. for grid testing. Optionally merged with a base Bundle.

Inputs
Name Type Required Default Description
bundle BUNDLE No — Optional base values merged into every generated combination.
values1 … valuesN STRING No `` Auto-growing list of fields in the format name=value1,value2,value3. Supports dot notation for nested keys, e.g. settings.width=512,768. Numeric values are converted to INT/FLOAT. Empty fields are ignored.
Outputs
Name Type Description
list BUNDLE List with one Bundle per combination.

Combo Auto List

Experimental. Connect combo to any COMBO input to run the downstream node once per combo value, e.g. to sweep every sampler in a single queue run.

Inputs
Name Type Required Default Description
combo COMBO No — Shows all values of the connected combo widget. Display only.
exclude STRING No `` Comma-separated values to skip, supports * wildcards (e.g. euler,*_cfg,*sde*).
Outputs
Name Type Description
combo ANY List of all combo values except the excluded ones.

Any To List

Combines connected values of any matching type into a single output list.

Inputs
Name Type Required Default Description
item1 … item32 ANY No — Auto-growing list of values. Lists are flattened into the result.
Outputs
Name Type Description
list ANY List containing all connected values.

Utils

Experimental workflow organisation and debugging nodes.

Passes any value through unchanged while hiding the connection wire on the incoming side. Useful for keeping graphs readable when a connection has to cross a large distance.

Bypass By Title

Bypasses a set of nodes by title when a boolean is True. Node titles are matched case-insensitively and support partial matches.

Inputs
Name Type Required Default Description
bypass BOOL No False When True, the listed nodes are bypassed.
nodes STRING No `` Node titles to bypass, one per line.
search_from_root BOOL No True Search in the root graph even when called from inside a subgraph.
enforce BOOL No True Actively enforce the bypass state so it cannot be overridden.

Bypass Switch By Title

A multi-option version of Bypass By Title. Each option has its own label and list of nodes to bypass. Selecting an option bypasses all nodes in that option's list and activates the others.

Node Chain Extender

Dynamically duplicates a node and chains the copies together, connecting specified slots between adjacent links.

Subgraph Labels

Assigns display labels to up to 10 subgraph ports. Experimental — requires subgraph support in your ComfyUI version.

Simple Title

A display-only node showing a text label in the graph. Useful for annotating sections of a workflow.

Debug Any

Displays any value as a text preview below the node. Primitives are shown as-is; complex types are serialized to JSON.

Preview Any

Displays up to 16 values simultaneously as inline text previews. For image tensors, shows a summary (N images, WxH) rather than rendering the images. Output lists are shown as one preview per item. The previews are persistent and stay after reloading the workflow.

S
Description
No description provided
Readme
223 KiB
Languages
Python 74.2%
JavaScript 25.8%