ComfyUI Extension: JPG & Noise Remover for ComfyUI

Authored by SnJake

Created

Updated

1 stars

This is a custom node for ComfyUI designed to remove JPEG compression artifacts and digital noise from images. It is powered by a lightweight UNetRestorer model that efficiently restores image quality.

Custom Nodes (0)

    README

    JPG & Noise Remover for ComfyUI

    License: MIT Python Version Made for ComfyUI

    This is a custom node for ComfyUI designed to remove JPEG compression artifacts and digital noise from images. It is powered by a lightweight UNetRestorer model that efficiently restores image quality.


    About this project

    This project is a personal experiment created out of curiosity. The main part of the code was generated by an AI assistant, and my task was to set the goal, prepare the data, run the training and evaluate the result. The model is trained to remove artifacts from images (JPEG, noise) and even shows good quality.


    Examples

    <img width="1536" height="768" alt="Example 1" src="https://github.com/user-attachments/assets/1aea77af-b71a-433c-bdf2-6f0fb8fb297c" /> <img width="1024" height="512" alt="Example 2" src="https://github.com/user-attachments/assets/a406e9f2-0c52-4892-94f8-d0207aae6981" /> <img width="4469" height="1219" alt="Example 4" src="https://github.com/user-attachments/assets/03770090-4743-40c3-b94b-c74413961c4b" />

    🚀 Installation

    The installation consists of two steps: installing the node itself and downloading the model weights.

    Step 1: Install the Node

    1. Open a terminal or command prompt.

    2. Navigate to your ComfyUI custom_nodes directory.

      # Example for Windows
      cd D:\ComfyUI\custom_nodes\
      
      # Example for Linux
      cd ~/ComfyUI/custom_nodes/
      
    3. Clone this repository into the custom_nodes folder:

      git clone https://github.com/SnJake/SnJake_JPG_Artifacts_Noise_Cleaner.git
      
    4. Install Dependencies: Now, you need to install the required Python packages. The command depends on which version of ComfyUI you are using.

      • For standard ComfyUI installations (with venv):

        1. Make sure your ComfyUI virtual environment (venv) is activated.
        2. Navigate into the new node directory and install the requirements:
          cd SnJake_JPG_Artifacts_Noise_Cleaner
          pip install -r requirements.txt
          
      • For Portable ComfyUI installations:

        1. Navigate back to the root of your portable ComfyUI directory (e.g., D:\ComfyUI_windows_portable).
        2. Run the following command to use the embedded Python to install the requirements. Do not activate any venv.
          python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\SnJake_JPG_Artifacts_Noise_Cleaner\requirements.txt
          

    Step 2: Install the Model Weights (Or you can skip this step, the node will download the model weights itself after starting the Queue)

    1. Navigate to your ComfyUI/models/ directory.
    2. Create a folder named artifacts_remover inside it, if it doesn't already exist.
    3. Download the model weights file (.pt or .safetensors) from the Hugging Face page.
    4. Place the downloaded weights file into the ComfyUI/models/artifacts_remover/ directory.

    Step 3: Restart

    Restart ComfyUI completely. The new node will be available in the "Add Node" menu.


    ✨ Usage

    The node can be found in the "Add Node" menu under 😎 SnJake/JPG & Noise Remover.

    Inputs

    • image: The source image to be processed.
    • weights_name: A dropdown list to select the model weights file from the models/artifacts_remover folder.
    • weights_path: (Optional) A direct path to the weights file if it is located elsewhere.
    • base_ch: The number of base channels in the model. This must match the model it was trained with (default is 64).
    • tile: The tile size for processing large images. This helps prevent VRAM shortages. A value of 0 disables tiling. Recommended value: 256-512.
    • overlap: The overlap area between tiles for smoother blending. Recommended value: 64-128.
    • edge_aware_window: Use a smart blending window that avoids darkening the edges of the image where there are no adjacent tiles. It is recommended to keep this enabled (True).
    • blend: A factor to blend the result with the original image (from 0.0 to 1.0). Small values (e.g., 0.1-0.2) can help restore very fine details if the model has over-smoothed them. 0.0 means the effect is fully applied.
    • amp_dtype: The precision for computations (for CUDA). auto is the optimal choice.
    • device: The device for computations (auto, cuda, cpu).

    Outputs

    • image: The image after artifact and noise removal.

    Training code is included in /training_code for reference, but the main purpose of this repo is the ComfyUI node and pre-trained weights.


    📜 License

    This project is licensed under the MIT License. See the LICENSE file for details.