This article was originally published on runaihome.com
RuntimeError: Normalized Shape Mismatch in ComfyUI Models
This error occurs when a LayerNorm or similar normalization layer in a PyTorch model receives an input tensor whose final dimension doesn't match the normalized_shape parameter specified during layer initialization. ComfyUI expects input with shape [*, 2560] but receives [1, 7, 3584], indicating a 1280-element discrepancy per token in the sequence. This typically stems from mismatched model configurations, corrupted model files, or custom nodes modifying model architectures inconsistently.
Fix 1: Re-download Model Checkpoint
Corrupted or partially downloaded model files commonly cause shape mismatches. Delete the affected model from ComfyUI/models/checkpoints/ and re-download from the original source. Verify file integrity by checking SHA256 hashes if provided. For models from Civitai or other sharing platforms, download the original unedited version rather than derivatives that may have architecture modifications.
Fix 2: Clear Model Cache and Recompile
# Navigate to ComfyUI directory
cd /path/to/ComfyUI
# Clear Python cache
find . -type d -name __pycache__ -exec rm -rf {} +
# Clear pytorch compiled cache (if exists)
rm -rf ~/.cache/torch/
# Restart ComfyUI completely
python main.py --force-fp16
This forces PyTorch to recompile all model operations with correct input shapes and clears any cached intermediate results that may have propagated the incorrect dimensions.
Fix 3: Disable Specific Custom Nodes via Metadata
If the
Top comments (0)