Skip to content

Conversation

diodiogod
Copy link

Problem

The NunchakuFluxDiTLoader node crashes during initialization when broken symbolic links exist in the models/diffusion_models/ folder, preventing ComfyUI from loading.

Error:

FileNotFoundError: Model in folder 'diffusion_models' with filename 'xxx.safetensors' not found.

Root Cause

In nodes/models/flux.py line 99, INPUT_TYPES() uses folder_paths.get_full_path_or_raise() which throws an exception when encountering broken symlinks or missing files during the model list scan.

Solution

Replace get_full_path_or_raise() with get_full_path() and skip None results (broken symlinks/missing files) instead of crashing.

Changes

  • Changed folder_paths.get_full_path_or_raise()folder_paths.get_full_path()
  • Added if safetensor_path is None: continue to skip invalid paths
  • Node now loads successfully even with broken symlinks present

Testing

Tested with broken symlinks in models/diffusion_models/ - node now loads without errors and properly skips invalid files.

Replace get_full_path_or_raise() with get_full_path() in INPUT_TYPES()
to gracefully handle broken symlinks and missing files instead of crashing.

Fixes FileNotFoundError when ComfyUI scans model folders containing
broken symbolic links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant