pr 1: fix finding the VAE

#3
by dummy9996 - opened

before: SeedVR2 TinyVAE: ema_vae_distill_fp16.safetensors not found
after: [INFO] SeedVR2 TinyVAE: Found weights at /ComfyUI/models/vae/ema_vae_distill_fp16.safetensors

Thanks for this β€” you found a real bug and I've pushed a fix.

You're right that ComfyUI/models/vae/ could fail. The cause is that it was only reachable through import folder_paths, with no filesystem fallback, so if that import didn't resolve, the location the README documents silently didn't work.

I went with a different fix, though, because the sys.path fallback in this PR can't work as written:

comfy_path = os.path.dirname(os.path.dirname(os.path.abspath(file)))
With the node at ComfyUI/custom_nodes/ComfyUI-SeedVR2-1.4B-TinyVAE/init.py, two dirname calls land on ComfyUI/custom_nodes β€” but folder_paths.py lives in the ComfyUI root, one level further up. I tested it and import folder_paths still raises ModuleNotFoundError afterwards.

Rather than add a third dirname and mutate sys.path at import time, I just resolve ../../models/vae directly as an extra candidate. Same outcome, no import machinery, and it can't be broken by an unusual install depth. The folder_paths lookup stays in place alongside it, since it's the only thing that honours extra_model_paths.yaml for people who relocate their models directory.

I did take your diagnostics idea β€” on a failed lookup the node now logs every path it searched, which is what would have let you pin this down without reading the source.

Fixed in init.py; closing this one. Thanks for the report.

lvladikov changed pull request status to closed
lvladikov deleted the refs/pr/3 ref

Sign up or log in to comment