Skip to content
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

inputting prompt weights via text prompt #136

Open
PaulMest opened this issue Dec 13, 2022 · 4 comments
Open

inputting prompt weights via text prompt #136

PaulMest opened this issue Dec 13, 2022 · 4 comments
Labels
feature request New feature or request planned

Comments

@PaulMest
Copy link
Contributor

The Stable Diffusion community has a lot of examples that use weights in prompts. For example: 'Cat with !black nose! !!blue eyes!!' should have a higher weighting on black nose and an even higher weighting on blue eyes.

I just realized that prompt weights are not implemented in imaginAIry. But there appears to be something similar implemented for clip masking. Could we reuse the same parsing approach from clip masks for prompt weights? Or could you outline the steps that you think are needed to allow for prompt weighting from a text string?

Looks like there's also some sample code in this Reddit thread

@brycedrennan brycedrennan added the feature request New feature or request label Dec 13, 2022
@brycedrennan brycedrennan changed the title feature request: Prompt weights feature request: inputing prompts weights via text prompt Dec 13, 2022
@PaulMest PaulMest changed the title feature request: inputing prompts weights via text prompt feature request: inputting prompts weights via text prompt Dec 13, 2022
@brycedrennan
Copy link
Owner

Prompt weights are supported via the python library but not via text prompts. I have been hesitant to implement because I don't like the widely used syntaxes and I wasn't sure if they added enough value to justify their existence. Any prompt weighting syntax may conflict with future syntax for more interesting features.

Yes the approach used for the clip masking prompts is a far more robust solution than whats going on in a lot of other codebases doing a more ad-hoc parsing approach.

All that being said there is value in just using the same syntax people are already expecting. I'd accept a pull request that implemented whatever is widely used. I'd also accept a new syntax that feels more programmatic and allows for future additions.

@brycedrennan
Copy link
Owner

You seem to have good judgment. Probably I'll be happy with whatever direction you want to go in.

@brycedrennan
Copy link
Owner

Also I suspect that "weighting" things doesn't work like people think and can make the images worse. I'd need to dive into how the other repos are doing it. In this repo something like "a happy giant !!!dog!!!" would get translated to "a happy giant" and "dog"(weight 3), which would create a picture of a hybrid humanoid giant and dog.

Very possible others have more clever approaches than how weighting works in this repo.

@PaulMest PaulMest changed the title feature request: inputting prompts weights via text prompt feature request: inputting prompt weights via text prompt Dec 13, 2022
@PaulMest
Copy link
Contributor Author

Thanks for the thoughts/guidance. I will think about it a bit more and update this thread with my thoughts or a link to a PR if I make any meaningful progress.

@brycedrennan brycedrennan changed the title feature request: inputting prompt weights via text prompt inputting prompt weights via text prompt Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request planned
Projects
None yet
Development

No branches or pull requests

2 participants