Max sequence length 88 > 77

#17
by Lilianaria - opened

I'm sorry I'm late to the party and pretty fresh still, but in ComfyUI I get this error: Token indices sequence length is longer than the specified maximum sequence length for this model (88 > 77). Running this sequence through the model will result in indexing errors

These can be used for SD1.5, right? Genuine question lol.

I have all the config files with a few of the models in a subfolder together, is this correct? The models I have are:
ViT-L-14-BEST-smooth-GmP-TE-only-HF-format.safetensors
ViT-L-14-TEXT-detail-improved-hiT-GmP-HF.safetensors
ViT-L-14-TEXT-detail-improved-hiT-GmP-TE-only-HF.safetensors

That sounds very unusual; the internal size of the model is 77, as you can see when you click on that "layer symbol icon" next to the model here on HF:

image.png

It sounds like an issue with your ComfyUI configuration, as my model would alas 'communicate' it is has a sequence length of 77. I'm not sure where that 88 may be coming from - perhaps you're not using the standard CLIP Loader node -> try loading with a default workflow? If that's not the problem, you could try disabling all custom nodes to see if that is the problem somehow, by launching with:

python main.py --disable-all-custom-nodes

Otherwise, I'd suggest opening an issue on ComfyUI github and asking there.

To answer your question, yes, my models work for anything that uses a CLIP-L - and that includes SD 1.5.

Good luck! :)

PS: The error suggests your prompt was too long, but that should be just 'cut off' and discarded, not causing ComfyUI to throw an error, so there's definitely something wrong somewhere.
But reducing the length of your prompt would likely be a 'quick fix', although it doesn't address the underlying problem.

Yup, as it turns out it was a custom node I forgot I was testing; the stock CLIP Text Encode nodes don't give the error, while the 'advanced' one from https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb does. I guess the weights interpretation and token normalization are tacking on extra tokens. I'll do some digging and rectify my issue.

Thank you for the quick and helpful reply, and I'm glad it wasn't an issue with your ViT-L ^_^

Lilianaria changed discussion status to closed

Sign up or log in to comment