phineas-pta / comfy-trt-test

attempt to use TensorRT with ComfyUI
Apache License 2.0
82 stars 3 forks source link

No module named 'polygraphy' #6

Closed chrish-slingshot closed 10 months ago

chrish-slingshot commented 10 months ago

I am getting this error when starting ComfyUI when using your nodes:

  File "S:\StableDiffusion\UI\ComfyUI_stable\ComfyUI\nodes.py", line 1800, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "S:\StableDiffusion\UI\ComfyUI_stable\ComfyUI\custom_nodes\comfy-trt-test\__init__.py", line 13, in <module>
    from .comfy_trt.node_unet import TRT_Unet_Loader
  File "S:\StableDiffusion\UI\ComfyUI_stable\ComfyUI\custom_nodes\comfy-trt-test\comfy_trt\node_unet.py", line 24, in <module>
    from .utilities import Engine
  File "S:\StableDiffusion\UI\ComfyUI_stable\ComfyUI\custom_nodes\comfy-trt-test\comfy_trt\utilities.py", line 26, in <module>
    from polygraphy.backend.common import bytes_from_path
ModuleNotFoundError: No module named 'polygraphy'

Cannot import S:\StableDiffusion\UI\ComfyUI_stable\ComfyUI\custom_nodes\comfy-trt-test module for custom nodes: No module named 'polygraphy'

I have the module installed in my venv:

Version: 0.49.0
Summary: Polygraphy: A Deep Learning Inference Prototyping and Debugging Toolkit
Home-page: https://github.com/NVIDIA/TensorRT/tree/main/tools/Polygraphy
Author: NVIDIA
Author-email: svc_tensorrt@nvidia.com
License: Apache 2.0
Location: c:\users\<user>\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
Requires:
Required-by:
phineas-pta commented 10 months ago

the installation path is not a venv, it's your python installation directory

chrish-slingshot commented 10 months ago

My comfy-trt-test directory, right? that's where I'm running the pip install command.

phineas-pta commented 10 months ago

no 👽 that's not venv

anyway:

u having at least 2 different python on your pc: the 1 at your user space and the 1 embedded with comfyui portable

u installed polygraphy with python at user space, that's wrong

u need to install with python embedded with comfyui portable

chrish-slingshot commented 10 months ago

Sorry, I'm only a beginner with Python. How can I force it to do a pip install to the embedded python rather than the global one?

phineas-pta commented 10 months ago

maybe im wrong, im not clear about your setup anyway 🤔

that's one of reasons why i wrote "for advanced users" in README

anyway let find out what happened: where & how u install & launch comfyui ?

chrish-slingshot commented 10 months ago

Nevermind, I got it to work :) Switched to WSL and loaded up a fresh ComfyUI instance in that, and now I see the nodes.

phineas-pta commented 10 months ago

ok no prob