A set of tools for manipulating latent tensors in ComfyUI
A set of custom nodes for ComfyUI, providing a specialized Latent Normalized Lanczos Resize workflow.
custom_nodes
folder.MANY MISSING NODES HERE - WILL BE UPDATED
Implementation of Perturbed Attention Guidance that also takes into account the insight of RescaleCFG.
Compared to vanilla PAG this results in much better dynamic range and much less "deep frying" or oversaturation.
This is still a little bit experimental and some amount of experimentation with sampling parameters and PAG parameters is recommended. pag_scale = 1/2 cfg is a good starting point and I recommend a post rescale close to 1.0.
The samplers seem to converge faster with this turned on so a decrease of number of steps might be possible with little loss of quality.
A specialized upscaling node designed to:
This aims to produce an upscaled latent that stays more faithful to the original diffusion pass, avoiding excessive blur, and optionally adding noise. It can serve as a fast base for subsequent (re-)diffusion or refinement steps, in which case the noise addition can help to introduce additional details and variations at different scales.
size_multiplier
Multiplies original spatial dimensions (width/height).
(Default: 2.0; Range: 0.1–4.0)
soft_clamp_outliers (enable/disable)
Toggles outlier soft-clamping before decoding.
(Default: enable)
outlier_quantile
Quantile threshold for outlier soft-clamping.
(Default: 0.01; Range: 0–1)
outlier_clamp_slope
Slope of the clamp outside the quantile range.
(Default: 0.1; Range: 0–1)
add_latent_noise (enable/disable)
Adds correlated Gaussian noise to the final latent.
(Default: disable)
latent_noise_std
Standard deviation for the generated noise.
(Default: 1.0; Range: 0–10)
latent_noise_scale
Scaling factor applied to the correlated noise before adding.
(Default: 0.1; Range: 0.01–10)
add_latent_upscale_with_weight
Blends the newly encoded latent with a direct “latent nearest” upscale.
(Default: 0.0; Range: 0–1)