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

How can we add negative prompts? #6

Open
danielclough opened this issue Aug 30, 2023 · 1 comment
Open

How can we add negative prompts? #6

danielclough opened this issue Aug 30, 2023 · 1 comment

Comments

@danielclough
Copy link

I can not figure out how to add negative prompts.
I would be excited to learn how to send a PR for that if you like.

Can you suggest some reading to help me learn about what's going on here?

I have worked in Rust a bit.
I need to understand the torch part.

@Gadersd
Copy link
Owner

Gadersd commented Aug 30, 2023

The diffusion guidance works by computing DP = (P-B)*g + B where DP is the diffused latent image, P is the diffused positive prompt, B is the diffused blank prompt, and g is the guidance scale. Adding a negative prompt could be as simple as DN = (N-B)*ng + B, D = 0.5(DP - DN) where D is the desired diffused latent image.

It shouldn't be too difficult so give it a try if you are interested. Otherwise I'll probably get around to it after I implement the refiner model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants