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).
28 lines
1.4 KiB
Python
28 lines
1.4 KiB
Python
"""Node: ImgUtilsLineart — Lineart edge detection."""
|
|
from __future__ import annotations
|
|
from comfy_api.latest import io
|
|
from ..utils import comfy_to_pil, pil_to_comfy
|
|
|
|
class ImgUtilsLineart(io.ComfyNode):
|
|
@classmethod
|
|
def define_schema(cls) -> io.Schema:
|
|
return io.Schema(
|
|
node_id="ImgUtilsLineart", display_name="Imgutils Edge (Lineart)",
|
|
category="imgutils/edge",
|
|
description="Extract lineart edges using a neural lineart model. Best quality, higher resource usage.",
|
|
search_aliases=["edge", "lineart", "outline", "line", "sketch"],
|
|
inputs=[
|
|
io.Image.Input("image", tooltip="Input image"),
|
|
io.Boolean.Input("coarse", default=False, tooltip="Use coarse model for deeper/richer lines."),
|
|
io.Int.Input("detect_resolution", default=512, min=128, max=2048, step=64, tooltip="Detection resolution."),
|
|
],
|
|
outputs=[io.Image.Output(display_name="image")],
|
|
)
|
|
|
|
@classmethod
|
|
def execute(cls, image, coarse, detect_resolution) -> io.NodeOutput:
|
|
from imgutils.edge import edge_image_with_lineart
|
|
pil = comfy_to_pil(image.numpy() if hasattr(image, "numpy") else image)
|
|
result = edge_image_with_lineart(pil, coarse=bool(coarse), detect_resolution=int(detect_resolution))
|
|
return io.NodeOutput(pil_to_comfy(result))
|