Closed AgeOfAlgorithms closed 6 months ago
I got the segformer working by git cloning the repo into custom_nodes folder and then pip installing the requirements. The other two packages still have the same problem:
Traceback (most recent call last):
File "/home/sean/ComfyUI/nodes.py", line 1888, in load_custom_node
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/sean/ComfyUI/custom_nodes/antrobots-comfyUI-nodepack/__init__.py", line 1, in <module>
from .utils.globals import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "/home/sean/ComfyUI/custom_nodes/antrobots-comfyUI-nodepack/utils/globals.py", line 19, in <module>
from ..sampling_nodes import NODE_CLASS_MAPPINGS as sampling_nodes
File "/home/sean/ComfyUI/custom_nodes/antrobots-comfyUI-nodepack/sampling_nodes.py", line 31, in <module>
class KSamplerWithRefiner(KSampler):
File "/home/sean/ComfyUI/custom_nodes/antrobots-comfyUI-nodepack/sampling_nodes.py", line 61, in KSamplerWithRefiner
def sample(self, base_model, refiner_model, total_steps, refine_step, cfg, sampler_name, scheduler, base_positive, base_negative, refine_positive, refine_negative, base_vae, refine_vae, latent_image, seed,base_denoise, refine_denoise, mask: torch.Tensor|None = None) -> tuple[torch.Tensor, Any]:
TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'
Cannot import /home/sean/ComfyUI/custom_nodes/antrobots-comfyUI-nodepack module for custom nodes: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'
/home/sean/anaconda3/envs/py39/lib/python3.9/site-packages/transformers/models/segformer/image_processing_segformer.py:101: FutureWarning: The `reduce_labels` parameter is deprecated and will be removed in a future version. Please use `do_reduce_labels` instead.
warnings.warn(
Traceback (most recent call last):
File "/home/sean/ComfyUI/nodes.py", line 1888, in load_custom_node
module_spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/sean/ComfyUI/custom_nodes/ComfyUI-J/__init__.py", line 17, in <module>
from .pipelines import ControlNetUnit, ControlNetUnits, PipelineWrapper, schedulers
File "/home/sean/ComfyUI/custom_nodes/ComfyUI-J/pipelines/__init__.py", line 18, in <module>
from .jannchie import *
File "/home/sean/ComfyUI/custom_nodes/ComfyUI-J/pipelines/jannchie.py", line 1189, in <module>
class BasicTransformerBlockReferenceOnly(BasicTransformerBlock):
File "/home/sean/ComfyUI/custom_nodes/ComfyUI-J/pipelines/jannchie.py", line 1201, in BasicTransformerBlockReferenceOnly
attention_mask: torch.FloatTensor | None = None,
TypeError: unsupported operand type(s) for |: 'torch.tensortype' and 'NoneType'
Cannot import /home/sean/ComfyUI/custom_nodes/ComfyUI-J module for custom nodes: unsupported operand type(s) for |: 'torch.tensortype' and 'NoneType'
I seem to have solved the problem using info from this thread: https://github.com/tiangolo/typer/issues/371. The | operand doesn't work out of the box in my system when defining parameter types, probably due to using Python 3.9 rather than >3.10.
e.g. this function will produce an error: def forward( self, hidden_states: torch.FloatTensor, attention_mask: torch.FloatTensor | None = None, encoder_hidden_states: torch.FloatTensor | None = None, ... ) ...
The solution was to add from __future__ import annotations
on top of the following files:
I haven't run it yet but everything loads fine.
The solution was to add from future import annotations on top of the following files:
This usually means a python version mismatch.
The version of python I'm using is 3.11 and uses some newer syntax, so there's no way to run it in some older python environments.
Maybe I should update the readme to mention this.
Hello, I'm using Ubuntu 22.04.4 with rocm 5.6.1 and Python 3.9. I get several errors while trying to install the packages using ComfyUI Manager.
Cannot import /home/sean/ComfyUI/custom_nodes/ComfyUI-Inference-Core-Nodes module for custom nodes: No module named 'inference_core_nodes'