Clip Reshaper: Inspect Conditioning
That 'mat1 and mat2' error? Find out what's actually inside your conditioning
- conditioning
- STRING
Every ComfyUI user eventually hits the wall that is mat1 and mat2 shapes cannot be multiplied somewhere inside a KSampler. It's a genuinely terrible error to debug because it fires deep in the graph, long after the thing that caused it. The first question you actually want answered is: what is my CONDITIONING right now? That's exactly what Clip Reshaper: Inspect Conditioning prints for you.
How it works
ComfyUI's CONDITIONING type isn't a magic blob - it's a Python list of [tensor, meta] pairs. The tensor is your prompt's token embeddings, shaped roughly [1, tokens, D], and D is the part that matters. Different text encoders produce different D: SD 1.5's CLIP ViT-L/14 encodes at 768, SDXL's OpenCLIP-G at 1280, and the newer LLM encoders (Qwen, T5) at whatever the model's config says. Mix those up - say, you drop SDXL conditioning into an SD 1.5 UNet, or a cross-model adapter quietly changes the dimension - and KSampler's matrix multiply explodes.
This node hands you a print() in graph form. Feed it any conditioning, and it returns a STRING that breaks down every item: the full tensor shape, the final embedding dimension D, whether pooled_output is present and what shape it is, and which of the SDXL size keys (width, height, crop_w, crop_h, target_width, target_height) the metadata carries. One glance at that output tells you whether your problem is a dimension mismatch, a missing pooled_output, or an encoder that isn't writing SDXL metadata at all.
Inputs and output
The interface is as minimal as it gets: one required input, conditioning - wire it from whatever you suspect, a CLIPTextEncode, an adapter, or right before the sampler. The single output is a STRING; hook it into a Show Text / Preview Text node, or newer ComfyUI versions just render it inline. You'll see something like:
items: 1
[0] tensor_shape=(1, 77, 768) D=768 pooled=False size_keys=[]
That right there is the diagnosis. D=768 against an SDXL model expecting 1280? There's your bug, and it's not in the sampler.
Install
To get the node, install the pack once (it works for the whole Clip Reshaper family). In ComfyUI Manager, search for "Clip Reshaper" and hit install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/thezveroboy/ComfyUI-ClipReshaper
Then restart ComfyUI. No requirements to install, no models to download - the pack's only dependency is torch, which ComfyUI already ships.
The honest caveat
This is a niche pack from a small author (thezveroboy, active on r/comfyui) with essentially zero community footprint, and it's a debugging utility, not a flashy feature. But of the five nodes in the pack, Inspect is the one I'd actually reach for unprompted. The rest of the pack reshapes conditioning to make the numbers fit; this one tells you why they don't. Start there.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |