mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-27 14:50:20 +08:00
Fix absolute imports, fix linting issue with dataclass
This commit is contained in:
parent
ffc6a7fd38
commit
1e74a4cf08
@ -191,10 +191,6 @@ class ExportedNodes:
|
|||||||
|
|
||||||
|
|
||||||
class _ExportedNodesAsChainMap(ExportedNodes):
|
class _ExportedNodesAsChainMap(ExportedNodes):
|
||||||
NODE_CLASS_MAPPINGS: ChainMap[str, CustomNode] = field(default_factory=ChainMap)
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS: ChainMap[str, str] = field(default_factory=ChainMap)
|
|
||||||
EXTENSION_WEB_DIRS: ChainMap[str, str] = field(default_factory=ChainMap)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_iter(cls, *exported_nodes: ExportedNodes):
|
def from_iter(cls, *exported_nodes: ExportedNodes):
|
||||||
en = _ExportedNodesAsChainMap()
|
en = _ExportedNodesAsChainMap()
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
# todo: this should be defined in a common place, the fact that the nodes are imported by execution the way that they are is pretty radioactive
|
# todo: this should be defined in a common place, the fact that the nodes are imported by execution the way that they are is pretty radioactive
|
||||||
import lazy_object_proxy
|
import lazy_object_proxy
|
||||||
|
|
||||||
from comfy.execution_context import current_execution_context
|
from .execution_context import current_execution_context
|
||||||
from comfy.nodes.package import import_all_nodes_in_workspace
|
from .nodes.package import import_all_nodes_in_workspace
|
||||||
from comfy.nodes.package_typing import ExportedNodes, exported_nodes_view
|
from .nodes.package_typing import ExportedNodes, exported_nodes_view
|
||||||
|
|
||||||
nodes: ExportedNodes = lazy_object_proxy.Proxy(import_all_nodes_in_workspace)
|
nodes: ExportedNodes = lazy_object_proxy.Proxy(import_all_nodes_in_workspace)
|
||||||
|
|
||||||
|
|||||||
@ -513,6 +513,40 @@ class IntToFloat(CustomNode):
|
|||||||
return float(value),
|
return float(value),
|
||||||
|
|
||||||
|
|
||||||
|
class IntToString(CustomNode):
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls) -> InputTypes:
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"value": ("INT", {}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CATEGORY = "arithmetic"
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def execute(self, value: int = 0):
|
||||||
|
return str(value),
|
||||||
|
|
||||||
|
|
||||||
|
class FloatToString(CustomNode):
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls) -> InputTypes:
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"value": ("FLOAT", {}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CATEGORY = "arithmetic"
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def execute(self, value: float = 0):
|
||||||
|
return str(value),
|
||||||
|
|
||||||
|
|
||||||
class FloatToInt(CustomNode):
|
class FloatToInt(CustomNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls) -> InputTypes:
|
def INPUT_TYPES(cls) -> InputTypes:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user