2.1 KiB
2.1 KiB
Developer Notes & Learnings
Environment Setup
-
Virtual Environment: Always use the specific ComfyUI virtual environment for python commands to ensure access to torch, numpy, etc.
- Path:
S:\ComfyUI\venv - Python Executable:
S:\ComfyUI\venv\Scripts\python.exe
- Path:
-
Windows Bash Path Handling:
- The environment uses a bash shell on Windows.
- Standard Windows paths (
S:\ComfyUI) may be interpreted or converted by the shell to Unix-style paths (/s/comfyui) in some contexts. - Best Practice: Use forward slashes for paths in bash commands (e.g.,
"S:/ComfyUI/venv/Scripts/python.exe"), or ensure proper quoting if using backslashes to avoid escape character issues.
ComfyUI Development
- Imports: Custom nodes often rely on
comfyandfolder_pathsmodules which reside in the ComfyUI root.- When testing scripts locally inside
custom_nodes/my_node/, you must explicitly add the ComfyUI root directory tosys.pathto simulate the runtime environment.
- When testing scripts locally inside
- Headless Testing:
- Use
pytestwith aconftest.pythat mockscomfyandfolder_pathsby injecting them intosys.modules. - Set
import-mode=importlibinpytest.inito handle relative imports in custom nodes correctly. - Use
if not 'PYTEST_CURRENT_TEST' in os.environ:in root__init__.pyto skip ComfyUI-specific initialization during test collection.
- Use
- HuggingFace Exploration:
- Use the
huggingface-clito list files in a repository without needing a browser. - Command:
huggingface-cli ls Insta360-Research/DAP-weights
- Use the
- Optimal Performance:
- Users should install
xformersto ensure compatibility and optimal performance with the underlying backbones. - Command:
pip install torch torchvision xformers -U --index-url https://download.pytorch.org/whl/cu130
- Users should install
- Interoperability:
- The
DAP Panoramic Meshnode outputs atrimesh.Trimeshobject using theTRIMESHtype name. - This ensures compatibility with
ComfyUI-GeometryPack, allowing users to pipeline DAP outputs into standard mesh decimation, boolean operations, and 3D exporters.
- The