Skip to content

Commit fc3c9d2

Browse files
committed
Fix MoGe download path for Comfy-Org/MoGe repo restructure, bump to 0.1.9
1 parent 1c21ae8 commit fc3c9d2

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ tmp/
2626

2727
autotune_cache.json
2828
*.log
29+
30+
.claude/

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import logging
44

5-
__version__ = "0.1.8"
5+
__version__ = "0.1.9"
66

77
LOGGER = logging.getLogger("Pixal3D_ComfyUI")
88

pixal3d_comfy/runtime.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ def safe_del(self):
5959
DEFAULT_REMBG_REPO = "briaai/RMBG-2.0"
6060
DEFAULT_MOGE_REPO = "Comfy-Org/MoGe"
6161
NATIVE_COMFY_MOGE_REPO = "Comfy-Org/MoGe"
62+
NATIVE_COMFY_MOGE_SUBDIR = "geometry_estimation"
6263
NATIVE_COMFY_MOGE_FILES = {
63-
"moge_1_vitl_fp16.safetensors": "moge/moge_1_vitl_fp16.safetensors",
64-
"moge_2_vitl_normal_fp16.safetensors": "moge/moge_2_vitl_normal_fp16.safetensors",
64+
"moge_1_vitl_fp16.safetensors": "geometry_estimation/moge_1_vitl_fp16.safetensors",
65+
"moge_2_vitl_normal_fp16.safetensors": "geometry_estimation/moge_2_vitl_normal_fp16.safetensors",
6566
}
6667
NATIVE_COMFY_MOGE_MODEL = "moge_2_vitl_normal_fp16.safetensors"
6768
ATTENTION_CHOICES = ["auto", "flash_attn_2", "flash_attn_3"]
@@ -374,7 +375,7 @@ def pixal3d_models_dir() -> Path:
374375

375376

376377
def moge_models_dir() -> Path:
377-
models_dir = Path(folder_paths.models_dir) / "moge"
378+
models_dir = Path(folder_paths.models_dir) / NATIVE_COMFY_MOGE_SUBDIR
378379
models_dir.mkdir(parents=True, exist_ok=True)
379380
try:
380381
folder_paths.add_model_folder_path("moge", str(models_dir))
@@ -631,23 +632,26 @@ def resolve_native_comfy_moge_path(
631632
repo_id = NATIVE_COMFY_MOGE_REPO
632633

633634
target_dir = moge_models_dir()
634-
required_path = target_dir / NATIVE_COMFY_MOGE_MODEL
635+
legacy_dir = Path(folder_paths.models_dir) / "moge"
635636

636637
if download_if_missing:
638+
target_dir.mkdir(parents=True, exist_ok=True)
637639
for filename, remote_filename in NATIVE_COMFY_MOGE_FILES.items():
638640
destination = target_dir / filename
639641
if not destination.exists():
640642
LOGGER.info("Downloading native ComfyUI MoGe file %s from %s to %s", remote_filename, repo_id, destination)
641643
_download_hf_file_to_path(repo_id, remote_filename, destination, hf_endpoint)
642644

643-
if required_path.exists() and required_path.is_file():
644-
return str(required_path)
645+
for search_dir in (target_dir, legacy_dir):
646+
required_path = search_dir / NATIVE_COMFY_MOGE_MODEL
647+
if required_path.exists() and required_path.is_file():
648+
return str(required_path)
645649

646650
expected = "\n".join(str(target_dir / filename) for filename in NATIVE_COMFY_MOGE_FILES)
647651
raise FileNotFoundError(
648652
"Native ComfyUI MoGe is missing.\n"
649653
f"Download link: https://huggingface.co/{NATIVE_COMFY_MOGE_REPO}\n"
650-
"Place the files directly in ComfyUI/models/moge, not in a Hugging Face snapshot folder:\n"
654+
f"Place the files in ComfyUI/models/{NATIVE_COMFY_MOGE_SUBDIR}/, not in a Hugging Face snapshot folder:\n"
651655
f"{expected}\n"
652656
"Enable download_if_missing once to download these files automatically."
653657
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "Pixal3D-ComfyUI"
33
description = "ComfyUI custom nodes for TencentARC Pixal3D image-to-3D generation with GLB export, FlashAttention 2/3 selection, and ComfyUI DynamicVRAM/Aimdo integration"
4-
version = "0.1.8"
4+
version = "0.1.9"
55
license = {file = "LICENSE"}
66
dependencies = [
77
"accelerate>=1.13.0",

0 commit comments

Comments
 (0)