Nodes/ComfyUI-spritefusion-pixel-snapper/Sprite Fusion Pixel Snapper
ComfyUI Node

Sprite Fusion Pixel Snapper

A ComfyUI node in image/transform with 14 inputs and 1 output.

By x0x0b·Created 8 months ago·Updated 2 months ago· 18
Sprite Fusion Pixel Snapper
  • image
  • IMAGE
k_colors16
k_seed42
output_scale1
max_kmeans_iterations15
peak_threshold_multiplier0.20
peak_distance_filter4
walker_search_window_ratio0.35
walker_min_search_window2.0
walker_strength_threshold0.50
min_cuts_per_axis4
fallback_target_segments64
max_step_ratio1.80
pixel_size0.0
Categoryimage/transform

Inputs (14)

NameTypeDefaultDescription
imageIMAGEIMAGE tensor (batch supported). Returns list of images.
k_colorsINT161–512Palette size for color quantization (K-Means)
k_seedINT420–2147483647Random seed used when seeding K-Means++ centroids
output_scaleoptINT11–16Integer upscaling factor (nearest-neighbor) applied after snapping
max_kmeans_iterationsoptINT151–200Upper limit on K-Means iterations while learning the palette
peak_threshold_multiplieroptFLOAT0.200–5Fraction of max gradient used as threshold to keep profile peaks
peak_distance_filteroptINT41–512Minimum pixel spacing between retained peaks in the profile
walker_search_window_ratiooptFLOAT0.350.01–5Search window size as a fraction of estimated step when walking cuts
walker_min_search_windowoptFLOAT2.00.1–32Minimum search window (pixels) around each target cut
walker_strength_thresholdoptFLOAT0.500–5Peak must exceed mean*threshold; otherwise fallback to uniform cut
min_cuts_per_axisoptINT42–512Lowest number of cut positions per axis (including ends)
fallback_target_segmentsoptINT641–2048Target number of cells when step detection fails; derives fallback step
max_step_ratiooptFLOAT1.801–5Max allowed X/Y step ratio before snapping to a uniform grid
pixel_sizeoptFLOAT0.00–10000Override detected pixel size in input pixels; 0 keeps auto-detection

Outputs (1)

NameTypeDescription
IMAGEIMAGE