Comfy-Org / Comfy-Org/ComfyUI

Wan model is not working in MacOs if scheduler is `uni_pc`

Open
#7,027 6 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Expected Behavior

A normal video output

### Actual Behavior

https://github.com/user-attachments/assets/66051ca7-ccd2-4fb9-a186-a9bf4e974772

### Steps to Reproduce

I was trying to use Wan 2.1 model in Comfy in my macbook pro (M2). And use the example workflow from [blog examples](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/blob/main/example%20workflows_Wan2.1/image_to_video_wan_480p_example.json).

### Debug Logs

```powershell
env PYTORCH_ENABLE_MPS_FALLBACK=1 python main.py --force-upcast-attention

[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-03-01 13:19:21.836
** Platform: Darwin
** Python version: 3.11.11 (main, Jan 5 2025, 06:40:04) [Clang 19.1.6 ]
** Python executable: /Users/edwin/AI/.venv/bin/python
** ComfyUI Path: /Users/edwin/AI/ComfyUI
** ComfyUI Base Folder Path: /Users/edwin/AI/ComfyUI
** User directory: /Users/edwin/AI/ComfyUI/user
** ComfyUI-Manager config path: /Users/edwin/AI/ComfyUI/user/default/ComfyUI-Manager/config.ini
** Log path: /Users/edwin/AI/ComfyUI/user/comfyui.log

Prestartup times for custom nodes:
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/rgthree-comfy
1.1 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-manager

Checkpoint files will always be loaded safely.
Total VRAM 65536 MB, total RAM 65536 MB
pytorch version: 2.7.0.dev20250210
xformers version: 0.0.29.post3
Set vram state to: SHARED
Device: mps
Using sub quadratic optimization for attention, if you have memory or speed issues try using: --use-split-cross-attention
ComfyUI version: 0.3.18
[Prompt Server] web root: /Users/edwin/AI/ComfyUI/web
### Loading: ComfyUI-Manager (V3.18.1)
### ComfyUI Version: v0.3.18 | Released on '2025-02-26'
(pysssss:WD14Tagger) [DEBUG] Available ORT providers: CoreMLExecutionProvider, AzureExecutionProvider, CPUExecutionProvider
(pysssss:WD14Tagger) [DEBUG] Using ORT providers: CUDAExecutionProvider, CPUExecutionProvider
/Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI-WanVideoWrapper/wanvideo/modules/model.py:29: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
@amp.autocast(enabled=False)
/Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI-WanVideoWrapper/wanvideo/modules/model.py:42: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
@amp.autocast(enabled=False)

[rgthree-comfy] Loaded 42 fantastic nodes. πŸŽ‰

Total VRAM 65536 MB, total RAM 65536 MB
pytorch version: 2.7.0.dev20250210
xformers version: 0.0.29.post3
Set vram state to: SHARED
Device: mps
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
------------------------------------------
Comfyroll Studio v1.76 : 175 Nodes Loaded
------------------------------------------
** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md
** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki
------------------------------------------

Import times for custom nodes:
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/websocket_image_save.py
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui_ipadapter_plus
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-wd14-tagger
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-custom-scripts
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/rgthree-comfy
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI-GGUF
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes
0.0 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI-IPAdapter-Flux
0.1 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI-WanVideoWrapper
0.2 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-manager
0.2 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-kjnodes
0.3 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-videohelpersuite
0.6 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-mvadapter
0.8 seconds: /Users/edwin/AI/ComfyUI/custom_nodes/comfyui-florence2

Starting server

To see the GUI go to: http://127.0.0.1:8188
FETCH ComfyRegistry Data: 5/35
got prompt
Using split attention in VAE
Using split attention in VAE
VAE load device: mps, offload device: cpu, dtype: torch.bfloat16
FETCH ComfyRegistry Data: 10/35
Requested to load CLIPVisionModelProjection
loaded completely 9.5367431640625e+25 1208.09814453125 True
Requested to load WanTEModel
loaded completely 9.5367431640625e+25 6419.477203369141 True
CLIP/text encoder model load device: cpu, offload device: cpu, current: cpu, dtype: torch.float16
FETCH ComfyRegistry Data: 15/35
FETCH ComfyRegistry Data: 20/35
FETCH ComfyRegistry Data: 25/35
FETCH ComfyRegistry Data: 30/35
FETCH ComfyRegistry Data: 35/35
FETCH ComfyRegistry Data [DONE]
[ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
nightly_channel: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/remote
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
[ComfyUI-Manager] All startup tasks have been completed.
Requested to load WanVAE
loaded completely 9.5367431640625e+25 242.02829551696777 True
/Users/edwin/AI/ComfyUI/custom_nodes/ComfyUI-GGUF/loader.py:65: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/utils/tensor_numpy.cpp:209.)
torch_tensor = torch.from_numpy(tensor.data) # mmap

ggml_sd_loader:
0 823
12 360
14 120
model weight dtype torch.bfloat16, manual cast: None
model_type FLOW
Requested to load WAN21
loaded completely 9.5367431640625e+25 10943.232666015625 True
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 20/20 [58:06<00:00, 174.34s/it]
Requested to load WanVAE
loaded completely 9.5367431640625e+25 242.02829551696777 True
Prompt executed in 3739.42 seconds
```

### Other

However, I found that I could fix it after I changed the KSampler sampler name to euler or euler-ancestral and ~KSampler scheduler to normal~ (Edit, it is not important). (Thanks for this [reddit post](https://www.reddit.com/r/comfyui/comments/1izktly/comment/mf3omam/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.