apple / ml-stable-diffusion

Stable Diffusion with Core ML on Apple Silicon
MIT License
16.85k stars 941 forks source link

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

Open inhyoe opened 1 year ago

inhyoe commented 1 year ago

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.

l2gakuen commented 1 year ago

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.

gavtron2000 commented 1 year ago

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

jgranie commented 1 year ago

'(' & ')' 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

jrittvo commented 1 year ago

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.

NoahKamara commented 1 year ago

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