Extensions/ComfyUI-Image-Process
ComfyUI Extension

ComfyUI-Image-Process

A ComfyUI custom node collection for image processing.

By wakaura-asaho·Created 6 months ago·Updated 18 days ago· 2
wakaura-asaho/comfyui-image-process
Nodes18
On cloudLocal install
CategoryWakaura
Stars2
Updated18 days ago

Nodes (18)

Achromatic Stabilizer

Your near-white pixels aren't broken — they're unstable. This fixes that.

Wakaura
Color Patch Flatten

Flatten a color patch to its mean — the gentle way to homogenize flat areas

Wakaura
Color Patch Merge

Turn noisy AI gradients into clean flat-color regions, two ways

Wakaura
ICO Packer

ICO Packer doesn't make an .ico — it's the tray that carries your icon frames

Wakaura
Load ICC Profile

The boring-but-critical node for anyone sending AI images to a printer

Wakaura
Save Image Advanced (AVIF)

AVIF with a speed dial, alpha support, and DPI — the codec's full toolset

Wakaura
Save Image Advanced (BMP)

BMP, but with 32-bit alpha and DPI — for the rare places that actually need it

Wakaura
Save Image Advanced

One save node, seven formats, ICC profiles, and a filename that does math

Wakaura
Save Image Advanced (ICO)

The ICO builder with a slot for every icon size — and alpha masks per slot

Wakaura
Save Image Advanced (JPG)

JPG saving with quality, DPI, EXIF, and a workflow that travels with it

Wakaura
Save Image Advanced (TGA)

TGA with alpha, RLE on your terms, and nothing else in the way

Wakaura
Save Image Advanced (TIFF)

TIFF saving with real compression choices, EXIF, DPI, and alpha

Wakaura
Save Image (AVIF)

The modern-codec saver for people who are done with bloated PNGs

Wakaura
Save Image (BMP)

The uncompromisingly old-school format saver, for when you need a BMP

Wakaura
Save Image (ICO)

Save a whole batch of frames as one Windows icon file

Wakaura
Save Image (JPG)

The zero-frills JPG saver that doesn't drag your workflow around

Wakaura
Save Image (TGA)

The old game-engine format saver that's secretly still useful

Wakaura
Save Image (TIFF)

The no-decisions TIFF saver — and the surprise alpha support it hides

Wakaura
Readme

ComfyUI Image Process

A collection of image-processing nodes designed to enhance and refine AI-generated images within ComfyUI workflows.

<p align="center"> <img src="https://github.com/wakaura-asaho/comfyui-image-process/blob/main/docs/logo.png" alt="Logo" style="display: block; margin: 0 auto; text-align: center;"> </p>

What's New in v1.3.0

ICO Packer and advanced ICO save

  • ICO Packer collects per-size image_N / mask_N pairs (16–256 px) into one ICO_PACKER output. Use the node context menu: Add Input (single size dialog), Batch Add Input (queue sizes then apply), or Remove Input.

  • Save Image Advanced (ICO) now takes only the ICO Packer socket. Per-size image/mask slots on the saver were removed; wire sources into the packer instead.

  • Crop Images on ICO Packer: when enabled, oversize frames are cropped to each slot’s size (masks use the same window).

  • Reference Point (center or top-left): crop anchor when Crop Images is on (disabled in the UI when cropping is off).

Example workflow: Save Image ICO

Example workflow: workflows/example_workflow_imagesv_ico.json.


Nodes Included

1. Achromatic Stabilizer

Corrects achromatic color instability commonly found in AI-generated images.

  • Artifact Detection: Identifies near-zero saturation pixels.

  • Saturation Threshold: Adjusts sensitivity to define artifacts (0.0 - 1.0).

  • Smart Normalization: Converts artifact pixels to neutral grey.

  • Optional Smoothing: Blends corrected areas with the image.

  • Alpha Channel Preservation: Maintains transparency during processing.

  • Invert Alpha: Inverts the alpha channel.

  • Dual Output: Returns both image and alpha mask separately.

2. Color Patch Flatten

Homogenizes colors by flattening their HSV values across patches within a given tolerance.

  • HSV Control: Independently toggles flattening for Hue (H), Saturation (S), and Brightness (V).

  • Tolerance Handling: Flattens values only within the specified tolerance. Larger numbers mean a weaker effect.

  • Alpha Mask Support: Restricts the region for color calculation and flattening.

3. Color Patch Merge

Groups adjacent similar colors and replaces them with their local averages, clustering pixels into solid patches.

  • Merge Solutions:

    • Smooth: Uses a bilateral filter to smooth colors while preserving edges (controlled by Neighborhood).

    • Unify: Iteratively grows solid color regions in Lab space (controlled by Iterations and Minimal Area).

  • Lab Color Space: Optionally converts RGB to Lab space for perceptually accurate grouping.

  • Detail Preservation: "Unify" protects high-gradient edges and small regions below the Minimal Area.

4. Load ICC Profile

Loads an ICC color profile from models/icc_profiles.

Example_workflow

  • Profile Selection: Choose valid .icc or .icm files.

  • Embedding: Outputs profile data for the Save Image Advanced node.

  • Profile Information: Outputs metadata (Model, Manufacturer, Description, Copyright).

[!WARNING]

BMP and TGA do not support ICC Profile embedding.

5. Save Image Advanced

Saves images with alpha channels and metadata.

  • ICC Profile: Embeds a custom color profile.

  • Disable Metadata: Discards workflow metadata to reduce file size.

  • Join Alpha Channel: Clips the image with a mask, similar to Join Image with Alpha.

  • Invert Alpha: Inverts the alpha channel.

  • Compression Level: PNG compression (0-9).

  • Quality: JPEG/WebP quality (1-100).

  • DPI: Sets DPI metadata (1–600, default: 300).

  • TIFF Compression: Supports LZW, Deflate, CCITT, etc.

  • TGA RLE Compression: Toggles RLE compression for TGA.

  • Format: Supports JPG, PNG, WebP, TIFF, BMP, and TGA.

  • Bit Depth: 24bit or 32bit for BMP (32-bit supports alpha).

  • Save to Input Folder: Copies the saved file to the input folder for reuse.

  • Filename prefix tokens: Dynamic tokens in Filename Prefix (independent from ComfyUI core). Right-click the node for Insert Filename Token.

| Token | Output | Example |

|---|---|---|

| %date:FORMAT% | Date/time with custom format | %date:yyyy-MM-dd% → 2026-06-28 |

| %year% | 4-digit year | 2026 |

| %month% | 2-digit month | 06 |

| %day% | 2-digit day | 28 |

| %hour% | 2-digit hour (24 h) | 21 |

| %minute% | 2-digit minute | 05 |

| %second% | 2-digit second | 00 |

| %width% | Image width in pixels | 1024 |

| %height% | Image height in pixels | 1024 |

%date:FORMAT% uses yyyy, yy, MM, dd, HH, hh, mm, ss (e.g. photos/%date:yyyy-MM-dd%/shot → photos/2026-06-28/shot).

File Token Insertion

[!WARNING]

The internal class name of Save Image (Advanced) is SaveImageAdvancedCustom (ComfyUI core also exposes a node named Save Image Advanced).

6. Dedicated Format Savers

Format-specific savers with simple and advanced variants.

Example_workflow

  • JPG: Quick saves or advanced EXIF/DPI control.

  • BMP: Standard saves or 32-bit alpha/DPI support.

  • TIFF: Standard saves or advanced compression/EXIF options.

  • TGA: Standard saves or RLE compression/alpha support.

  • AVIF: Standard saves or advanced quality/speed control.

[!WARNING]

ComfyUI may not display TIFF or TGA files properly in the preview pane. The preview is a PNG copy, but the actual file is saved in your chosen format.

[!TIP]

tiff_ccitt is for black-and-white documents or line-art. For photography, use tiff_lzw, tiff_deflate, or tiff_adobe_deflate.

7. ICO Packer

Prepares multi-resolution icon inputs for Save Image Advanced (ICO).

  • Dynamic size slots: Add image_<size> and mask_<size> pairs via the context menu (standard sizes: 16, 24, 32, 48, 64, 128, 256 px; up to seven unique sizes).

  • ICO_PACKER output: Bundled images, optional masks, and size order for the saver.

  • Crop Images: Crops frames (and masks) down when both dimensions are at least the slot size.

  • Reference Point: center or top-left crop anchor when cropping is enabled.

8. Save Image (ICO) / Save Image Advanced (ICO)

Saves images as Windows .ico files.

Save Image (ICO) — simple batch input:

  • Accepts any batch of images; each frame is checked against valid ICO dimensions (16, 24, 32, 48, 64, 128, 256 px square).

  • Valid frames are bundled into a single .ico file.

  • Invalid frames are optionally saved as individual _INVALID.png files.

Save Image Advanced (ICO) — packer-driven:

  • Connect ICO Packer to the saver’s ICO Packer input.

  • Color Depth: 8bit (256-color palette), 16bit (RGB), or 32bit (RGBA).

  • Compression: none (standard BMP frames), ZIP (PNG-compressed frames, Windows Vista+).

  • Join Alpha Channel / Invert Alpha: Applies the per-size mask from the packer, with optional inversion.

  • Sort by Size: Reorders frames from smallest to largest before bundling (otherwise packer order).

  • Save to Input Folder: Copies the .ico to the input folder for immediate reuse.

  • Save Invalid as PNG: Saves size-mismatched images as fallback PNGs.

[!TIP]

Typical chain: resize or crop sources → ICO Packer (add only the sizes you need) → Save Image Advanced (ICO).


Example Usage

The Achromatic Stabilizer is particularly useful for:

  • Removing color noise from near-white or near-black regions.

  • Improving consistency for models prone to desaturated, hue-unstable pixels.

  • Preserving transparency while correcting color artifacts.

Example_workflow

To use the node:

  1. Connect to Image.

  2. (Optional) Connect an Alpha Mask.

  3. Adjust Saturation Threshold (lower = more aggressive).

  4. Enable Smooth Transitions to blend corrected areas.

  5. Set Smoothing Kernel Size for blending intensity.

  6. Toggle Preserve Alpha as needed.

The Save Image Advanced node can finalize your workflow with extra tweaks:

Example_workflow

The example above removes the background and sends the mask to save with an alpha channel.

Enable Disable Metadata to reduce file size at the cost of workflow readability.


Installation

Method 1: ComfyUI Manager (Recommended)

  1. Install ComfyUI-Manager.

  2. Click on "Install via Git URL".

  3. Paste the URL: https://github.com/wakaura-asaho/comfyui-image-process

  4. Restart ComfyUI.

Method 2: Manual Installation

  1. Open a terminal in ComfyUI/custom_nodes.

  2. Clone this repository:


git clone https://github.com/wakaura-asaho/comfyui-image-process.git
  1. Install dependencies:

pip install -r comfyui-image-process/requirements.txt
  1. Restart ComfyUI.

[!WARNING]

Dependency Notice: Use pip install -r requirements.txt --upgrade-strategy only-if-needed to avoid unnecessary version conflicts.


File Structure

  • image_process.py: Backend logic and node class definitions.

  • image_helper.py: Shared save helpers including the filename prefix resolver.

  • web/image_process.js: Frontend extensions (widget visibility, filename token menu, ICO Packer dynamic inputs).

  • workflows/: Example workflows.

  • docs/: Screenshots referenced in this README.

Usage Tips

[!TIP]

Saturation Threshold: Start at 0.08. Use lower values (e.g., 0.05) for more aggressive correction, or higher values (e.g., 0.15) to be conservative.

[!TIP]

Smoothing Kernel Size: Use 3-5 for subtle corrections. Try 7-15 for pronounced smoothing, though it may blur regions.

[!TIP]

Alpha Preservation: Enable Preserve Alpha with an optional mask to maintain transparency.

[!TIP]

Filename tokens: Right-click any save node and choose Insert Filename Token to append a token without typing. Combine tokens freely, e.g. renders/%date:yyyy-MM-dd%/%hour%-%minute%.

[!TIP]

ICO workflow: Enable Crop Images on ICO Packer when sources are larger than the target size; use center for icons and top-left when alignment matters.

Compatible Versions and Notices

Designed for modern ComfyUI versions (V3 nodes).

  • Tested Environment: Frontend >= v1.37.11, base >= 0.12.3

  • Dependencies: NumPy >= 2.3.5, Pillow >= 12.1.0, SciPy >= 1.16.3, scikit-image >= 0.26.0