Files
PozzettiAndrea-ComfyUI-Geom…/prestartup_script.py
T
PozzettiAndrea 414f759791 Vendor frontend JS into javascript/; drop the prestartup copy dance
The viewer JS/HTML/bundles are now committed in javascript/ (declared via
pyproject [tool.comfy] web = "javascript") instead of being copied from the
shared comfy-3d-viewers pip package at prestartup. Consequences:

- requirements.txt is now just comfy-env (host env installs nothing else,
  per the never-touch-the-host-env principle)
- prestartup_script.py no longer copies viewers or web_src; it keeps only
  setup_env() and the input-asset copies
- WEB_DIRECTORY attribute removed; the pyproject declaration is the single
  source (served at /extensions/comfyui-geometrypack/, keyed by project name)
- web_src/ deleted; its 6 widgets now live in javascript/js/ as the tracked
  source, edited directly
- viewer_pbr.html hardcoded-fallback URL updated to the new mount name

Iframe URLs auto-detect the mount from import.meta.url, so the folder rename
and mount-name change are transparent at runtime.
2026-08-12 17:37:09 +02:00

27 lines
860 B
Python

"""ComfyUI-GeometryPack Prestartup Script."""
import logging
from pathlib import Path
from comfy_env import setup_env, copy_files
log = logging.getLogger("geometrypack")
setup_env()
SCRIPT_DIR = Path(__file__).resolve().parent
COMFYUI_DIR = SCRIPT_DIR.parent.parent
# Copy input assets into the CONFIGURED input directory, not the code-tree one:
# ComfyUI Desktop separates user data from the code tree (--base-directory),
# so COMFYUI_DIR/input is never scanned by the load nodes there. main.py
# calls apply_custom_paths() before prestartup scripts, so folder_paths is
# already configured here.
try:
import folder_paths
INPUT_DIR = Path(folder_paths.get_input_directory())
except Exception:
INPUT_DIR = COMFYUI_DIR / "input"
copy_files(SCRIPT_DIR / "assets", INPUT_DIR / "3d", "**/*")
copy_files(SCRIPT_DIR / "assets", INPUT_DIR, "*.exr")