Files
xiaden-comfyui-imgutils/restore/node_adversarial.py
T
xiaden 7d82aa22e6 Full split: 26 dedicated nodes with native knobs exposed
Sub-packages:
- edge/ — Canny, Lineart, LineartAnime (3 nodes)
- restore/ — SCUNet, NAFNet, Adversarial (3 nodes)
- compare/ — CCIP, LPIPS (2 nodes)
- validate/ — Classify (11 ops), Check (5 ops), Metric (2 ops)
- tagging/ — WD14, DeepDanbooru, DeepGelbooru, MLDanbooru, Camie, PixAI (6 nodes)

Root nodes:
- ImgUtilsOCR — PaddleOCR with heat/box threshold
- ImgUtilsDetect — 10 detection types + confidence knob
- ImgUtilsPose — DWPose + auto_detect toggle
- ImgUtilsSegment — isnetis + scale knob
- ImgUtilsTags — tag string processing
- ImgUtilsCDC — upscaling + tile_size
- ImgUtilsCensor — NSFW censoring with method/confidence/body-part toggles
- ImgUtilsAlign — resize to max dimension
- ImgUtilsSqueeze — transparency-based auto-crop

Every node exposes its native function parameters as knobs.
Removed mega-nodes: transform (11 ops), compare (3 ops), validate (18 ops).
2026-07-03 01:11:46 +00:00

26 lines
1.1 KiB
Python

"""Node: ImgUtilsAdversarial — Adversarial noise removal."""
from __future__ import annotations
from comfy_api.latest import io
from ..utils import comfy_to_pil, pil_to_comfy
class ImgUtilsAdversarial(io.ComfyNode):
@classmethod
def define_schema(cls) -> io.Schema:
return io.Schema(
node_id="ImgUtilsAdversarial", display_name="Imgutils Restore (Adversarial)",
category="imgutils/restore",
description="Remove adversarial noise using bilateral + guided filtering. No ML model needed.",
search_aliases=["restore", "adversarial", "denoise", "noise", "clean", "mist"],
inputs=[
io.Image.Input("image", tooltip="Input image with adversarial noise"),
],
outputs=[io.Image.Output(display_name="image")],
)
@classmethod
def execute(cls, image) -> io.NodeOutput:
from imgutils.restore import remove_adversarial_noise
pil = comfy_to_pil(image.numpy() if hasattr(image, "numpy") else image)
result = remove_adversarial_noise(pil)
return io.NodeOutput(pil_to_comfy(result))