ComfyUI > Nodes > ComfyUI-Image-Filters > AdaIN (Image)

ComfyUI Node: AdaIN (Image)

Class Name

AdainImage

Category
image/filters
Author
spacepxl (Account age: 295days)
Extension
ComfyUI-Image-Filters
Latest Updated
2024-06-22
Github Stars
0.08K

How to Install ComfyUI-Image-Filters

Install this extension via the ComfyUI Manager by searching for ComfyUI-Image-Filters
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Image-Filters in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

AdaIN (Image) Description

Perform Adaptive Instance Normalization (AdaIN) on images for style transfer applications, blending style and content.

AdaIN (Image):

The AdainImage node is designed to perform Adaptive Instance Normalization (AdaIN) on images, a technique commonly used in style transfer applications. This node allows you to blend the style of a reference image with the content of your input images, creating a unique combination of both. By adjusting the normalization statistics of the input images to match those of the reference image, the AdainImage node effectively transfers the stylistic features while preserving the original content structure. This process is particularly useful for artists looking to apply specific artistic styles to their images in a controlled and customizable manner.

AdaIN (Image) Input Parameters:

images

This parameter accepts the input images that you want to apply the style transfer to. The images should be in a format that the node can process, typically as tensors. The input images serve as the content that will be blended with the style of the reference image.

reference

This parameter takes the reference image whose style you want to transfer to the input images. The reference image provides the stylistic features, such as color distribution and texture, that will be applied to the input images.

factor

This parameter controls the degree to which the style of the reference image is applied to the input images. It is a floating-point value with a default of 1.0, a minimum of -10.0, and a maximum of 10.0. A factor of 1.0 means full application of the reference style, while a factor of 0.0 would mean no style transfer. Negative values and values greater than 1.0 can be used for more extreme effects.

AdaIN (Image) Output Parameters:

IMAGE

The output of this node is the stylized image, which is a blend of the input images and the reference image's style. The resulting image retains the content structure of the input images while incorporating the stylistic features of the reference image, adjusted according to the specified factor.

AdaIN (Image) Usage Tips:

  • Experiment with different reference images to see how various styles affect your input images.
  • Adjust the factor parameter to fine-tune the intensity of the style transfer. A lower factor will result in a more subtle effect, while a higher factor will produce a more pronounced style.
  • Use high-quality reference images to achieve better stylistic results.

AdaIN (Image) Common Errors and Solutions:

RuntimeError: Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 3-dimensional input of size [3, 224, 224] instead

  • Explanation: This error occurs when the input images or reference image are not in the expected 4-dimensional tensor format.
  • Solution: Ensure that your input and reference images are properly formatted as 4-dimensional tensors, typically with dimensions [Batch, Height, Width, Channels].

ValueError: Factor must be a float between -10.0 and 10.0

  • Explanation: This error is raised when the factor parameter is set to a value outside the allowed range.
  • Solution: Adjust the factor parameter to be within the range of -10.0 to 10.0.

TypeError: Input images and reference must be of type IMAGE

  • Explanation: This error occurs when the input images or reference image are not of the expected type.
  • Solution: Verify that both the input images and the reference image are correctly specified as IMAGE types.

AdaIN (Image) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Image-Filters
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.