Tensor shape mismatch

Troubleshoot model pipeline errors using the traceback and your ComfyUI environment.

Read the expected and actual shapes

A tensor dimension error means that an operation received data that does not fit its expected dimensions. The failing node identifies the stage, but may not identify the component that introduced the mismatch. Save the shapes and the first complete traceback instead of relying on a shortened final line.

Compare the model pipeline

  1. Record the checkpoint or diffusion model family used by the workflow.
  2. Check that its text encoders and VAE match the documented pipeline. A file loading successfully does not establish compatibility with every model.
  3. Inspect adapters, ControlNet models and LoRAs for their supported architecture and version.
  4. Compare image, latent and mask dimensions where the failing operation combines them. Check required divisibility or sizing constraints in that node's maintained documentation.
  5. Try a documented minimal workflow for the same model family. Add optional stages back individually to isolate the first change that reproduces the mismatch.

A socket match is only a first check

Two ports can both be labelled CONDITIONING or LATENT while the data is incompatible at runtime. Conversely, extension-specific conversion rules can make differently labelled ports legitimate. OnBeg flags possible mismatches with their evidence and labels them runtime-dependent instead of rewriting the graph automatically.

Avoid ambiguous repairs

Do not replace random model files until the graph runs. Preserve the original and identify the mismatch systematically. If the error began after an update, compare the changed extension and model versions with their release requirements. A known-good minimal job provides a clearer reference than a large graph with several unrelated stages.

Continue with local diagnostics

Check the workflow · Inspect the log

References: ComfyUI troubleshooting · Custom-node installation.