Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform adaptive instance normalization on latent representations for style transfer and image synthesis by matching statistical properties and blending based on a factor.
The AdainFilterLatent node is designed to perform adaptive instance normalization (AdaIN) on latent representations, which are intermediate data structures used in neural networks. This node allows you to adjust the style of one latent representation (the target) to match the statistical properties of another latent representation (the reference). By doing so, it enables the transfer of stylistic features from the reference to the target, which can be particularly useful in tasks such as style transfer and image synthesis. The node achieves this by normalizing the target latent's mean and standard deviation to match those of the reference latent, and then blending the adjusted target with the original target based on a specified factor. This process helps in creating more coherent and visually appealing results by harmonizing the styles between different latent representations.
This parameter represents the target latent representation that you want to adjust. It is a required input and should be of type LATENT
. The latent contains the intermediate data that will be normalized and blended with the reference latent.
This parameter represents the reference latent representation whose statistical properties (mean and standard deviation) will be used to adjust the target latent. It is a required input and should be of type LATENT
. The reference latent provides the stylistic features that will be transferred to the target latent.
This parameter determines the size of the filter used for calculating the local mean and standard deviation of the latents. It is an integer value with a default of 1, a minimum of 1, and a maximum of 128. The filter size impacts the granularity of the normalization process, with larger sizes leading to more global adjustments and smaller sizes focusing on more localized adjustments.
This parameter controls the blending factor between the original target latent and the adjusted target latent. It is a float value with a default of 1.0, a minimum of -10.0, and a maximum of 10.0, with a step size of 0.01. A factor of 1.0 means full application of the reference style, while a factor of 0.0 means no change to the original target latent. Negative values can invert the effect, and values greater than 1.0 can exaggerate the style transfer.
The output is a latent representation that has been adjusted to incorporate the stylistic features of the reference latent. This output retains the structure of the original target latent but with modified statistical properties to match those of the reference latent. The result is a harmonized latent that blends the styles of both the target and reference latents.
filter_size
and a factor
close to 0.5.filter_size
and set the factor
closer to 1.0.factor
values to explore creative and unexpected style inversions.RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 3-dimensional input of size [3, 224, 224] instead
ValueError: filter_size must be between 1 and 128
filter_size
parameter is set outside the allowed range.filter_size
parameter to be within the range of 1 to 128.TypeError: factor must be a float
factor
parameter is not provided as a float.factor
parameter is specified as a float value, such as 1.0 or 0.5.© Copyright 2024 RunComfy. All Rights Reserved.