RuntimeError: tensor size mismatch (24 vs 768) on beta7_fix1 during sampling

#87
by Asssad1 - opened

Hi @TenStrip ,

I tested both beta7 models on an up-to-date ComfyUI (master branch, RTX A6000 / Linux):

  • 10Eros_Max_h3_8stepTURBO_beta7_int8HQ.safetensors works perfectly without any issues.
  • 10Eros_Max_h3_8stepTURBO_beta7_fix1-native_int8_protected_edges_HQ.safetensors fails right at the sampling stage with a tensor mismatch error:
    [INFO] Comfy model compiler graph breaks: 2, rogues: 2
    [ERROR] !!! Exception during processing !!! The size of tensor a (24) must match the size of tensor b (768) at non-singleton dimension 1
    File ".../comfy/ldm/minimax/model.py", line 630, in forward
    out[0].copy_(graph_out[0])
    RuntimeError: The size of tensor a (24) must match the size of tensor b (768) at non-singleton dimension 1

It seems the output layer from the new Omni/PDD projection heads outputs 768 channels (24 × 32), while ComfyUI's internal buffer (out[0]) expects 24 channels.

Could you clarify:

  1. Does beta7_fix1 require a specific custom patch / PR branch for ComfyUI, or a specific node wrapper to handle the PDD heads?
  2. Is there a recommended launch flag (e.g. disabling the model compiler) or sampling configuration required specifically for fix1?

Thank you!

Hi! That protected-edge INT8 checkpoint was done by me, albeit I suspect you may have got the same error even with the original bf16 checkpoint.

I checked the currently hosted file: it matches my validated file and includes config.transformer.pdd_steps: 32, which should be enough for Comfyui to properly handle the PDD heads. It is working perfectly fine in my standard ComfyUI setup, without any custom patch or loader, on a master/nightly download of a couple of days ago. Windows in my case tho.

The exact 24 → 768 mismatch suggests the 32 PDD heads are being interpreted as separate output channels somewhere:

Video output projection: 3,072 rows.

Correct interpretation: 3,072 ÷ 4 ÷ 32 = 24 latent channels.

Without accounting for the 32 heads: 3,072 ÷ 4 = 768 channels.

That could happen if a loader or workflow patch loses/overrides the PDD configuration, or if the compiler mishandles the model. The failing copy_ line alone doesn’t distinguish those—it may simply be where an already incorrect shape is detected.

Could you try:

Restart ComfyUI and load the checkpoint through the standard Load Diffusion Model node, without additional PDD/head patches or LoRAs.

Repeat with --disable-comfy-compiler added to your launch command.

If disabling compilation fixes it, that would implicate the compiler path. Otherwise, the loader/configuration would be the next thing to inspect.

Please share your exact ComfyUI commit, workflow, custom loader nodes you might be using, and whether disabling the compiler changes the error.

I tried beta7_fix1_int8 with Dasiwa's workflow - no problems at all. So i suggest it is just your workflow.

The OP can also try the workflow in my repo. I've been using it both with the beta7 and the beta7 fix even when TenStrip was testing them internally, before their checkpoints were even uploaded; not only that but we are already exchanging files generated with it, so it's a quite safe starting point.

Without more information there is very little I can do to help tho :)

I also encountered the same error and couldn't use 🥲

Update comfyui to the latest version and make sure you use the default Diffusion model loading node. This should work

'd like to ask, does this new model still need to be paired with an acceleration LoRA?

For me swapping to UNETLoader (Load Diffusion Model) from CheckpointLoaderSimple fixed it. The other beta models worked Checkpointloader but fix doesn't it seems

size mismatch for final_layer.video_out.bias: copying a param with shape torch.Size([3072]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for final_layer.audio_out.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([32]).

size mismatch for final_layer.video_out.bias: copying a param with shape torch.Size([3072]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for final_layer.audio_out.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([32]).

As mentioned above, need to update Comfyui to a recent version (equal or higher than 0.41 i believe), and use the default Load diffusion model node.

Sign up or log in to comment