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

Writing a PermutationSpec for SDXL #44

Open
AI-Casanova opened this issue Nov 21, 2023 · 8 comments
Open

Writing a PermutationSpec for SDXL #44

AI-Casanova opened this issue Nov 21, 2023 · 8 comments

Comments

@AI-Casanova
Copy link

Do you have any plans to Develop a PermutationSpec for SDXL?

If not, would you be so kind as to explain a bit more how you arrived at the one for 1.5?

I read through your conversation over on the original repo, but I'm having trouble following your work compared to a raw model.

@ogkalu2
Copy link
Owner

ogkalu2 commented Nov 24, 2023

I plan to write for XL. I'm just a bit swamped at the moment.

@AI-Casanova
Copy link
Author

I think I got the hang of it.

I'm working up a PermutationSpec for SDXL without VAE keys (I find no reason to ever merge VAE, simply replace if necessary) if I get it to work, I'll link it here for your use.

@AI-Casanova
Copy link
Author

https://github.com/vladmandic/automatic/blob/dev/modules/merging/merge_PermSpec_SDXL.py

SDXL PermutationSpec

@ogkalu2
Copy link
Owner

ogkalu2 commented Nov 26, 2023

Nicely done! Did you run a test ? Do you know what layers change when you attempt a merge ?

@AI-Casanova
Copy link
Author

AI-Casanova commented Nov 26, 2023

It seems to work fine (my code is based on @s1dlx code which is based on yours) but I haven't delved deeper.

@AI-Casanova
Copy link
Author

xyz_grid-xyz_grid-0000-basic50-a_8k_high_definition_photo_of_a_beautiful

@6DammK9
Copy link
Contributor

6DammK9 commented Apr 28, 2024

Finally got it done.
https://github.com/6DammK9/Merge-Stable-Diffusion-models-without-distortion/blob/main/merge_PermSpec_SDXL.py

You need to "sew" it properly, the permutation loop somehow iterlate the whole model in sequence, and checking tensor sizes. No wonder why it is left untouched for months.

Sample image in my fork, with comparasion.

@AI-Casanova
Copy link
Author

Amazing! I got it as far as I could, glad someone picked it up from there.

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

3 participants