ZHO-ZHO-ZHO / ComfyUI-PhotoMaker-ZHO

Unofficial implementation of PhotoMaker for ComfyUI
GNU General Public License v3.0
789 stars 41 forks source link

Dealing with CLIP's 77 token limit #49

Open yhdanid opened 10 months ago

yhdanid commented 10 months ago

Often when processing the generation request, a message like this is printed out, "The following part of your input was truncated because CLIP can only handle sequences up to 77 tokens: [" and then a list of what was truncated is shown.

This 77 token limit makes for a very short prompts that can frustrate producing good or desirable results. While I understand that this is not an exclusive PhotoMaker's issue, as others have certainly faced the same issue, it is my understanding however that a solution to this problem was implemented in most UI's of SD software.

Researching this matter, I've even come across a working solution proposed on the diffusers github issue's page [1]. There is also the Compel library [2]. It would be nice if some solution is implemented to allow a longer prompt in this implementation of PhotoMaker.

Regards

[1] https://github.com/huggingface/diffusers/issues/2136#issuecomment-1514338525 [2] https://github.com/damian0815/compel#compel

xpeng commented 9 months ago

is there any node for ComfyUI can link or weighted multiple prompt text(each less than 77 tokens) to one output?

jslegers commented 3 months ago

Related : https://github.com/huggingface/diffusers/issues/2136