ml-stable-diffusion icon indicating copy to clipboard operation
ml-stable-diffusion copied to clipboard

If the keyword is long "Needed to truncate input" A phrase appears. is this normal?

Open inhyoe opened this issue 2 years ago • 5 comments

when i use prompt like that " swift run StableDiffusionSample --resource-path models/coreml-stable-diffusion-v1-4_original_compiled --compute-units all "personification of Halloween holiday in the form of a cute girl with short hair and a villain's smile, cute hats, cute cheeks, unreal engine, highly detailed, artgerm digital illustration, woo tooth, studio ghibli, deviantart, sharp focus, artstation, by Alexei Vinogradov bakery, sweets, emerald eyes " "

the prompt appear " Needed to truncate input "

but However, the execution is normal, but the output is different from the suggested word.

is it normal??

And is there any way to rename the output? The title appears as the name of the suggestion word of the result, but if the suggestion word is long, the name with the suggestion word truncated appears.

inhyoe avatar Jan 19 '23 07:01 inhyoe

yes, (Stable Diffusion Infos Explained : https://github.com/Maks-s/sd-akashic#general-information-toc) quote : Your prompt must be 75 tokens or less, anything above will result in "prompt truncated after tokenization"

anything higher is ignored, that's why the execution is normal, but the output is different from the suggested word.

l2gakuen avatar Jan 26 '23 05:01 l2gakuen

Automatic supports longer prompts. Is it possible to add this support to the repo? Apologies if this is a noob question! 😄

gavtron2000 avatar Mar 18 '23 05:03 gavtron2000

'(' & ')' are counted as token, does it mean we can't weight a token this way (maybe it's a feature inherent to A1111), can someone confirm ? Same as above, recent versions of A1111 allows more tokens, how did they achieve this ?

EDIT: Reply : https://github.com/huggingface/diffusers/issues/2136

jgranie avatar Jun 19 '23 21:06 jgranie

The Apple implementation doesn't support token weigting like (this) or ((this)). It also has a hard coded limit. And some words count as more than 1 of the 75 tokens. ml-stable-diffusion has its own rules different from diffusers.

jrittvo avatar Jun 19 '23 21:06 jrittvo

Do you know if Apple's implementation supports weighting at all?

NoahKamara avatar Sep 15 '23 15:09 NoahKamara