diff options
author | Francesco Manzali <manzali.francesco97@gmail.com> | 2023-01-31 17:58:36 +0000 |
---|---|---|
committer | Francesco Manzali <manzali.francesco97@gmail.com> | 2023-01-31 17:58:36 +0000 |
commit | 17b24e45e8839d889af35ee0b2fb0825306ddafe (patch) | |
tree | f12825f630c1e23253a05c7f5c3ab978a7ff7abf /scripts/prompt_matrix.py | |
parent | 2c1bb46c7ad5b4536f6587d327a03f0ff7811c5d (diff) | |
download | stable-diffusion-webui-gfx803-17b24e45e8839d889af35ee0b2fb0825306ddafe.tar.gz stable-diffusion-webui-gfx803-17b24e45e8839d889af35ee0b2fb0825306ddafe.tar.bz2 stable-diffusion-webui-gfx803-17b24e45e8839d889af35ee0b2fb0825306ddafe.zip |
Fix prompt matrix #rows/#cols when using hires
- images.draw_prompt_matrix() should be called with the final width/height
of the generated images, after upscaling.
Otherwise, the number of rows/cols computed in images.draw_grid_annotations
will increase by the upscaling factor.
- Round the number of cols/rows in images.draw_grid_annotations, since
the final images width may be a bit less than the required
hr_upscale_to_x/y
Diffstat (limited to 'scripts/prompt_matrix.py')
-rw-r--r-- | scripts/prompt_matrix.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/prompt_matrix.py b/scripts/prompt_matrix.py index dd95e588..f6575b6b 100644 --- a/scripts/prompt_matrix.py +++ b/scripts/prompt_matrix.py @@ -79,7 +79,7 @@ class Script(scripts.Script): processed = process_images(p)
grid = images.image_grid(processed.images, p.batch_size, rows=1 << ((len(prompt_matrix_parts) - 1) // 2))
- grid = images.draw_prompt_matrix(grid, p.width, p.height, prompt_matrix_parts)
+ grid = images.draw_prompt_matrix(grid, max(p.width, p.hr_upscale_to_x), max(p.height, p.hr_upscale_to_y), prompt_matrix_parts)
processed.images.insert(0, grid)
processed.index_of_first_image = 1
processed.infotexts.insert(0, processed.infotexts[0])
|