Randomize output resolution - problem with writing custom script #14889
Replies: 1 comment 4 replies
-
stable-diffusion-webui/modules/processing.py Lines 880 to 883 in e2b1990
one method you could try setting the shape for the first itre in a note of warning |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to implement a feature to add more variety to generations by randomizing the output image resolution. There are a few ways that I would like to implement, but I am already stuck with the simplest, first approach.
I would like to implement this as a custom script and I got this working to some extend with the following code:
In principle the script works and it generates images with different resolutions for each image in a batch, and the randomization is linked to the seed and therefore reproducible. The problem with this code is however, that the height and width that I am setting in the "before_process_batch" function is not used in the current image, but instead in the following image. The result of this is that the PNG info of all generated images does not fit: It does not contain the resolution of the image itself, but instead the resolution of the next image that was processed afterwards.
Does anyone recognize the problem with this code?
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions