stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Fix info alignment in XYZ Grid script
Describe what this pull request is trying to achieve.
Resolve #7804 Fixes issue where the generation data in XYZ Grid does not align with the actual image; due to this, saved images did not have the correct metadata to re-generate them.
Additional notes and description of your changes
XYZ grid script was previously only culling the images property of its base Processed object, but not the related all_prompts, all_seeds, and infotexts lists, causing them to become misaligned. In a separate issue, sub-grids were later injecting into the images list, likewise without adjusting the data lists. I've just made it affect all lists the same way at the same time, and added a dict of lists for sub-grid data. (Oddly, all_prompts seems to include negative prompts as well, despite a separate list existing for that?)
Caveat: Sub-grids will copy the data of the first image generated in them (not always top left!) but for now it's better than just... not.
It's also kind of ugly, but I plan on making more significant changes to this script soon to improve efficiency. For now this fix should stand on its own, and does not seem to have conflict with any other current PR's for the file.
Environment this was tested in
- OS: Linux
- Browser: Firefox
- Graphics card: GeForce 1660 SUPER 6GB
i cannot reproduce the problem
Well that is... weird? Looking at the existing code you can see that it's altering the different lists in different ways, there's no mechanism for it to resolve that misalignment introspectively.
As discussed yesterday in Discord, this is still necessary, as the portion implemented only affects when sub-grids are turned off.