-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix img2img variations/MPS #353
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
Conversation
|
Did not dig into the code but tested the patch and it looks like it does cumulate variations, and I don't think that is the behaviour we want here. We want n-generated variations against the base image and not against the last generated variation. Also not sure what this patch has that is specific of MPS. |
Huh, that's surprising. It really shouldn't, from the code, and that's not what it looks like in my own testing. Are you sure it didn't just end up that way by chance? Can you run it again a couple times? If it's consistent, can you provide an exact image and prompt (including seed) so that I can see if I can reproduce it?
The relevant lines are here - we do our own noise initialization on MPS, rather than allowing the diffusers to do it, so that we can do it on the CPU, which is more deterministic for MPS. That is, |
|
Might have been by chance indeed, will run some more tests and share a seed if I can reliably reproduce it (was using the prompt from the readme). In my case the current |
Sorry, it's specifically when using variations combined with img2img, i.e. when you pass an |
|
this fixed img2img on my MPS as well 🙏 |
|
I should've noticed this is the same bug as I posted a few hours ago.. It's because a function was moved and the scope was changed. I am not sure this pull request is the best way to fix it. We could probably just move the function back. lstein is looking into it. |
magnusviri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
|
@magnusviri; Please never merge PRs directly to 'main'. All PR's (except maybe in the case of documentation corrections) MUST merge into the 'development' branch; merges to 'main' MUST only happen when @lstein cuts a release. We haven't hashed out how hotfixes work (i.e. really bad breaking bugs or security issues), but generally speaking, you'd open a PR, mark it prominently as a HOTFIX, it would get tested, reviewed, merged to 'dev', and then lstein would immediately merge to main and cut a hotfix release. The practical issue here (aside from the issue of having fixes in 'main' which aren't in a release and haven't necessarily been tested thoroughly) is that 'main' and 'development' will diverge, and this can easily result in someone having to spend a lot of time manually rebasing the two before 'dev' can be properly merged to 'main' for the next release. In this specific case, the risk is low as it only involves small changes in a single file, but it's very bad practice. |
|
@tildebyte yeah sorry about that. After I did it I realized my mistake. I was going to say sorry somewhere but I have a hard time keeping track of where people are talking about things and it was late so I went to bed and forgot the next day. It won't happen again. |
|
No worries! |
* fix img2img variations * fix assert for variation_amount
5454a0e broke img2img on MPS and when using
-v.PR'd against the
mainbranch because the main branch is currently broken, but I can switch todevelopmentif you'd prefer.(I also added a second commit fixing an assertion.)