mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-16 08:33:29 +00:00
Compare commits
6 Commits
a58ef65212
...
106c6c45bb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
106c6c45bb | ||
![]() |
98bdca4cb2 | ||
![]() |
a26da20a76 | ||
![]() |
d175cbd315 | ||
![]() |
8e5f33cc9c | ||
![]() |
c7b8e7250d |
@ -102,9 +102,13 @@ class InputTypeOptions(TypedDict):
|
|||||||
default: bool | str | float | int | list | tuple
|
default: bool | str | float | int | list | tuple
|
||||||
"""The default value of the widget"""
|
"""The default value of the widget"""
|
||||||
defaultInput: bool
|
defaultInput: bool
|
||||||
"""Defaults to an input slot rather than a widget"""
|
"""@deprecated in v1.16 frontend. v1.16 frontend allows input socket and widget to co-exist.
|
||||||
|
- defaultInput on required inputs should be dropped.
|
||||||
|
- defaultInput on optional inputs should be replaced with forceInput.
|
||||||
|
Ref: https://github.com/Comfy-Org/ComfyUI_frontend/pull/3364
|
||||||
|
"""
|
||||||
forceInput: bool
|
forceInput: bool
|
||||||
"""`defaultInput` and also don't allow converting to a widget"""
|
"""Forces the input to be an input slot rather than a widget even a widget is available for the input type."""
|
||||||
lazy: bool
|
lazy: bool
|
||||||
"""Declares that this input uses lazy evaluation"""
|
"""Declares that this input uses lazy evaluation"""
|
||||||
rawLink: bool
|
rawLink: bool
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import torch
|
import torch
|
||||||
import math
|
import math
|
||||||
import comfy.utils
|
import comfy.utils
|
||||||
|
from comfy.model_management import device_should_use_non_blocking
|
||||||
|
|
||||||
|
|
||||||
class CONDRegular:
|
class CONDRegular:
|
||||||
@ -10,7 +11,16 @@ class CONDRegular:
|
|||||||
def _copy_with(self, cond):
|
def _copy_with(self, cond):
|
||||||
return self.__class__(cond)
|
return self.__class__(cond)
|
||||||
|
|
||||||
|
def _pin_memory(self, cond):
|
||||||
|
if cond.device == torch.device('cpu'):
|
||||||
|
return cond.pin_memory()
|
||||||
|
else:
|
||||||
|
return cond
|
||||||
|
|
||||||
def process_cond(self, batch_size, device, **kwargs):
|
def process_cond(self, batch_size, device, **kwargs):
|
||||||
|
if device_should_use_non_blocking(device):
|
||||||
|
return self._copy_with(comfy.utils.repeat_to_batch_size(self._pin_memory(self.cond), batch_size).to(device, non_blocking=True))
|
||||||
|
else:
|
||||||
return self._copy_with(comfy.utils.repeat_to_batch_size(self.cond, batch_size).to(device))
|
return self._copy_with(comfy.utils.repeat_to_batch_size(self.cond, batch_size).to(device))
|
||||||
|
|
||||||
def can_concat(self, other):
|
def can_concat(self, other):
|
||||||
|
2
nodes.py
2
nodes.py
@ -2136,7 +2136,7 @@ def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes
|
|||||||
module_name = sp[0]
|
module_name = sp[0]
|
||||||
sys_module_name = module_name
|
sys_module_name = module_name
|
||||||
elif os.path.isdir(module_path):
|
elif os.path.isdir(module_path):
|
||||||
sys_module_name = module_path
|
sys_module_name = module_path.replace(".", "_x_")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logging.debug("Trying to load custom node {}".format(module_path))
|
logging.debug("Trying to load custom node {}".format(module_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user