Zum Inhalt springen
Node packÜberprüftExtern
Quelle öffnen

Comfyui-LatentUtils

a set of utils for comfyui latent operation

Betreuer@lrzjasonB · adoptionBewertung

Paketprofil

Status
Überprüft
Verleger
@lrzjason
Quelle
GitHub

README

Latent Utils for ComfyUI

Effect Preview
Example output showing original (left) and enhanced image (right)

high_freq_mult: 2 is an extreme value to show the difference (demo only).

Node Preview

🌟 Overview

This custom ComfyUI node performs selective latent denoising and detail enhancement using Fourier Transform (FFT) techniques. It intelligently separates image frequencies to:

  • Preserve and enhance important high-frequency details
  • Suppress background noise and artifacts
  • Output a visual preview of the processing mask

Ideal for refining AI-generated images while maintaining sharp features and eliminating graininess.

Supports models:

  • Wan vae (Qwen, etc)
  • Flux vae (ZImageTurbo, Flux1.dev, etc)
  • Other models not tested

⚙️ Installation

  1. Navigate to your ComfyUI custom nodes directory: cd ComfyUI/custom_nodes
  2. Clone this repository: git clone https://github.com/lrzjason/comfyui-latent-frequency-enhancer.git
  3. Restart ComfyUI
  4. Find the nodes under:
    • latent → enhancement → Latent Frequency Enhancer (lrzjason)
    • sampling → HFEPostProcessor (lrzjason)

🔬 How It Works

  1. Frequency Separation Uses FFT to split latent into:

    • Low frequencies: Base composition and smooth areas
    • High frequencies: Details, textures, and noise
  2. Smart Mask Generation Creates a dynamic mask using:

    • Sigmoid soft-gating function
    • Adjustable noise threshold
    • Pre-blur for noise coherence
  3. Selective Enhancement

    • Boosts important high-frequency details
    • Suppresses noise below threshold
    • Smoothly blends components using frequency-aware masking
  4. Visual Feedback Outputs a mask preview showing:

    • White areas: Preserved/enhanced details
    • Black areas: Suppressed noise
    • Gray transitions: Smooth blending zones

🚀 HFEPostProcessor: In-Process Enhancement

The HFEPostProcessor node applies high-frequency enhancement during the sampling process rather than after it. This approach:

  • Applies enhancement at specific sampling steps (after basic sampling)
  • Integrates frequency enhancement directly into the generation pipeline
  • Allows for more refined control by specifying which steps to enhance
  • Works as a sampler replacement that combines sampling with enhancement

Qwen Preview

🎚️ Parameters Explained

Latent Frequency Enhancer Node

ParameterDefaultRangeDescription
Detail Strength (HF Mult)1.151.0-2.0Multiplier for high-frequency details (values >1 enhance details)
Frequency Split Sigma2.00.1-20.0Controls frequency separation sharpness (higher = more low frequencies preserved)
Noise Threshold0.050.0-1.0Minimum magnitude to preserve details (higher = more aggressive denoising)
Mask Hardness2.01.0-100.0Transition sharpness in noise suppression (higher = sharper cutoff)
Noise Grouping (Pre-Blur)0.50.0-1.0Pre-blur strength for noise coherence (0.0 disables)

HFEPostProcessor Node

ParameterDefaultRangeDescription
Model--The diffusion model to use for sampling
Steps81-10000Total number of sampled steps
HFE Steps21-100Number of steps to apply high-frequency enhancement
Latent Image--The latent image to enhance
Noise Seed00-18446744073709551615Random seed for noise generation
CFG Scale1.00.0-100.0Classifier-free guidance scale
Sampler Name-VariousName of the sampler to use
Scheduler-VariousScheduler to use for sampling
Positive--Positive conditioning
Negative--Negative conditioning
Detail Strength (HF Mult)1.051.0-2.0Multiplier for high-frequ

Knoten in diesem Paket

2 Knoten (Plural)
  • HFEPostProcessor (lrzjason)
  • LatentFrequencyEnhancer_lrzjason

Quellen

3 Quellen
GitHubQuelle
github.com/lrzjason/Comfyui-LatentUtils

Verifiziert 22. Okt.

GitHubQuelleVersion 04a467ecbc2feae34cb7ed6f17288123f383057f
github.com/lrzjason/Comfyui-LatentUtils

Verifiziert 25. Okt.

Quellenauszüge

1 Auszug

Source context: Repo lrzjason/Comfyui-LatentUtils