RuntimeError: Tensor dimension mismatch in I2V sampling with bf16 model on macOS

Open
#2,018 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
ai

Research direction

Start by reproducing the reported I2V run with the bf16 14B model, euler scheduler, 16 frames, and 4 steps on macOS MPS. Then inspect wanvideo/schedulers/fm_solvers_unipc.py around line 511 and the cited Diffusers scheduler location; done means the reported tensor-dimension mismatch no longer occurs.

Written by the indexing model from the issue text.

Description

Issue

When using Wan2_1-I2V-14B-480P_bf16.safetensors model with euler scheduler,
getting tensor dimension mismatch: "The size of tensor a (45) must match the size of tensor b (44) at non-singleton dimension 4"

Environment

  • Device: macOS M3 Max (MPS backend)
  • Model: wan2.1_i2v_480p_14B_bf16
  • Frames: 16, Steps: 4
  • Scheduler: euler
  • Precision: bf16

Error Location

File: wanvideo/schedulers/fm_solvers_unipc.py, line 511
File: diffusers/schedulers/scheduling_flow_match_euler_discrete.py, line 513

Workaround

Works fine with 1.3B model (Wan2_1-T2V-1_3B_bf16.safetensors)

Dominant language
Python
Stars
6.8k
Forks
712
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kijai/ComfyUI-WanVideoWrapper

All issues in kijai/ComfyUI-WanVideoWrapper

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.