Skip to content
Workspace/OnBeg
LOCAL FIRSTMy account ↗

ComfyUI tensor shape mismatch

Trace incompatible dimensions and model components before changing random settings.

Reviewed 7 October 2026 · Evidence-led troubleshooting

Recognize the message

mat1 and mat2 shapes cannot be multiplied; size mismatch

This exception describes incompatible tensor dimensions at an operation. The traceback and connected model components determine which dimensions matter. It is not automatically a broken JSON connection.

Work through the evidence

  1. Keep the exact dimensions, failing node and full traceback. Record checkpoint or diffusion model, text encoder, VAE, adapter and any conditioning extensions.
  2. Return to a minimal workflow for the same documented model family. Disable optional additions in a copy and compare the required model components with the official example.
  3. Reconnect one optional component at a time and test a small image. If a specific component reproduces the error, check its supported model family and documented dimensions.

Verify the result

The minimal compatible graph runs and the previously failing component passes after a specific justified correction. Export that copy with a note of the versions tested.

What this does not prove

Do not infer a precise replacement model from the error text alone. Resolution, encoder dimensions, adapters and custom nodes can produce different shape failures.

Inspect before changing your workflow

The log inspector works in your browser. The workflow checker reads exported graph structure. Neither sends files automatically or executes nodes. Preserve the original, inspect a copy and record the actual test result in Casebook.

Inspect your log ↗ · Check the graph ↗ · Record a recovery case ↗

Before asking for help

Include the first full exception, the failing stage, software versions, model family and the smallest reproducible graph. Redact API keys, user paths and private prompts. A summary such as “KSampler broken” removes the context that distinguishes one failure from another.

Prepare a redacted copy ↗

Related investigations

ComfyUI CUDA out of memory · ComfyUI missing custom nodes · ComfyUI model not found · ComfyUI custom node import failed

Source and scope

These are OnBeg’s diagnostic checklists, informed by official ComfyUI troubleshooting. They are not universal fixes and do not replace model- or extension-specific instructions.