divamgupta/stable-diffusion-tensorflow

Prompt is too long (should be < 77 tokens)

Closed this issue · 2 comments

Is there any way to have longer prompts? (I'm a complete ML noob, would love to learn!)

Screen Shot 2022-09-20 at 10 03 40 PM

Just read stable diffusion's source code and learned that the tokenizer also caps at 77 tokens, so this issue is moot. I would still love to know why this is the case though!

@lawrencecchen this explains it:
#20 (comment)

The clip-vit-large-patch14 (https://huggingface.co/openai/clip-vit-large-patch14) model used by SD can only handle sequences of 77 tokens. It works like that in the original pytorch implementation as well. Anything longer than that gets silently truncated.