ComfyUI InfoComfyUI Info

PPF_Noise_ComfyUI

This product is a set of nodes for ComfyUI. It can generate Perlin power fractal noise and cross - hatch power fractal noise patterns, with adjustable parameters like batch size, width, height, resampling method, etc. It also provides a blending function for two latent tensors with multiple blending operations. Additionally, it can convert images to latent format. The parameters have specific value ranges, allowing users to customize details, complexity, intensity, contrast, etc. of the output.

WASasquatch

24 stars
GitHub

Description

Perlin Power Fractal Noise for ComfyUI [Predecessor of PowerNoiseSuite]

Perlin Power Fractal Noisey Latents

Perlin Power Fractal Noise Example

Power Fractal Latent Generator

Generates a batch of images with a Perlin power fractal effect. This repository is deprecated and replaced by PowerNoiseSuite.


Installation

  • Clone the repository to ComfyUI/custom_nodes. Torch versions do not require requirements.txt to be installed.
    • For users with previous non-torch builds, run the requirements.txt against your ComfyUI Python environment:
      • Example for ComfyUI Standalone Portable: C:\ComfyUI_windows_portable\python_embeded\python.exe -s -m pip install -r "C:\ComfyUI_windows_portable\custom_nodes\PPF_Noise_ComfyUI\requirements.txt"

Perlin Power Fractal Noise Parameters

This node generates Perlin power fractal noise.

Required:

  • batch_size (int): Number of noisy tensors to generate in the batch.
    • Range: [1, 64]
  • width (int): Width of each tensor in pixels.
    • Range: [64, 8192]
  • height (int): Height of each image in pixels.
  • resampling (string): Determines the resampling method for scaling noise to the latent size. Options:
    • "nearest-exact": Selects the nearest source pixel value, resulting in a blocky, pixelated appearance.
    • "bilinear": Uses a weighted average of four nearest source pixels for smoother transitions.
    • "area": Computes values based on source pixel areas, reducing aliasing for finer detail preservation.
    • "bicubic": Uses a cubic polynomial with 16 nearest source pixels for high-quality, smooth resizing.
    • "bislerp": Combines bilinear simplicity with sinc interpolation for high-quality, artifact-reduced resizing.
  • X (float): X-coordinate offset for noise sampling.
    • Range: [-99999999, 99999999]
  • Y (float): Y-coordinate offset for noise sampling.
    • Range: [-99999999, 99999999]
  • Z (float): Z-coordinate offset for noise sampling.
    • Range: [-99999999, 99999999]
  • frame (int): Current frame number for time evolution.
    • Range: [0, 99999999]
  • evolution_factor (float): Controls how much noise evolves over time based on the batch index.
    • Range: [0.0, 1.0]
  • octaves (int): Number of octaves for fractal generation, affecting detail and complexity.
    • Range: [1, 8]
  • persistence (float): Amplitude decrease factor for each octave in fractal generation.
    • Range: [0.01, 23.0]
  • lacunarity (float): Frequency increase factor between octaves in fractal generation.
    • Range: [0.01, 99.0]
  • exponent (float): Adjusts noise intensity and contrast by modifying noise values.
    • Range: [0.01, 38.0]
  • scale (float): Scaling factor for noise frequency; larger values create smaller details, smaller values create larger patterns.
    • Range: [2, 2048]
  • brightness (float): Adjusts overall noise brightness.
    • -1.0: Completely black.
    • 0.0: No effect.
    • 1.0: Completely white.
    • Range: [-1.0, 1.0]
  • contrast (float): Adjusts noise contrast.
    • -1.0: Reduces contrast.
    • 0.0: No effect.
    • 1.0: Increases contrast.
    • Range: [-1.0, 1.0]
  • clamp_min (float): Lower bound for noise values.
    • Range: [-10.0, 10]
  • clamp_max (float): Upper bound for noise values.
    • Range: [-10, 10]
  • seed (int, optional): Seed for random number generation (random seeds used per batch if None).
    • Range: [0, 0xffffffffffffffff]
  • device (string): Device to generate noise on ("cpu" or "cuda").

Optional:

  • optional_vae (VAE, optional): Optional VAE for encoding noise.

Returns:

  • tuple (torch.Tensor [latent], torch.Tensor [image])

Cross-Hatch Power Fractal Parameters

This node generates a batch of cross-hatch power fractal noise patterns.

Required:

  • batch_size (int): Number of noisy tensors to generate in the batch.
    • Range: [1, 64]
  • width (int): Width of each tensor in pixels.
    • Range: [64, 8192]
  • height (int): Height of each image in pixels.
  • resampling (string): Determines the resampling method for scaling noise to the latent size. Options match those in "Perlin Power Fractal Noise".
  • frequency (float): Frequency of the cross-hatch pattern.
    • Range: [0.001, 1024.0]
  • octaves (int): Number of octaves for fractal generation, affecting detail and complexity.
    • Range: [1, 32]
  • persistence (float): Amplitude decrease factor for each octave in fractal generation.
    • Range: [0.001, 2.0]
  • color_tolerance (float): Controls color variety in the output.
    • Range: [0.001, 1.0]
  • num_colors (int): Number of colors used in the output.
    • Range: [2, 256]
  • angle_degrees (float): Angle of the cross-hatch pattern (0.0 to 360.0 degrees).
    • Range: [0.0, 360.0]
  • brightness (float): Adjusts overall noise brightness (same range and behavior as in "Perlin Power Fractal Noise").
  • contrast (float): Adjusts noise contrast (same range and behavior as in "Perlin Power Fractal Noise").
  • blur (float): Blur strength applied to the generated noise.
    • Range: [0.0, 1024.0]
  • clamp_min (float): Lower bound for noise values.
    • Range: [-10.0, 10.0]
  • clamp_max (float): Upper bound for noise values.
    • Range: [-10.0, 10.0]
  • seed (int, optional): Seed for random number generation (random seeds used per batch if None).
    • Range: [0, 0xffffffffffffffff]
  • device (string): Device to generate noise on ("cpu" or "cuda").

Optional:

  • optional_vae (VAE, optional): Optional VAE for encoding noise.

Returns:

  • tuple (LATENT, IMAGE): Contains the generated latent tensor and image tensor.

Blend Latents Parameters

This node blends two latent tensors using specified operations.

Required:

  • latent_a (LATENT, required): First input latent tensor for blending.
  • latent_b (LATENT, required): Second input latent tensor for blending.
  • operation (string, required): Blending operation to apply. Options:
    • add: Combines pixel values by addition.
    • bislerp: Smoothly interpolates using the t factor.
    • color dodge: Brightens the base image based on the blend image.
    • cosine interp: Interpolates using a cosine function.
    • cuberp: Blends via cubic interpolation.
    • difference: Highlights differences by subtracting and taking absolute values.
    • exclusion: Applies an exclusion formula for unique contrast.
    • glow: Creates a glow effect (similar to pin light but darker).
    • hard light: Enhances contrast with sharp light/dark transitions.
    • lerp: Linearly interpolates based on the factor.
    • linear dodge: Brightens by adding blend image values.
    • linear light: Adjusts contrast by brightening/darkening.
    • multiply: Multiplies pixel values for a darker result.
    • overlay: Enhances contrast via an overlay formula.
    • pin light: Preserves details and intensifies colors.
    • random: Adds random noise to both images.
    • reflect: Applies a reflection formula for unique blending.
    • screen: Brightens via a screen formula.
    • slerp: Spherically interpolates for smooth transitions.
    • subtract: Subtracts blend image values from the base.
    • vivid light: Intensifies colors via a vivid light formula.
  • blend_ratio (FLOAT, required): Ratio between latent_a and latent_b.
    • Default: 0.5
    • Range: [0.01, 1.0]
  • blend_strength (FLOAT, required): Strength of the blending operation.
    • Default: 1.0
    • Range: [0.0, 100.0]

Optional:

  • mask (MASK, optional): Mask tensor to control blending regions.
  • set_noise_mask (string, optional): Whether to set the noise mask ("false" or "true").
  • normalize (string, optional): Whether to normalize the output latent ("false" or "true").
  • clamp_min (FLOAT, optional): Minimum clamping value for the output.
    • Default: 0.0
    • Range: [-10.0, 10.0]
  • clamp_max (FLOAT, optional): Maximum clamping value for the output.
    • Default: 1.0
    • Range: [-10.0, 10.0]

Returns:

  • tuple (LATENT,): Contains the blended latent tensor.

Images as Latents Parameters

This node converts IMAGE tensors to LATENT format (without encoding, primarily for raw noise).

Required:

  • images (IMAGE): Input images to convert into latent tensors.
  • resampling (string): Resampling method for scaling images to latent size (options match those in "Perlin Power Fractal Noise").

Returns:

  • tuple (LATENT, IMAGE): Contains the converted latent tensor and input images.