mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-27 16:26:39 +00:00
Renamed ComfyNodeV3 to ComfyNode, renamed ComfyNodeInternal to _ComfyNodeInternal
This commit is contained in:
parent
b0f73174b2
commit
d984cee318
@ -17,7 +17,7 @@ def first_real_override(cls: type, name: str, *, base: type=None) -> Optional[Ca
|
|||||||
if base_attr is None:
|
if base_attr is None:
|
||||||
return None
|
return None
|
||||||
base_func = base_attr.__func__
|
base_func = base_attr.__func__
|
||||||
for c in cls.mro(): # NodeB, NodeA, ComfyNodeV3, object …
|
for c in cls.mro(): # NodeB, NodeA, ComfyNode, object …
|
||||||
if c is base: # reached the placeholder – we're done
|
if c is base: # reached the placeholder – we're done
|
||||||
break
|
break
|
||||||
if name in c.__dict__: # first class that *defines* the attr
|
if name in c.__dict__: # first class that *defines* the attr
|
||||||
@ -27,7 +27,7 @@ def first_real_override(cls: type, name: str, *, base: type=None) -> Optional[Ca
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
class ComfyNodeInternal:
|
class _ComfyNodeInternal:
|
||||||
"""Class that all V3-based APIs inherit from for ComfyNode.
|
"""Class that all V3-based APIs inherit from for ComfyNode.
|
||||||
|
|
||||||
This is intended to only be referenced within execution.py, as it has to handle all V3 APIs going forward."""
|
This is intended to only be referenced within execution.py, as it has to handle all V3 APIs going forward."""
|
||||||
|
@ -22,7 +22,7 @@ from comfy.samplers import CFGGuider, Sampler
|
|||||||
from comfy.sd import CLIP, VAE
|
from comfy.sd import CLIP, VAE
|
||||||
from comfy.sd import StyleModel as StyleModel_
|
from comfy.sd import StyleModel as StyleModel_
|
||||||
from comfy_api.input import VideoInput
|
from comfy_api.input import VideoInput
|
||||||
from comfy_api.internal import (ComfyNodeInternal, classproperty, copy_class, first_real_override, is_class,
|
from comfy_api.internal import (_ComfyNodeInternal, classproperty, copy_class, first_real_override, is_class,
|
||||||
prune_dict, shallow_clone_class)
|
prune_dict, shallow_clone_class)
|
||||||
from comfy_api.v3.resources import Resources, ResourcesLocal
|
from comfy_api.v3.resources import Resources, ResourcesLocal
|
||||||
from comfy_execution.graph import ExecutionBlocker
|
from comfy_execution.graph import ExecutionBlocker
|
||||||
@ -1116,7 +1116,7 @@ def add_to_dict_v3(io: InputV3 | OutputV3, d: dict):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class _ComfyNodeBaseInternal(ComfyNodeInternal):
|
class _ComfyNodeBaseInternal(_ComfyNodeInternal):
|
||||||
"""Common base class for storing internal methods and properties; DO NOT USE for defining nodes."""
|
"""Common base class for storing internal methods and properties; DO NOT USE for defining nodes."""
|
||||||
|
|
||||||
RELATIVE_PYTHON_MODULE = None
|
RELATIVE_PYTHON_MODULE = None
|
||||||
@ -1222,10 +1222,10 @@ class _ComfyNodeBaseInternal(ComfyNodeInternal):
|
|||||||
|
|
||||||
@final
|
@final
|
||||||
@classmethod
|
@classmethod
|
||||||
def PREPARE_CLASS_CLONE(cls, hidden_inputs: dict) -> type[ComfyNodeV3]:
|
def PREPARE_CLASS_CLONE(cls, hidden_inputs: dict) -> type[ComfyNode]:
|
||||||
"""Creates clone of real node class to prevent monkey-patching."""
|
"""Creates clone of real node class to prevent monkey-patching."""
|
||||||
c_type: type[ComfyNodeV3] = cls if is_class(cls) else type(cls)
|
c_type: type[ComfyNode] = cls if is_class(cls) else type(cls)
|
||||||
type_clone: type[ComfyNodeV3] = shallow_clone_class(c_type)
|
type_clone: type[ComfyNode] = shallow_clone_class(c_type)
|
||||||
# set hidden
|
# set hidden
|
||||||
type_clone.hidden = HiddenHolder.from_dict(hidden_inputs)
|
type_clone.hidden = HiddenHolder.from_dict(hidden_inputs)
|
||||||
return type_clone
|
return type_clone
|
||||||
@ -1408,7 +1408,7 @@ class _ComfyNodeBaseInternal(ComfyNodeInternal):
|
|||||||
#############################################
|
#############################################
|
||||||
|
|
||||||
|
|
||||||
class ComfyNodeV3(_ComfyNodeBaseInternal):
|
class ComfyNode(_ComfyNodeBaseInternal):
|
||||||
"""Common base class for all V3 nodes."""
|
"""Common base class for all V3 nodes."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -1453,7 +1453,7 @@ class ComfyNodeV3(_ComfyNodeBaseInternal):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def GET_BASE_CLASS(cls):
|
def GET_BASE_CLASS(cls):
|
||||||
"""DO NOT override this class. Will break things in execution.py."""
|
"""DO NOT override this class. Will break things in execution.py."""
|
||||||
return ComfyNodeV3
|
return ComfyNode
|
||||||
|
|
||||||
|
|
||||||
class NodeOutput:
|
class NodeOutput:
|
||||||
|
@ -17,7 +17,7 @@ import folder_paths
|
|||||||
|
|
||||||
# used for image preview
|
# used for image preview
|
||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
from comfy_api.v3.io import ComfyNodeV3, FolderType, Image, _UIOutput
|
from comfy_api.v3.io import ComfyNode, FolderType, Image, _UIOutput
|
||||||
|
|
||||||
|
|
||||||
class SavedResult(dict):
|
class SavedResult(dict):
|
||||||
@ -78,7 +78,7 @@ class ImageSaveHelper:
|
|||||||
return PILImage.fromarray(np.clip(255.0 * image_tensor.cpu().numpy(), 0, 255).astype(np.uint8))
|
return PILImage.fromarray(np.clip(255.0 * image_tensor.cpu().numpy(), 0, 255).astype(np.uint8))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _create_png_metadata(cls: Type[ComfyNodeV3] | None) -> PngInfo | None:
|
def _create_png_metadata(cls: Type[ComfyNode] | None) -> PngInfo | None:
|
||||||
"""Creates a PngInfo object with prompt and extra_pnginfo."""
|
"""Creates a PngInfo object with prompt and extra_pnginfo."""
|
||||||
if args.disable_metadata or cls is None or not cls.hidden:
|
if args.disable_metadata or cls is None or not cls.hidden:
|
||||||
return None
|
return None
|
||||||
@ -91,7 +91,7 @@ class ImageSaveHelper:
|
|||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _create_animated_png_metadata(cls: Type[ComfyNodeV3] | None) -> PngInfo | None:
|
def _create_animated_png_metadata(cls: Type[ComfyNode] | None) -> PngInfo | None:
|
||||||
"""Creates a PngInfo object with prompt and extra_pnginfo for animated PNGs (APNG)."""
|
"""Creates a PngInfo object with prompt and extra_pnginfo for animated PNGs (APNG)."""
|
||||||
if args.disable_metadata or cls is None or not cls.hidden:
|
if args.disable_metadata or cls is None or not cls.hidden:
|
||||||
return None
|
return None
|
||||||
@ -116,7 +116,7 @@ class ImageSaveHelper:
|
|||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _create_webp_metadata(pil_image: PILImage.Image, cls: Type[ComfyNodeV3] | None) -> PILImage.Exif:
|
def _create_webp_metadata(pil_image: PILImage.Image, cls: Type[ComfyNode] | None) -> PILImage.Exif:
|
||||||
"""Creates EXIF metadata bytes for WebP images."""
|
"""Creates EXIF metadata bytes for WebP images."""
|
||||||
exif_data = pil_image.getexif()
|
exif_data = pil_image.getexif()
|
||||||
if args.disable_metadata or cls is None or cls.hidden is None:
|
if args.disable_metadata or cls is None or cls.hidden is None:
|
||||||
@ -132,7 +132,7 @@ class ImageSaveHelper:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def save_images(
|
def save_images(
|
||||||
images, filename_prefix: str, folder_type: FolderType, cls: Type[ComfyNodeV3] | None, compress_level = 4,
|
images, filename_prefix: str, folder_type: FolderType, cls: Type[ComfyNode] | None, compress_level = 4,
|
||||||
) -> list[SavedResult]:
|
) -> list[SavedResult]:
|
||||||
"""Saves a batch of images as individual PNG files."""
|
"""Saves a batch of images as individual PNG files."""
|
||||||
full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path(
|
full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path(
|
||||||
@ -150,7 +150,7 @@ class ImageSaveHelper:
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_save_images_ui(images, filename_prefix: str, cls: Type[ComfyNodeV3] | None, compress_level=4) -> SavedImages:
|
def get_save_images_ui(images, filename_prefix: str, cls: Type[ComfyNode] | None, compress_level=4) -> SavedImages:
|
||||||
"""Saves a batch of images and returns a UI object for the node output."""
|
"""Saves a batch of images and returns a UI object for the node output."""
|
||||||
return SavedImages(
|
return SavedImages(
|
||||||
ImageSaveHelper.save_images(
|
ImageSaveHelper.save_images(
|
||||||
@ -164,7 +164,7 @@ class ImageSaveHelper:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def save_animated_png(
|
def save_animated_png(
|
||||||
images, filename_prefix: str, folder_type: FolderType, cls: Type[ComfyNodeV3] | None, fps: float, compress_level: int
|
images, filename_prefix: str, folder_type: FolderType, cls: Type[ComfyNode] | None, fps: float, compress_level: int
|
||||||
) -> SavedResult:
|
) -> SavedResult:
|
||||||
"""Saves a batch of images as a single animated PNG."""
|
"""Saves a batch of images as a single animated PNG."""
|
||||||
full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path(
|
full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path(
|
||||||
@ -186,7 +186,7 @@ class ImageSaveHelper:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_save_animated_png_ui(
|
def get_save_animated_png_ui(
|
||||||
images, filename_prefix: str, cls: Type[ComfyNodeV3] | None, fps: float, compress_level: int
|
images, filename_prefix: str, cls: Type[ComfyNode] | None, fps: float, compress_level: int
|
||||||
) -> SavedImages:
|
) -> SavedImages:
|
||||||
"""Saves an animated PNG and returns a UI object for the node output."""
|
"""Saves an animated PNG and returns a UI object for the node output."""
|
||||||
result = ImageSaveHelper.save_animated_png(
|
result = ImageSaveHelper.save_animated_png(
|
||||||
@ -204,7 +204,7 @@ class ImageSaveHelper:
|
|||||||
images,
|
images,
|
||||||
filename_prefix: str,
|
filename_prefix: str,
|
||||||
folder_type: FolderType,
|
folder_type: FolderType,
|
||||||
cls: Type[ComfyNodeV3] | None,
|
cls: Type[ComfyNode] | None,
|
||||||
fps: float,
|
fps: float,
|
||||||
lossless: bool,
|
lossless: bool,
|
||||||
quality: int,
|
quality: int,
|
||||||
@ -233,7 +233,7 @@ class ImageSaveHelper:
|
|||||||
def get_save_animated_webp_ui(
|
def get_save_animated_webp_ui(
|
||||||
images,
|
images,
|
||||||
filename_prefix: str,
|
filename_prefix: str,
|
||||||
cls: Type[ComfyNodeV3] | None,
|
cls: Type[ComfyNode] | None,
|
||||||
fps: float,
|
fps: float,
|
||||||
lossless: bool,
|
lossless: bool,
|
||||||
quality: int,
|
quality: int,
|
||||||
@ -262,7 +262,7 @@ class AudioSaveHelper:
|
|||||||
audio: dict,
|
audio: dict,
|
||||||
filename_prefix: str,
|
filename_prefix: str,
|
||||||
folder_type: FolderType,
|
folder_type: FolderType,
|
||||||
cls: Type[ComfyNodeV3] | None,
|
cls: Type[ComfyNode] | None,
|
||||||
format: str = "flac",
|
format: str = "flac",
|
||||||
quality: str = "128k",
|
quality: str = "128k",
|
||||||
) -> list[SavedResult]:
|
) -> list[SavedResult]:
|
||||||
@ -364,7 +364,7 @@ class AudioSaveHelper:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_save_audio_ui(
|
def get_save_audio_ui(
|
||||||
audio, filename_prefix: str, cls: Type[ComfyNodeV3] | None, format: str = "flac", quality: str = "128k",
|
audio, filename_prefix: str, cls: Type[ComfyNode] | None, format: str = "flac", quality: str = "128k",
|
||||||
) -> SavedAudios:
|
) -> SavedAudios:
|
||||||
"""Save and instantly wrap for UI."""
|
"""Save and instantly wrap for UI."""
|
||||||
return SavedAudios(
|
return SavedAudios(
|
||||||
@ -380,7 +380,7 @@ class AudioSaveHelper:
|
|||||||
|
|
||||||
|
|
||||||
class PreviewImage(_UIOutput):
|
class PreviewImage(_UIOutput):
|
||||||
def __init__(self, image: Image.Type, animated: bool = False, cls: Type[ComfyNodeV3] = None, **kwargs):
|
def __init__(self, image: Image.Type, animated: bool = False, cls: Type[ComfyNode] = None, **kwargs):
|
||||||
self.values = ImageSaveHelper.save_images(
|
self.values = ImageSaveHelper.save_images(
|
||||||
image,
|
image,
|
||||||
filename_prefix="ComfyUI_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5)),
|
filename_prefix="ComfyUI_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5)),
|
||||||
@ -398,7 +398,7 @@ class PreviewImage(_UIOutput):
|
|||||||
|
|
||||||
|
|
||||||
class PreviewMask(PreviewImage):
|
class PreviewMask(PreviewImage):
|
||||||
def __init__(self, mask: PreviewMask.Type, animated: bool=False, cls: ComfyNodeV3=None, **kwargs):
|
def __init__(self, mask: PreviewMask.Type, animated: bool=False, cls: ComfyNode=None, **kwargs):
|
||||||
preview = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3)
|
preview = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3)
|
||||||
super().__init__(preview, animated, cls, **kwargs)
|
super().__init__(preview, animated, cls, **kwargs)
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ class PreviewMask(PreviewImage):
|
|||||||
|
|
||||||
|
|
||||||
class PreviewAudio(_UIOutput):
|
class PreviewAudio(_UIOutput):
|
||||||
def __init__(self, audio: dict, cls: Type[ComfyNodeV3] = None, **kwargs):
|
def __init__(self, audio: dict, cls: Type[ComfyNode] = None, **kwargs):
|
||||||
self.values = AudioSaveHelper.save_audio(
|
self.values = AudioSaveHelper.save_audio(
|
||||||
audio,
|
audio,
|
||||||
filename_prefix="ComfyUI_temp_" + "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for _ in range(5)),
|
filename_prefix="ComfyUI_temp_" + "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for _ in range(5)),
|
||||||
|
@ -17,7 +17,7 @@ class XYZ:
|
|||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
class V3TestNode(io.ComfyNodeV3):
|
class V3TestNode(io.ComfyNode):
|
||||||
# NOTE: this is here just to test that state is not leaking
|
# NOTE: this is here just to test that state is not leaking
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -91,7 +91,7 @@ class V3TestNode(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(some_int, image, ui=ui.PreviewImage(image, cls=cls))
|
return io.NodeOutput(some_int, image, ui=ui.PreviewImage(image, cls=cls))
|
||||||
|
|
||||||
|
|
||||||
class V3LoraLoader(io.ComfyNodeV3):
|
class V3LoraLoader(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -141,7 +141,7 @@ class V3LoraLoader(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(model_lora, clip_lora)
|
return io.NodeOutput(model_lora, clip_lora)
|
||||||
|
|
||||||
|
|
||||||
class NInputsTest(io.ComfyNodeV3):
|
class NInputsTest(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -183,7 +183,7 @@ class NInputsTest(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(combined_image)
|
return io.NodeOutput(combined_image)
|
||||||
|
|
||||||
|
|
||||||
class V3TestSleep(io.ComfyNodeV3):
|
class V3TestSleep(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -218,7 +218,7 @@ class V3TestSleep(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(value)
|
return io.NodeOutput(value)
|
||||||
|
|
||||||
|
|
||||||
class V3DummyStart(io.ComfyNodeV3):
|
class V3DummyStart(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -237,7 +237,7 @@ class V3DummyStart(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(None)
|
return io.NodeOutput(None)
|
||||||
|
|
||||||
|
|
||||||
class V3DummyEnd(io.ComfyNodeV3):
|
class V3DummyEnd(io.ComfyNode):
|
||||||
COOL_VALUE = 123
|
COOL_VALUE = 123
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -279,7 +279,7 @@ class V3DummyEndInherit(V3DummyEnd):
|
|||||||
return super().execute(xyz)
|
return super().execute(xyz)
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
V3TestNode,
|
V3TestNode,
|
||||||
V3LoraLoader,
|
V3LoraLoader,
|
||||||
NInputsTest,
|
NInputsTest,
|
||||||
|
@ -7,7 +7,7 @@ import node_helpers
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class TextEncodeAceStepAudio(io.ComfyNodeV3):
|
class TextEncodeAceStepAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -29,7 +29,7 @@ class TextEncodeAceStepAudio(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(conditioning)
|
return io.NodeOutput(conditioning)
|
||||||
|
|
||||||
|
|
||||||
class EmptyAceStepLatentAudio(io.ComfyNodeV3):
|
class EmptyAceStepLatentAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -51,7 +51,7 @@ class EmptyAceStepLatentAudio(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"samples": latent, "type": "audio"})
|
return io.NodeOutput({"samples": latent, "type": "audio"})
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
TextEncodeAceStepAudio,
|
TextEncodeAceStepAudio,
|
||||||
EmptyAceStepLatentAudio,
|
EmptyAceStepLatentAudio,
|
||||||
]
|
]
|
||||||
|
@ -41,7 +41,7 @@ def sample_lcm_upscale(
|
|||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
class SamplerLCMUpscale(io.ComfyNodeV3):
|
class SamplerLCMUpscale(io.ComfyNode):
|
||||||
UPSCALE_METHODS = ["bislerp", "nearest-exact", "bilinear", "area", "bicubic"]
|
UPSCALE_METHODS = ["bislerp", "nearest-exact", "bilinear", "area", "bicubic"]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -99,7 +99,7 @@ def sample_euler_pp(model, x, sigmas, extra_args=None, callback=None, disable=No
|
|||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
||||||
class SamplerEulerCFGpp(io.ComfyNodeV3):
|
class SamplerEulerCFGpp(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -47,7 +47,7 @@ def loglinear_interp(t_steps, num_steps):
|
|||||||
return np.exp(new_ys)[::-1].copy()
|
return np.exp(new_ys)[::-1].copy()
|
||||||
|
|
||||||
|
|
||||||
class AlignYourStepsScheduler(io.ComfyNodeV3):
|
class AlignYourStepsScheduler(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -10,7 +10,7 @@ def project(v0, v1):
|
|||||||
return v0_parallel, v0_orthogonal
|
return v0_parallel, v0_orthogonal
|
||||||
|
|
||||||
|
|
||||||
class APG(io.ComfyNodeV3):
|
class APG(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -17,7 +17,7 @@ def attention_multiply(attn, model, q, k, v, out):
|
|||||||
return m
|
return m
|
||||||
|
|
||||||
|
|
||||||
class UNetSelfAttentionMultiply(io.ComfyNodeV3):
|
class UNetSelfAttentionMultiply(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -39,7 +39,7 @@ class UNetSelfAttentionMultiply(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(attention_multiply("attn1", model, q, k, v, out))
|
return io.NodeOutput(attention_multiply("attn1", model, q, k, v, out))
|
||||||
|
|
||||||
|
|
||||||
class UNetCrossAttentionMultiply(io.ComfyNodeV3):
|
class UNetCrossAttentionMultiply(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -61,7 +61,7 @@ class UNetCrossAttentionMultiply(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(attention_multiply("attn2", model, q, k, v, out))
|
return io.NodeOutput(attention_multiply("attn2", model, q, k, v, out))
|
||||||
|
|
||||||
|
|
||||||
class CLIPAttentionMultiply(io.ComfyNodeV3):
|
class CLIPAttentionMultiply(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -95,7 +95,7 @@ class CLIPAttentionMultiply(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class UNetTemporalAttentionMultiply(io.ComfyNodeV3):
|
class UNetTemporalAttentionMultiply(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -12,7 +12,7 @@ import node_helpers
|
|||||||
from comfy_api.v3 import io, ui
|
from comfy_api.v3 import io, ui
|
||||||
|
|
||||||
|
|
||||||
class ConditioningStableAudio(io.ComfyNodeV3):
|
class ConditioningStableAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -42,7 +42,7 @@ class ConditioningStableAudio(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class EmptyLatentAudio(io.ComfyNodeV3):
|
class EmptyLatentAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -64,7 +64,7 @@ class EmptyLatentAudio(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"samples": latent, "type": "audio"})
|
return io.NodeOutput({"samples": latent, "type": "audio"})
|
||||||
|
|
||||||
|
|
||||||
class LoadAudio(io.ComfyNodeV3):
|
class LoadAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -102,7 +102,7 @@ class LoadAudio(io.ComfyNodeV3):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class PreviewAudio(io.ComfyNodeV3):
|
class PreviewAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -121,7 +121,7 @@ class PreviewAudio(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(ui=ui.PreviewAudio(audio, cls=cls))
|
return io.NodeOutput(ui=ui.PreviewAudio(audio, cls=cls))
|
||||||
|
|
||||||
|
|
||||||
class SaveAudioMP3(io.ComfyNodeV3):
|
class SaveAudioMP3(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -146,7 +146,7 @@ class SaveAudioMP3(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SaveAudioOpus(io.ComfyNodeV3):
|
class SaveAudioOpus(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -171,7 +171,7 @@ class SaveAudioOpus(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SaveAudio(io.ComfyNodeV3):
|
class SaveAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -193,7 +193,7 @@ class SaveAudio(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class VAEDecodeAudio(io.ComfyNodeV3):
|
class VAEDecodeAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -215,7 +215,7 @@ class VAEDecodeAudio(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"waveform": audio, "sample_rate": 44100})
|
return io.NodeOutput({"waveform": audio, "sample_rate": 44100})
|
||||||
|
|
||||||
|
|
||||||
class VAEEncodeAudio(io.ComfyNodeV3):
|
class VAEEncodeAudio(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -238,7 +238,7 @@ class VAEEncodeAudio(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"samples": vae.encode(waveform.movedim(1, -1))})
|
return io.NodeOutput({"samples": vae.encode(waveform.movedim(1, -1))})
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
ConditioningStableAudio,
|
ConditioningStableAudio,
|
||||||
EmptyLatentAudio,
|
EmptyLatentAudio,
|
||||||
LoadAudio,
|
LoadAudio,
|
||||||
|
@ -135,7 +135,7 @@ def get_camera_motion(angle, T, speed, n=81):
|
|||||||
return RT
|
return RT
|
||||||
|
|
||||||
|
|
||||||
class WanCameraEmbedding(io.ComfyNodeV3):
|
class WanCameraEmbedding(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -6,7 +6,7 @@ import comfy.model_management
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class Canny(io.ComfyNodeV3):
|
class Canny(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -21,7 +21,7 @@ def optimized_scale(positive, negative):
|
|||||||
return st_star.reshape([positive.shape[0]] + [1] * (positive.ndim - 1))
|
return st_star.reshape([positive.shape[0]] + [1] * (positive.ndim - 1))
|
||||||
|
|
||||||
|
|
||||||
class CFGNorm(io.ComfyNodeV3):
|
class CFGNorm(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -52,7 +52,7 @@ class CFGNorm(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class CFGZeroStar(io.ComfyNodeV3):
|
class CFGZeroStar(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -4,7 +4,7 @@ import nodes
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodeSDXL(io.ComfyNodeV3):
|
class CLIPTextEncodeSDXL(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -48,7 +48,7 @@ class CLIPTextEncodeSDXL(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(conditioning)
|
return io.NodeOutput(conditioning)
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodeSDXLRefiner(io.ComfyNodeV3):
|
class CLIPTextEncodeSDXLRefiner(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -112,7 +112,7 @@ def porter_duff_composite(
|
|||||||
return out_image, out_alpha
|
return out_image, out_alpha
|
||||||
|
|
||||||
|
|
||||||
class JoinImageWithAlpha(io.ComfyNodeV3):
|
class JoinImageWithAlpha(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -138,7 +138,7 @@ class JoinImageWithAlpha(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.stack(out_images))
|
return io.NodeOutput(torch.stack(out_images))
|
||||||
|
|
||||||
|
|
||||||
class PorterDuffImageComposite(io.ComfyNodeV3):
|
class PorterDuffImageComposite(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -199,7 +199,7 @@ class PorterDuffImageComposite(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.stack(out_images), torch.stack(out_alphas))
|
return io.NodeOutput(torch.stack(out_images), torch.stack(out_alphas))
|
||||||
|
|
||||||
|
|
||||||
class SplitImageWithAlpha(io.ComfyNodeV3):
|
class SplitImageWithAlpha(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodeControlnet(io.ComfyNodeV3):
|
class CLIPTextEncodeControlnet(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -30,7 +30,7 @@ class CLIPTextEncodeControlnet(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(c)
|
return io.NodeOutput(c)
|
||||||
|
|
||||||
|
|
||||||
class T5TokenizerOptions(io.ComfyNodeV3):
|
class T5TokenizerOptions(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -3,7 +3,7 @@ from comfy.cldm.control_types import UNION_CONTROLNET_TYPES
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class ControlNetApplyAdvanced(io.ComfyNodeV3):
|
class ControlNetApplyAdvanced(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -60,7 +60,7 @@ class ControlNetApplyAdvanced(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(out[0], out[1])
|
return io.NodeOutput(out[0], out[1])
|
||||||
|
|
||||||
|
|
||||||
class SetUnionControlNetType(io.ComfyNodeV3):
|
class SetUnionControlNetType(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -134,7 +134,7 @@ class ControlNetInpaintingAliMamaApply(ControlNetApplyAdvanced):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
ControlNetApplyAdvanced,
|
ControlNetApplyAdvanced,
|
||||||
SetUnionControlNetType,
|
SetUnionControlNetType,
|
||||||
ControlNetInpaintingAliMamaApply,
|
ControlNetInpaintingAliMamaApply,
|
||||||
|
@ -20,7 +20,7 @@ def vae_encode_with_padding(vae, image, width, height, length, padding=0):
|
|||||||
return latent_temp[:, :, :latent_len]
|
return latent_temp[:, :, :latent_len]
|
||||||
|
|
||||||
|
|
||||||
class CosmosImageToVideoLatent(io.ComfyNodeV3):
|
class CosmosImageToVideoLatent(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -67,7 +67,7 @@ class CosmosImageToVideoLatent(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(out_latent)
|
return io.NodeOutput(out_latent)
|
||||||
|
|
||||||
|
|
||||||
class CosmosPredict2ImageToVideoLatent(io.ComfyNodeV3):
|
class CosmosPredict2ImageToVideoLatent(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -116,7 +116,7 @@ class CosmosPredict2ImageToVideoLatent(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(out_latent)
|
return io.NodeOutput(out_latent)
|
||||||
|
|
||||||
|
|
||||||
class EmptyCosmosLatentVideo(io.ComfyNodeV3):
|
class EmptyCosmosLatentVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls) -> io.Schema:
|
def define_schema(cls) -> io.Schema:
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -5,7 +5,7 @@ import torch
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class DifferentialDiffusion(io.ComfyNodeV3):
|
class DifferentialDiffusion(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -4,7 +4,7 @@ import node_helpers
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class ReferenceLatent(io.ComfyNodeV3):
|
class ReferenceLatent(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -25,7 +25,7 @@ PREFERED_KONTEXT_RESOLUTIONS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodeFlux(io.ComfyNodeV3):
|
class CLIPTextEncodeFlux(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -50,7 +50,7 @@ class CLIPTextEncodeFlux(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens, add_dict={"guidance": guidance}))
|
return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens, add_dict={"guidance": guidance}))
|
||||||
|
|
||||||
|
|
||||||
class FluxDisableGuidance(io.ComfyNodeV3):
|
class FluxDisableGuidance(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -71,7 +71,7 @@ class FluxDisableGuidance(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(c)
|
return io.NodeOutput(c)
|
||||||
|
|
||||||
|
|
||||||
class FluxGuidance(io.ComfyNodeV3):
|
class FluxGuidance(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -92,7 +92,7 @@ class FluxGuidance(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(c)
|
return io.NodeOutput(c)
|
||||||
|
|
||||||
|
|
||||||
class FluxKontextImageScale(io.ComfyNodeV3):
|
class FluxKontextImageScale(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -28,7 +28,7 @@ def Fourier_filter(x, threshold, scale):
|
|||||||
return x_filtered.to(x.dtype)
|
return x_filtered.to(x.dtype)
|
||||||
|
|
||||||
|
|
||||||
class FreeU(io.ComfyNodeV3):
|
class FreeU(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -73,7 +73,7 @@ class FreeU(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class FreeU_V2(io.ComfyNodeV3):
|
class FreeU_V2(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -56,7 +56,7 @@ def Fourier_filter(x, scale_low=1.0, scale_high=1.5, freq_cutoff=20):
|
|||||||
return x_filtered
|
return x_filtered
|
||||||
|
|
||||||
|
|
||||||
class FreSca(io.ComfyNodeV3):
|
class FreSca(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -336,7 +336,7 @@ NOISE_LEVELS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class GITSScheduler(io.ComfyNodeV3):
|
class GITSScheduler(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -6,7 +6,7 @@ import folder_paths
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodeHiDream(io.ComfyNodeV3):
|
class CLIPTextEncodeHiDream(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -33,7 +33,7 @@ class CLIPTextEncodeHiDream(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens))
|
return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens))
|
||||||
|
|
||||||
|
|
||||||
class QuadrupleCLIPLoader(io.ComfyNodeV3):
|
class QuadrupleCLIPLoader(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -13,7 +13,7 @@ from comfy_api.v3 import io, ui
|
|||||||
from server import PromptServer
|
from server import PromptServer
|
||||||
|
|
||||||
|
|
||||||
class GetImageSize(io.ComfyNodeV3):
|
class GetImageSize(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -46,7 +46,7 @@ class GetImageSize(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(width, height, batch_size)
|
return io.NodeOutput(width, height, batch_size)
|
||||||
|
|
||||||
|
|
||||||
class ImageAddNoise(io.ComfyNodeV3):
|
class ImageAddNoise(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -79,7 +79,7 @@ class ImageAddNoise(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(s)
|
return io.NodeOutput(s)
|
||||||
|
|
||||||
|
|
||||||
class ImageCrop(io.ComfyNodeV3):
|
class ImageCrop(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -105,7 +105,7 @@ class ImageCrop(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(image[:, y:to_y, x:to_x, :])
|
return io.NodeOutput(image[:, y:to_y, x:to_x, :])
|
||||||
|
|
||||||
|
|
||||||
class ImageFlip(io.ComfyNodeV3):
|
class ImageFlip(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -129,7 +129,7 @@ class ImageFlip(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(image)
|
return io.NodeOutput(image)
|
||||||
|
|
||||||
|
|
||||||
class ImageFromBatch(io.ComfyNodeV3):
|
class ImageFromBatch(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -153,7 +153,7 @@ class ImageFromBatch(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(s)
|
return io.NodeOutput(s)
|
||||||
|
|
||||||
|
|
||||||
class ImageRotate(io.ComfyNodeV3):
|
class ImageRotate(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -180,7 +180,7 @@ class ImageRotate(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.rot90(image, k=rotate_by, dims=[2, 1]))
|
return io.NodeOutput(torch.rot90(image, k=rotate_by, dims=[2, 1]))
|
||||||
|
|
||||||
|
|
||||||
class ImageStitch(io.ComfyNodeV3):
|
class ImageStitch(io.ComfyNode):
|
||||||
"""Upstreamed from https://github.com/kijai/ComfyUI-KJNodes"""
|
"""Upstreamed from https://github.com/kijai/ComfyUI-KJNodes"""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -350,7 +350,7 @@ class ImageStitch(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.cat(images, dim=concat_dim))
|
return io.NodeOutput(torch.cat(images, dim=concat_dim))
|
||||||
|
|
||||||
|
|
||||||
class LoadImage(io.ComfyNodeV3):
|
class LoadImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -438,7 +438,7 @@ class LoadImage(io.ComfyNodeV3):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class LoadImageOutput(io.ComfyNodeV3):
|
class LoadImageOutput(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -527,7 +527,7 @@ class LoadImageOutput(io.ComfyNodeV3):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class PreviewImage(io.ComfyNodeV3):
|
class PreviewImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -547,7 +547,7 @@ class PreviewImage(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(ui=ui.PreviewImage(images, cls=cls))
|
return io.NodeOutput(ui=ui.PreviewImage(images, cls=cls))
|
||||||
|
|
||||||
|
|
||||||
class RepeatImageBatch(io.ComfyNodeV3):
|
class RepeatImageBatch(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -566,7 +566,7 @@ class RepeatImageBatch(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(image.repeat((amount, 1, 1, 1)))
|
return io.NodeOutput(image.repeat((amount, 1, 1, 1)))
|
||||||
|
|
||||||
|
|
||||||
class ResizeAndPadImage(io.ComfyNodeV3):
|
class ResizeAndPadImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -611,7 +611,7 @@ class ResizeAndPadImage(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(padded.permute(0, 2, 3, 1))
|
return io.NodeOutput(padded.permute(0, 2, 3, 1))
|
||||||
|
|
||||||
|
|
||||||
class SaveAnimatedPNG(io.ComfyNodeV3):
|
class SaveAnimatedPNG(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -641,7 +641,7 @@ class SaveAnimatedPNG(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SaveAnimatedWEBP(io.ComfyNodeV3):
|
class SaveAnimatedWEBP(io.ComfyNode):
|
||||||
COMPRESS_METHODS = {"default": 4, "fastest": 0, "slowest": 6}
|
COMPRESS_METHODS = {"default": 4, "fastest": 0, "slowest": 6}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -677,7 +677,7 @@ class SaveAnimatedWEBP(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SaveImage(io.ComfyNodeV3):
|
class SaveImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -708,7 +708,7 @@ class SaveImage(io.ComfyNodeV3):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
GetImageSize,
|
GetImageSize,
|
||||||
ImageAddNoise,
|
ImageAddNoise,
|
||||||
ImageCrop,
|
ImageCrop,
|
||||||
|
@ -17,7 +17,7 @@ def reshape_latent_to(target_shape, latent, repeat_batch=True):
|
|||||||
return latent
|
return latent
|
||||||
|
|
||||||
|
|
||||||
class LatentAdd(io.ComfyNodeV3):
|
class LatentAdd(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -44,7 +44,7 @@ class LatentAdd(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class LatentApplyOperation(io.ComfyNodeV3):
|
class LatentApplyOperation(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -69,7 +69,7 @@ class LatentApplyOperation(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class LatentApplyOperationCFG(io.ComfyNodeV3):
|
class LatentApplyOperationCFG(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -101,7 +101,7 @@ class LatentApplyOperationCFG(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class LatentBatch(io.ComfyNodeV3):
|
class LatentBatch(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -130,7 +130,7 @@ class LatentBatch(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class LatentBatchSeedBehavior(io.ComfyNodeV3):
|
class LatentBatchSeedBehavior(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -159,7 +159,7 @@ class LatentBatchSeedBehavior(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class LatentInterpolate(io.ComfyNodeV3):
|
class LatentInterpolate(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -198,7 +198,7 @@ class LatentInterpolate(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class LatentMultiply(io.ComfyNodeV3):
|
class LatentMultiply(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -222,7 +222,7 @@ class LatentMultiply(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class LatentOperationSharpen(io.ComfyNodeV3):
|
class LatentOperationSharpen(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -264,7 +264,7 @@ class LatentOperationSharpen(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(sharpen)
|
return io.NodeOutput(sharpen)
|
||||||
|
|
||||||
|
|
||||||
class LatentOperationTonemapReinhard(io.ComfyNodeV3):
|
class LatentOperationTonemapReinhard(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -299,7 +299,7 @@ class LatentOperationTonemapReinhard(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(tonemap_reinhard)
|
return io.NodeOutput(tonemap_reinhard)
|
||||||
|
|
||||||
|
|
||||||
class LatentSubtract(io.ComfyNodeV3):
|
class LatentSubtract(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -86,7 +86,7 @@ def preprocess(image: torch.Tensor, crf=29):
|
|||||||
return torch.tensor(image_array, dtype=image.dtype, device=image.device) / 255.0
|
return torch.tensor(image_array, dtype=image.dtype, device=image.device) / 255.0
|
||||||
|
|
||||||
|
|
||||||
class EmptyLTXVLatentVideo(io.ComfyNodeV3):
|
class EmptyLTXVLatentVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -112,7 +112,7 @@ class EmptyLTXVLatentVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"samples": latent})
|
return io.NodeOutput({"samples": latent})
|
||||||
|
|
||||||
|
|
||||||
class LTXVAddGuide(io.ComfyNodeV3):
|
class LTXVAddGuide(io.ComfyNode):
|
||||||
NUM_PREFIX_FRAMES = 2
|
NUM_PREFIX_FRAMES = 2
|
||||||
PATCHIFIER = SymmetricPatchifier(1)
|
PATCHIFIER = SymmetricPatchifier(1)
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ class LTXVAddGuide(io.ComfyNodeV3):
|
|||||||
return latent_image, noise_mask
|
return latent_image, noise_mask
|
||||||
|
|
||||||
|
|
||||||
class LTXVConditioning(io.ComfyNodeV3):
|
class LTXVConditioning(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -299,7 +299,7 @@ class LTXVConditioning(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative)
|
return io.NodeOutput(positive, negative)
|
||||||
|
|
||||||
|
|
||||||
class LTXVCropGuides(io.ComfyNodeV3):
|
class LTXVCropGuides(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -335,7 +335,7 @@ class LTXVCropGuides(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative, {"samples": latent_image, "noise_mask": noise_mask})
|
return io.NodeOutput(positive, negative, {"samples": latent_image, "noise_mask": noise_mask})
|
||||||
|
|
||||||
|
|
||||||
class LTXVImgToVideo(io.ComfyNodeV3):
|
class LTXVImgToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -383,7 +383,7 @@ class LTXVImgToVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative, {"samples": latent, "noise_mask": conditioning_latent_frames_mask})
|
return io.NodeOutput(positive, negative, {"samples": latent, "noise_mask": conditioning_latent_frames_mask})
|
||||||
|
|
||||||
|
|
||||||
class LTXVPreprocess(io.ComfyNodeV3):
|
class LTXVPreprocess(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -408,7 +408,7 @@ class LTXVPreprocess(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.stack(output_images))
|
return io.NodeOutput(torch.stack(output_images))
|
||||||
|
|
||||||
|
|
||||||
class LTXVScheduler(io.ComfyNodeV3):
|
class LTXVScheduler(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -471,7 +471,7 @@ class LTXVScheduler(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(sigmas)
|
return io.NodeOutput(sigmas)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingLTXV(io.ComfyNodeV3):
|
class ModelSamplingLTXV(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -57,7 +57,7 @@ def composite(destination, source, x, y, mask=None, multiplier=8, resize_source=
|
|||||||
return destination
|
return destination
|
||||||
|
|
||||||
|
|
||||||
class CropMask(io.ComfyNodeV3):
|
class CropMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -80,7 +80,7 @@ class CropMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(mask[:, y : y + height, x : x + width])
|
return io.NodeOutput(mask[:, y : y + height, x : x + width])
|
||||||
|
|
||||||
|
|
||||||
class FeatherMask(io.ComfyNodeV3):
|
class FeatherMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -125,7 +125,7 @@ class FeatherMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(output)
|
return io.NodeOutput(output)
|
||||||
|
|
||||||
|
|
||||||
class GrowMask(io.ComfyNodeV3):
|
class GrowMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -158,7 +158,7 @@ class GrowMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.stack(out, dim=0))
|
return io.NodeOutput(torch.stack(out, dim=0))
|
||||||
|
|
||||||
|
|
||||||
class ImageColorToMask(io.ComfyNodeV3):
|
class ImageColorToMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -183,7 +183,7 @@ class ImageColorToMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.where(temp == color, 1.0, 0).float())
|
return io.NodeOutput(torch.where(temp == color, 1.0, 0).float())
|
||||||
|
|
||||||
|
|
||||||
class ImageCompositeMasked(io.ComfyNodeV3):
|
class ImageCompositeMasked(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -209,7 +209,7 @@ class ImageCompositeMasked(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(output)
|
return io.NodeOutput(output)
|
||||||
|
|
||||||
|
|
||||||
class ImageToMask(io.ComfyNodeV3):
|
class ImageToMask(io.ComfyNode):
|
||||||
CHANNELS = ["red", "green", "blue", "alpha"]
|
CHANNELS = ["red", "green", "blue", "alpha"]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -230,7 +230,7 @@ class ImageToMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(image[:, :, :, cls.CHANNELS.index(channel)])
|
return io.NodeOutput(image[:, :, :, cls.CHANNELS.index(channel)])
|
||||||
|
|
||||||
|
|
||||||
class InvertMask(io.ComfyNodeV3):
|
class InvertMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -248,7 +248,7 @@ class InvertMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(1.0 - mask)
|
return io.NodeOutput(1.0 - mask)
|
||||||
|
|
||||||
|
|
||||||
class LatentCompositeMasked(io.ComfyNodeV3):
|
class LatentCompositeMasked(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -275,7 +275,7 @@ class LatentCompositeMasked(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(output)
|
return io.NodeOutput(output)
|
||||||
|
|
||||||
|
|
||||||
class MaskComposite(io.ComfyNodeV3):
|
class MaskComposite(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -335,7 +335,7 @@ class MaskComposite(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.clamp(output, 0.0, 1.0))
|
return io.NodeOutput(torch.clamp(output, 0.0, 1.0))
|
||||||
|
|
||||||
|
|
||||||
class MaskPreview(io.ComfyNodeV3):
|
class MaskPreview(io.ComfyNode):
|
||||||
"""Mask Preview - original implement in ComfyUI_essentials.
|
"""Mask Preview - original implement in ComfyUI_essentials.
|
||||||
|
|
||||||
https://github.com/cubiq/ComfyUI_essentials/blob/9d9f4bedfc9f0321c19faf71855e228c93bd0dc9/mask.py#L81
|
https://github.com/cubiq/ComfyUI_essentials/blob/9d9f4bedfc9f0321c19faf71855e228c93bd0dc9/mask.py#L81
|
||||||
@ -360,7 +360,7 @@ class MaskPreview(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(ui=ui.PreviewMask(masks))
|
return io.NodeOutput(ui=ui.PreviewMask(masks))
|
||||||
|
|
||||||
|
|
||||||
class MaskToImage(io.ComfyNodeV3):
|
class MaskToImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -378,7 +378,7 @@ class MaskToImage(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3))
|
return io.NodeOutput(mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3))
|
||||||
|
|
||||||
|
|
||||||
class SolidMask(io.ComfyNodeV3):
|
class SolidMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -398,7 +398,7 @@ class SolidMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(torch.full((1, height, width), value, dtype=torch.float32, device="cpu"))
|
return io.NodeOutput(torch.full((1, height, width), value, dtype=torch.float32, device="cpu"))
|
||||||
|
|
||||||
|
|
||||||
class ThresholdMask(io.ComfyNodeV3):
|
class ThresholdMask(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -417,7 +417,7 @@ class ThresholdMask(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput((mask > value).float())
|
return io.NodeOutput((mask > value).float())
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
CropMask,
|
CropMask,
|
||||||
FeatherMask,
|
FeatherMask,
|
||||||
GrowMask,
|
GrowMask,
|
||||||
|
@ -7,7 +7,7 @@ import nodes
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class EmptyMochiLatentVideo(io.ComfyNodeV3):
|
class EmptyMochiLatentVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -57,7 +57,7 @@ class ModelSamplingDiscreteDistilled(comfy.model_sampling.ModelSamplingDiscrete)
|
|||||||
return log_sigma.exp().to(timestep.device)
|
return log_sigma.exp().to(timestep.device)
|
||||||
|
|
||||||
|
|
||||||
class ModelComputeDtype(io.ComfyNodeV3):
|
class ModelComputeDtype(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -79,7 +79,7 @@ class ModelComputeDtype(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingContinuousEDM(io.ComfyNodeV3):
|
class ModelSamplingContinuousEDM(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -131,7 +131,7 @@ class ModelSamplingContinuousEDM(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingContinuousV(io.ComfyNodeV3):
|
class ModelSamplingContinuousV(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -165,7 +165,7 @@ class ModelSamplingContinuousV(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingDiscrete(io.ComfyNodeV3):
|
class ModelSamplingDiscrete(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -207,7 +207,7 @@ class ModelSamplingDiscrete(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingFlux(io.ComfyNodeV3):
|
class ModelSamplingFlux(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -247,7 +247,7 @@ class ModelSamplingFlux(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingSD3(io.ComfyNodeV3):
|
class ModelSamplingSD3(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -298,7 +298,7 @@ class ModelSamplingAuraFlow(ModelSamplingSD3):
|
|||||||
return super().execute(model, shift, multiplier)
|
return super().execute(model, shift, multiplier)
|
||||||
|
|
||||||
|
|
||||||
class ModelSamplingStableCascade(io.ComfyNodeV3):
|
class ModelSamplingStableCascade(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -329,7 +329,7 @@ class ModelSamplingStableCascade(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class RescaleCFG(io.ComfyNodeV3):
|
class RescaleCFG(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -4,7 +4,7 @@ import comfy.utils
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class PatchModelAddDownscale(io.ComfyNodeV3):
|
class PatchModelAddDownscale(io.ComfyNode):
|
||||||
UPSCALE_METHODS = ["bicubic", "nearest-exact", "bilinear", "area", "bislerp"]
|
UPSCALE_METHODS = ["bicubic", "nearest-exact", "bilinear", "area", "bislerp"]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -16,7 +16,7 @@ import comfy.model_management
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class ImageRGBToYUV(io.ComfyNodeV3):
|
class ImageRGBToYUV(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -38,7 +38,7 @@ class ImageRGBToYUV(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(out[..., 0:1].expand_as(image), out[..., 1:2].expand_as(image), out[..., 2:3].expand_as(image))
|
return io.NodeOutput(out[..., 0:1].expand_as(image), out[..., 1:2].expand_as(image), out[..., 2:3].expand_as(image))
|
||||||
|
|
||||||
|
|
||||||
class ImageYUVToRGB(io.ComfyNodeV3):
|
class ImageYUVToRGB(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -60,7 +60,7 @@ class ImageYUVToRGB(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(kornia.color.ycbcr_to_rgb(image.movedim(-1, 1)).movedim(1, -1))
|
return io.NodeOutput(kornia.color.ycbcr_to_rgb(image.movedim(-1, 1)).movedim(1, -1))
|
||||||
|
|
||||||
|
|
||||||
class Morphology(io.ComfyNodeV3):
|
class Morphology(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -26,7 +26,7 @@ NOISE_LEVELS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class OptimalStepsScheduler(io.ComfyNodeV3):
|
class OptimalStepsScheduler(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -10,7 +10,7 @@ from comfy_api.v3 import io
|
|||||||
#My modified one here is more basic but has fewer chances of breaking with ComfyUI updates.
|
#My modified one here is more basic but has fewer chances of breaking with ComfyUI updates.
|
||||||
|
|
||||||
|
|
||||||
class PerturbedAttentionGuidance(io.ComfyNodeV3):
|
class PerturbedAttentionGuidance(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -81,7 +81,7 @@ class Guider_PerpNeg(comfy.samplers.CFGGuider):
|
|||||||
return cfg_result
|
return cfg_result
|
||||||
|
|
||||||
|
|
||||||
class PerpNegGuider(io.ComfyNodeV3):
|
class PerpNegGuider(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -121,7 +121,7 @@ class PhotoMakerIDEncoder(comfy.clip_model.CLIPVisionModelProjection):
|
|||||||
return self.fuse_module(prompt_embeds, id_embeds, class_tokens_mask)
|
return self.fuse_module(prompt_embeds, id_embeds, class_tokens_mask)
|
||||||
|
|
||||||
|
|
||||||
class PhotoMakerEncode(io.ComfyNodeV3):
|
class PhotoMakerEncode(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -173,7 +173,7 @@ class PhotoMakerEncode(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput([[out, {"pooled_output": pooled}]])
|
return io.NodeOutput([[out, {"pooled_output": pooled}]])
|
||||||
|
|
||||||
|
|
||||||
class PhotoMakerLoader(io.ComfyNodeV3):
|
class PhotoMakerLoader(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -4,7 +4,7 @@ import nodes
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodePixArtAlpha(io.ComfyNodeV3):
|
class CLIPTextEncodePixArtAlpha(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -20,7 +20,7 @@ def gaussian_kernel(kernel_size: int, sigma: float, device=None):
|
|||||||
return g / g.sum()
|
return g / g.sum()
|
||||||
|
|
||||||
|
|
||||||
class Blend(io.ComfyNodeV3):
|
class Blend(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -74,7 +74,7 @@ class Blend(io.ComfyNodeV3):
|
|||||||
return torch.where(x <= 0.25, ((16 * x - 12) * x + 4) * x, torch.sqrt(x))
|
return torch.where(x <= 0.25, ((16 * x - 12) * x + 4) * x, torch.sqrt(x))
|
||||||
|
|
||||||
|
|
||||||
class Blur(io.ComfyNodeV3):
|
class Blur(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -109,7 +109,7 @@ class Blur(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(blurred.to(comfy.model_management.intermediate_device()))
|
return io.NodeOutput(blurred.to(comfy.model_management.intermediate_device()))
|
||||||
|
|
||||||
|
|
||||||
class ImageScaleToTotalPixels(io.ComfyNodeV3):
|
class ImageScaleToTotalPixels(io.ComfyNode):
|
||||||
upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
|
upscale_methods = ["nearest-exact", "bilinear", "area", "bicubic", "lanczos"]
|
||||||
crop_methods = ["disabled", "center"]
|
crop_methods = ["disabled", "center"]
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ class ImageScaleToTotalPixels(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(s.movedim(1,-1))
|
return io.NodeOutput(s.movedim(1,-1))
|
||||||
|
|
||||||
|
|
||||||
class Quantize(io.ComfyNodeV3):
|
class Quantize(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -205,7 +205,7 @@ class Quantize(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(result)
|
return io.NodeOutput(result)
|
||||||
|
|
||||||
|
|
||||||
class Sharpen(io.ComfyNodeV3):
|
class Sharpen(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -5,7 +5,7 @@ import json
|
|||||||
from comfy_api.v3 import io, ui
|
from comfy_api.v3 import io, ui
|
||||||
|
|
||||||
|
|
||||||
class PreviewAny(io.ComfyNodeV3):
|
class PreviewAny(io.ComfyNode):
|
||||||
"""Originally implement from https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
|
"""Originally implement from https://github.com/rgthree/rgthree-comfy/blob/main/py/display_any.py
|
||||||
|
|
||||||
upstream requested in https://github.com/Kosinkadink/rfcs/blob/main/rfcs/0000-corenodes.md#preview-nodes"""
|
upstream requested in https://github.com/Kosinkadink/rfcs/blob/main/rfcs/0000-corenodes.md#preview-nodes"""
|
||||||
@ -42,6 +42,6 @@ class PreviewAny(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(ui=ui.PreviewText(value))
|
return io.NodeOutput(ui=ui.PreviewText(value))
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
PreviewAny,
|
PreviewAny,
|
||||||
]
|
]
|
||||||
|
@ -5,7 +5,7 @@ import sys
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class String(io.ComfyNodeV3):
|
class String(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -23,7 +23,7 @@ class String(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(value)
|
return io.NodeOutput(value)
|
||||||
|
|
||||||
|
|
||||||
class StringMultiline(io.ComfyNodeV3):
|
class StringMultiline(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -41,7 +41,7 @@ class StringMultiline(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(value)
|
return io.NodeOutput(value)
|
||||||
|
|
||||||
|
|
||||||
class Int(io.ComfyNodeV3):
|
class Int(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -59,7 +59,7 @@ class Int(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(value)
|
return io.NodeOutput(value)
|
||||||
|
|
||||||
|
|
||||||
class Float(io.ComfyNodeV3):
|
class Float(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -77,7 +77,7 @@ class Float(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(value)
|
return io.NodeOutput(value)
|
||||||
|
|
||||||
|
|
||||||
class Boolean(io.ComfyNodeV3):
|
class Boolean(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -95,7 +95,7 @@ class Boolean(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(value)
|
return io.NodeOutput(value)
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
String,
|
String,
|
||||||
StringMultiline,
|
StringMultiline,
|
||||||
Int,
|
Int,
|
||||||
|
@ -5,7 +5,7 @@ import torch
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class ImageRebatch(io.ComfyNodeV3):
|
class ImageRebatch(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -38,7 +38,7 @@ class ImageRebatch(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(output_list)
|
return io.NodeOutput(output_list)
|
||||||
|
|
||||||
|
|
||||||
class LatentRebatch(io.ComfyNodeV3):
|
class LatentRebatch(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -111,7 +111,7 @@ def gaussian_blur_2d(img, kernel_size, sigma):
|
|||||||
return F.conv2d(img, kernel2d, groups=img.shape[-3])
|
return F.conv2d(img, kernel2d, groups=img.shape[-3])
|
||||||
|
|
||||||
|
|
||||||
class SelfAttentionGuidance(io.ComfyNodeV3):
|
class SelfAttentionGuidance(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -10,7 +10,7 @@ from comfy_api.v3 import io
|
|||||||
from comfy_extras.v3.nodes_slg import SkipLayerGuidanceDiT
|
from comfy_extras.v3.nodes_slg import SkipLayerGuidanceDiT
|
||||||
|
|
||||||
|
|
||||||
class CLIPTextEncodeSD3(io.ComfyNodeV3):
|
class CLIPTextEncodeSD3(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -54,7 +54,7 @@ class CLIPTextEncodeSD3(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens))
|
return io.NodeOutput(clip.encode_from_tokens_scheduled(tokens))
|
||||||
|
|
||||||
|
|
||||||
class EmptySD3LatentImage(io.ComfyNodeV3):
|
class EmptySD3LatentImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -109,7 +109,7 @@ class SkipLayerGuidanceSD3(SkipLayerGuidanceDiT):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class TripleCLIPLoader(io.ComfyNodeV3):
|
class TripleCLIPLoader(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -6,7 +6,7 @@ import comfy.utils
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class SD_4XUpscale_Conditioning(io.ComfyNodeV3):
|
class SD_4XUpscale_Conditioning(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -7,7 +7,7 @@ import comfy.samplers
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class SkipLayerGuidanceDiT(io.ComfyNodeV3):
|
class SkipLayerGuidanceDiT(io.ComfyNode):
|
||||||
"""
|
"""
|
||||||
Enhance guidance towards detailed dtructure by having another set of CFG negative with skipped layers.
|
Enhance guidance towards detailed dtructure by having another set of CFG negative with skipped layers.
|
||||||
Inspired by Perturbed Attention Guidance (https://arxiv.org/abs/2403.17377)
|
Inspired by Perturbed Attention Guidance (https://arxiv.org/abs/2403.17377)
|
||||||
@ -92,7 +92,7 @@ class SkipLayerGuidanceDiT(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(m)
|
return io.NodeOutput(m)
|
||||||
|
|
||||||
|
|
||||||
class SkipLayerGuidanceDiTSimple(io.ComfyNodeV3):
|
class SkipLayerGuidanceDiTSimple(io.ComfyNode):
|
||||||
"""Simple version of the SkipLayerGuidanceDiT node that only modifies the uncond pass."""
|
"""Simple version of the SkipLayerGuidanceDiT node that only modifies the uncond pass."""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -23,7 +23,7 @@ import nodes
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class StableCascade_EmptyLatentImage(io.ComfyNodeV3):
|
class StableCascade_EmptyLatentImage(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -48,7 +48,7 @@ class StableCascade_EmptyLatentImage(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"samples": c_latent}, {"samples": b_latent})
|
return io.NodeOutput({"samples": c_latent}, {"samples": b_latent})
|
||||||
|
|
||||||
|
|
||||||
class StableCascade_StageC_VAEEncode(io.ComfyNodeV3):
|
class StableCascade_StageC_VAEEncode(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -79,7 +79,7 @@ class StableCascade_StageC_VAEEncode(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput({"samples": c_latent}, {"samples": b_latent})
|
return io.NodeOutput({"samples": c_latent}, {"samples": b_latent})
|
||||||
|
|
||||||
|
|
||||||
class StableCascade_StageB_Conditioning(io.ComfyNodeV3):
|
class StableCascade_StageB_Conditioning(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -105,7 +105,7 @@ class StableCascade_StageB_Conditioning(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(c)
|
return io.NodeOutput(c)
|
||||||
|
|
||||||
|
|
||||||
class StableCascade_SuperResolutionControlnet(io.ComfyNodeV3):
|
class StableCascade_SuperResolutionControlnet(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -135,7 +135,7 @@ class StableCascade_SuperResolutionControlnet(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(controlnet_input, {"samples": c_latent}, {"samples": b_latent})
|
return io.NodeOutput(controlnet_input, {"samples": c_latent}, {"samples": b_latent})
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [
|
NODES_LIST: list[type[io.ComfyNode]] = [
|
||||||
StableCascade_EmptyLatentImage,
|
StableCascade_EmptyLatentImage,
|
||||||
StableCascade_StageB_Conditioning,
|
StableCascade_StageB_Conditioning,
|
||||||
StableCascade_StageC_VAEEncode,
|
StableCascade_StageC_VAEEncode,
|
||||||
|
@ -15,7 +15,7 @@ from comfy_api.util import VideoCodec, VideoComponents, VideoContainer
|
|||||||
from comfy_api.v3 import io, ui
|
from comfy_api.v3 import io, ui
|
||||||
|
|
||||||
|
|
||||||
class CreateVideo(io.ComfyNodeV3):
|
class CreateVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -44,7 +44,7 @@ class CreateVideo(io.ComfyNodeV3):
|
|||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
class GetVideoComponents(io.ComfyNodeV3):
|
class GetVideoComponents(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -68,7 +68,7 @@ class GetVideoComponents(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(components.images, components.audio, float(components.frame_rate))
|
return io.NodeOutput(components.images, components.audio, float(components.frame_rate))
|
||||||
|
|
||||||
|
|
||||||
class LoadVideo(io.ComfyNodeV3):
|
class LoadVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
input_dir = folder_paths.get_input_directory()
|
input_dir = folder_paths.get_input_directory()
|
||||||
@ -105,7 +105,7 @@ class LoadVideo(io.ComfyNodeV3):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class SaveVideo(io.ComfyNodeV3):
|
class SaveVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -152,7 +152,7 @@ class SaveVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(ui=ui.PreviewVideo([ui.SavedResult(file, subfolder, io.FolderType.output)]))
|
return io.NodeOutput(ui=ui.PreviewVideo([ui.SavedResult(file, subfolder, io.FolderType.output)]))
|
||||||
|
|
||||||
|
|
||||||
class SaveWEBM(io.ComfyNodeV3):
|
class SaveWEBM(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -11,7 +11,7 @@ import nodes
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class TrimVideoLatent(io.ComfyNodeV3):
|
class TrimVideoLatent(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -36,7 +36,7 @@ class TrimVideoLatent(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(samples_out)
|
return io.NodeOutput(samples_out)
|
||||||
|
|
||||||
|
|
||||||
class WanCameraImageToVideo(io.ComfyNodeV3):
|
class WanCameraImageToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -88,7 +88,7 @@ class WanCameraImageToVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative, out_latent)
|
return io.NodeOutput(positive, negative, out_latent)
|
||||||
|
|
||||||
|
|
||||||
class WanFirstLastFrameToVideo(io.ComfyNodeV3):
|
class WanFirstLastFrameToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -159,7 +159,7 @@ class WanFirstLastFrameToVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative, out_latent)
|
return io.NodeOutput(positive, negative, out_latent)
|
||||||
|
|
||||||
|
|
||||||
class WanFunControlToVideo(io.ComfyNodeV3):
|
class WanFunControlToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -213,7 +213,7 @@ class WanFunControlToVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative, out_latent)
|
return io.NodeOutput(positive, negative, out_latent)
|
||||||
|
|
||||||
|
|
||||||
class WanFunInpaintToVideo(io.ComfyNodeV3):
|
class WanFunInpaintToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -244,7 +244,7 @@ class WanFunInpaintToVideo(io.ComfyNodeV3):
|
|||||||
return flfv.execute(positive, negative, vae, width, height, length, batch_size, start_image=start_image, end_image=end_image, clip_vision_start_image=clip_vision_output)
|
return flfv.execute(positive, negative, vae, width, height, length, batch_size, start_image=start_image, end_image=end_image, clip_vision_start_image=clip_vision_output)
|
||||||
|
|
||||||
|
|
||||||
class WanImageToVideo(io.ComfyNodeV3):
|
class WanImageToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -292,7 +292,7 @@ class WanImageToVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, negative, out_latent)
|
return io.NodeOutput(positive, negative, out_latent)
|
||||||
|
|
||||||
|
|
||||||
class WanPhantomSubjectToVideo(io.ComfyNodeV3):
|
class WanPhantomSubjectToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -336,7 +336,7 @@ class WanPhantomSubjectToVideo(io.ComfyNodeV3):
|
|||||||
return io.NodeOutput(positive, cond2, negative, out_latent)
|
return io.NodeOutput(positive, cond2, negative, out_latent)
|
||||||
|
|
||||||
|
|
||||||
class WanVaceToVideo(io.ComfyNodeV3):
|
class WanVaceToVideo(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
|
@ -10,7 +10,7 @@ import nodes
|
|||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
class WebcamCapture(io.ComfyNodeV3):
|
class WebcamCapture(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return io.Schema(
|
return io.Schema(
|
||||||
@ -89,4 +89,4 @@ class WebcamCapture(io.ComfyNodeV3):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
NODES_LIST: list[type[io.ComfyNodeV3]] = [WebcamCapture]
|
NODES_LIST: list[type[io.ComfyNode]] = [WebcamCapture]
|
||||||
|
12
execution.py
12
execution.py
@ -32,7 +32,7 @@ from comfy_execution.graph_utils import GraphBuilder, is_link
|
|||||||
from comfy_execution.validation import validate_node_input
|
from comfy_execution.validation import validate_node_input
|
||||||
from comfy_execution.progress import get_progress_state, reset_progress_state, add_progress_handler, WebUIProgressHandler
|
from comfy_execution.progress import get_progress_state, reset_progress_state, add_progress_handler, WebUIProgressHandler
|
||||||
from comfy_execution.utils import CurrentNodeContext
|
from comfy_execution.utils import CurrentNodeContext
|
||||||
from comfy_api.internal import ComfyNodeInternal, first_real_override, is_class, make_locked_method_func
|
from comfy_api.internal import _ComfyNodeInternal, first_real_override, is_class, make_locked_method_func
|
||||||
from comfy_api.v3 import io
|
from comfy_api.v3 import io
|
||||||
|
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class IsChangedCache:
|
|||||||
class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
|
class_def = nodes.NODE_CLASS_MAPPINGS[class_type]
|
||||||
has_is_changed = False
|
has_is_changed = False
|
||||||
is_changed_name = None
|
is_changed_name = None
|
||||||
if issubclass(class_def, ComfyNodeInternal) and first_real_override(class_def, "fingerprint_inputs") is not None:
|
if issubclass(class_def, _ComfyNodeInternal) and first_real_override(class_def, "fingerprint_inputs") is not None:
|
||||||
has_is_changed = True
|
has_is_changed = True
|
||||||
is_changed_name = "fingerprint_inputs"
|
is_changed_name = "fingerprint_inputs"
|
||||||
elif hasattr(class_def, "IS_CHANGED"):
|
elif hasattr(class_def, "IS_CHANGED"):
|
||||||
@ -136,7 +136,7 @@ class CacheSet:
|
|||||||
SENSITIVE_EXTRA_DATA_KEYS = ("auth_token_comfy_org", "api_key_comfy_org")
|
SENSITIVE_EXTRA_DATA_KEYS = ("auth_token_comfy_org", "api_key_comfy_org")
|
||||||
|
|
||||||
def get_input_data(inputs, class_def, unique_id, outputs=None, dynprompt=None, extra_data={}):
|
def get_input_data(inputs, class_def, unique_id, outputs=None, dynprompt=None, extra_data={}):
|
||||||
is_v3 = issubclass(class_def, ComfyNodeInternal)
|
is_v3 = issubclass(class_def, _ComfyNodeInternal)
|
||||||
if is_v3:
|
if is_v3:
|
||||||
valid_inputs, schema = class_def.INPUT_TYPES(include_hidden=False, return_schema=True)
|
valid_inputs, schema = class_def.INPUT_TYPES(include_hidden=False, return_schema=True)
|
||||||
else:
|
else:
|
||||||
@ -245,7 +245,7 @@ async def _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, f
|
|||||||
if pre_execute_cb is not None and index is not None:
|
if pre_execute_cb is not None and index is not None:
|
||||||
pre_execute_cb(index)
|
pre_execute_cb(index)
|
||||||
# V3
|
# V3
|
||||||
if isinstance(obj, ComfyNodeInternal) or (is_class(obj) and issubclass(obj, ComfyNodeInternal)):
|
if isinstance(obj, _ComfyNodeInternal) or (is_class(obj) and issubclass(obj, _ComfyNodeInternal)):
|
||||||
# if is just a class, then assign no resources or state, just create clone
|
# if is just a class, then assign no resources or state, just create clone
|
||||||
if is_class(obj):
|
if is_class(obj):
|
||||||
type_obj = obj
|
type_obj = obj
|
||||||
@ -476,7 +476,7 @@ async def execute(server, dynprompt, caches, current_item, extra_data, executed,
|
|||||||
obj = class_def()
|
obj = class_def()
|
||||||
caches.objects.set(unique_id, obj)
|
caches.objects.set(unique_id, obj)
|
||||||
|
|
||||||
if issubclass(class_def, ComfyNodeInternal):
|
if issubclass(class_def, _ComfyNodeInternal):
|
||||||
lazy_status_present = first_real_override(class_def, "check_lazy_status") is not None
|
lazy_status_present = first_real_override(class_def, "check_lazy_status") is not None
|
||||||
else:
|
else:
|
||||||
lazy_status_present = getattr(obj, "check_lazy_status", None) is not None
|
lazy_status_present = getattr(obj, "check_lazy_status", None) is not None
|
||||||
@ -761,7 +761,7 @@ async def validate_inputs(prompt_id, prompt, item, validated):
|
|||||||
|
|
||||||
validate_function_inputs = []
|
validate_function_inputs = []
|
||||||
validate_has_kwargs = False
|
validate_has_kwargs = False
|
||||||
if issubclass(obj_class, ComfyNodeInternal):
|
if issubclass(obj_class, _ComfyNodeInternal):
|
||||||
validate_function_name = "validate_inputs"
|
validate_function_name = "validate_inputs"
|
||||||
validate_function = first_real_override(obj_class, validate_function_name)
|
validate_function = first_real_override(obj_class, validate_function_name)
|
||||||
else:
|
else:
|
||||||
|
2
nodes.py
2
nodes.py
@ -2162,7 +2162,7 @@ def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes
|
|||||||
# V3 node definition
|
# V3 node definition
|
||||||
elif getattr(module, "NODES_LIST", None) is not None:
|
elif getattr(module, "NODES_LIST", None) is not None:
|
||||||
for node_cls in module.NODES_LIST:
|
for node_cls in module.NODES_LIST:
|
||||||
node_cls: io.ComfyNodeV3
|
node_cls: io.ComfyNode
|
||||||
schema = node_cls.GET_SCHEMA()
|
schema = node_cls.GET_SCHEMA()
|
||||||
if schema.node_id not in ignore:
|
if schema.node_id not in ignore:
|
||||||
NODE_CLASS_MAPPINGS[schema.node_id] = node_cls
|
NODE_CLASS_MAPPINGS[schema.node_id] = node_cls
|
||||||
|
@ -30,7 +30,7 @@ from comfy_api import feature_flags
|
|||||||
import node_helpers
|
import node_helpers
|
||||||
from comfyui_version import __version__
|
from comfyui_version import __version__
|
||||||
from app.frontend_management import FrontendManager
|
from app.frontend_management import FrontendManager
|
||||||
from comfy_api.internal import ComfyNodeInternal
|
from comfy_api.internal import _ComfyNodeInternal
|
||||||
|
|
||||||
from app.user_manager import UserManager
|
from app.user_manager import UserManager
|
||||||
from app.model_manager import ModelFileManager
|
from app.model_manager import ModelFileManager
|
||||||
@ -590,7 +590,7 @@ class PromptServer():
|
|||||||
|
|
||||||
def node_info(node_class):
|
def node_info(node_class):
|
||||||
obj_class = nodes.NODE_CLASS_MAPPINGS[node_class]
|
obj_class = nodes.NODE_CLASS_MAPPINGS[node_class]
|
||||||
if issubclass(obj_class, ComfyNodeInternal):
|
if issubclass(obj_class, _ComfyNodeInternal):
|
||||||
return obj_class.GET_NODE_INFO_V1()
|
return obj_class.GET_NODE_INFO_V1()
|
||||||
info = {}
|
info = {}
|
||||||
info['input'] = obj_class.INPUT_TYPES()
|
info['input'] = obj_class.INPUT_TYPES()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user