KorniaFilters adds three image post-processing nodes built on kornia: - Clahe: contrast-limited adaptive histogram equalization on the lightness channel (clip_limit, grid_size_wh) - UnsharpMask: unsharp masking for sharpening (kernel_size, sigma) - Histogram: renders a lightness or RGB histogram as a 1600x400 image TextFindAndReplaceAdv (forked from WAS node suite) adds multi-line find/replace with a max_count limit; returns the modified text plus the replacement count as number/float/int. README documents both node groups. requirements.txt gains matplotlib (used by Histogram); kornia is already a ComfyUI dependency. CamieTagger is intentionally kept local-only and is neither registered nor committed.
44 lines
1.6 KiB
Python
44 lines
1.6 KiB
Python
from .nodes import CLIPTextEncodeWithStats, SaveImgAdv, OpenPoseEditorAdv, SolidMaskAdv, KorniaFilters, TextFindAndReplaceAdv
|
|
import folder_paths
|
|
import os
|
|
|
|
WEB_DIRECTORY = "./js"
|
|
|
|
class colors:
|
|
HEADER = '\033[95m'
|
|
BLUE = '\033[94m'
|
|
CYAN = '\033[96m'
|
|
GREEN = '\033[92m'
|
|
WARNING = '\033[93m'
|
|
FAIL = '\033[91m'
|
|
ENDC = '\033[0m'
|
|
BOLD = '\033[1m'
|
|
UNDERLINE = '\033[4m'
|
|
|
|
comfy_path = os.path.dirname(folder_paths.__file__)
|
|
|
|
def checkForLegacyFolders():
|
|
js_dest_path = os.path.join(comfy_path, "web", "extensions", "ultools")
|
|
legacy_js_dest_path = os.path.join(comfy_path, "web", "extensions", "imginfo")
|
|
|
|
# check presence of legacy folder, print hint it can be removed
|
|
if os.path.isdir(legacy_js_dest_path):
|
|
print(f"{colors.BLUE}ULTools: {colors.WARNING}Found legacy SaveImgAdv path at {legacy_js_dest_path}, this folder and its content can be removed.{colors.ENDC}")
|
|
if os.path.isdir(js_dest_path):
|
|
print(f"{colors.BLUE}ULTools: {colors.WARNING}Found legacy SaveImgAdv path at {js_dest_path}, this folder and its content can be removed.{colors.ENDC}")
|
|
|
|
checkForLegacyFolders()
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"SaveImgAdv": SaveImgAdv.SaveImgAdv,
|
|
"CLIPTextEncodeWithStats": CLIPTextEncodeWithStats.CLIPTextEncodeWithStats,
|
|
"OpenPoseEditorAdv": OpenPoseEditorAdv.OpenPoseEditorAdv,
|
|
"SolidMaskAdv": SolidMaskAdv.SolidMaskAdv,
|
|
"Clahe": KorniaFilters.Clahe,
|
|
"Histogram": KorniaFilters.Histogram,
|
|
"UnsharpMask": KorniaFilters.UnsharpMask,
|
|
"TextFindAndReplaceAdv": TextFindAndReplaceAdv.TextFindAndReplaceAdv,
|
|
}
|
|
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "WEB_DIRECTORY"]
|