-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prompt weight info and parentheses passed to text_encoder #22
Comments
hmm, that should'n't be happening. can you post the complete sequence of calls? if you're doing |
Hi Damian,
Here is a test that shows the behaviour: (this is on Mac OS… similar on Ubuntu)
compel 1.1.0 pypi_0 pypi
pyparsing 3.0.9 pypi_0 pypi
python 3.10.10 hc0d8a6c_2
diffusers 0.14.0 pypi_0 pypi
from compel import Compel
from diffusers import StableDiffusionPipeline
pipeline = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
compel = Compel(tokenizer=pipeline.tokenizer, text_encoder=pipeline.text_encoder)
prompt = '(a medieval painting of the Virgin Mary riding a rocket through outer space.)0.7. (I love you.)0.8'
conditioning = compel.build_conditioning_tensor(prompt)
I get the following from
conjunction = self.parse_prompt_string(text)
Conjunction:[FlattenedPrompt:[Fragment:'(a medieval painting of the Virgin Mary riding a rocket through outer space.)0.7. (I love ***@***.***] | type AND | weights [1.0] | loras []
Without the periods I get:
Conjunction:[FlattenedPrompt:[Fragment:'a medieval painting of the Virgin Mary riding a rocket through outer ***@***.***, Fragment:'I love ***@***.***] | type AND | weights [1.0] | loras []
… On Apr 13, 2023, at 11:06 AM, Damian Stewart ***@***.***> wrote:
hmm, that should'n't be happening. can you post the complete sequence of calls? if you're doing compel("prompt") then the prompt is being parsed into a tree structure first, which is used to guide the assembly of the embedding tensor (eg applying weights/blends).
—
Reply to this email directly, view it on GitHub <#22 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/APRNCD5OC6FDDIPTWTBI4XDXBAJAPANCNFSM6AAAAAAW226KOY>.
You are receiving this because you authored the thread.
|
thanks, that seems like a parser bug, i'll take a look |
yes, that's a bug. fixed in compel v1.1.1 (just released) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As far as I can tell, if you send a prompt like
(A lovely beach-side cottage in the southern seas)0.5
the entire prompt including the parentheses and the 0.5 weight are passed into the tokenizer, and those additional tokens are passed along to the text_encoder.
Am I reading this correctly or have I missed something?
Is this the appropriate thing to do? I would have assumed that this additional weighting syntactical stuff should be removed before passing to the encoder.
The text was updated successfully, but these errors were encountered: