mirror of
https://github.com/Comfy-Org/ComfyUI.git
synced 2026-08-25 18:32:35 +08:00
test(isolation): process boundary coverage and workflows
This commit is contained in:
6
tests/isolation/internal_probe_node/__init__.py
Normal file
6
tests/isolation/internal_probe_node/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from .probe_nodes import (
|
||||
NODE_CLASS_MAPPINGS as NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|
||||
75
tests/isolation/internal_probe_node/probe_nodes.py
Normal file
75
tests/isolation/internal_probe_node/probe_nodes.py
Normal file
@@ -0,0 +1,75 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
class InternalIsolationProbeImage:
|
||||
CATEGORY = "tests/isolation"
|
||||
RETURN_TYPES = ()
|
||||
FUNCTION = "run"
|
||||
OUTPUT_NODE = True
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {"required": {}}
|
||||
|
||||
def run(self):
|
||||
from comfy_api.latest import UI
|
||||
import torch
|
||||
|
||||
image = torch.zeros((1, 2, 2, 3), dtype=torch.float32)
|
||||
image[:, :, :, 0] = 1.0
|
||||
ui = UI.PreviewImage(image)
|
||||
return {"ui": ui.as_dict(), "result": ()}
|
||||
|
||||
|
||||
class InternalIsolationProbeAudio:
|
||||
CATEGORY = "tests/isolation"
|
||||
RETURN_TYPES = ()
|
||||
FUNCTION = "run"
|
||||
OUTPUT_NODE = True
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {"required": {}}
|
||||
|
||||
def run(self):
|
||||
from comfy_api.latest import UI
|
||||
import torch
|
||||
|
||||
waveform = torch.zeros((1, 1, 32), dtype=torch.float32)
|
||||
audio = {"waveform": waveform, "sample_rate": 44100}
|
||||
ui = UI.PreviewAudio(audio)
|
||||
return {"ui": ui.as_dict(), "result": ()}
|
||||
|
||||
|
||||
class InternalIsolationProbeUI3D:
|
||||
CATEGORY = "tests/isolation"
|
||||
RETURN_TYPES = ()
|
||||
FUNCTION = "run"
|
||||
OUTPUT_NODE = True
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {"required": {}}
|
||||
|
||||
def run(self):
|
||||
from comfy_api.latest import UI
|
||||
import torch
|
||||
|
||||
bg_image = torch.zeros((1, 2, 2, 3), dtype=torch.float32)
|
||||
bg_image[:, :, :, 1] = 1.0
|
||||
camera_info = {"distance": 1.0}
|
||||
ui = UI.PreviewUI3D("internal_probe_preview.obj", camera_info, bg_image=bg_image)
|
||||
return {"ui": ui.as_dict(), "result": ()}
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"InternalIsolationProbeImage": InternalIsolationProbeImage,
|
||||
"InternalIsolationProbeAudio": InternalIsolationProbeAudio,
|
||||
"InternalIsolationProbeUI3D": InternalIsolationProbeUI3D,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"InternalIsolationProbeImage": "Internal Isolation Probe Image",
|
||||
"InternalIsolationProbeAudio": "Internal Isolation Probe Audio",
|
||||
"InternalIsolationProbeUI3D": "Internal Isolation Probe UI3D",
|
||||
}
|
||||
Reference in New Issue
Block a user