AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.89k stars 26.94k forks source link

[Bug]: X/Y/Z grid adds progressively larger downward offset as z increases, resulting in bottom row cutoff #8261

Open JenXIII opened 1 year ago

JenXIII commented 1 year ago

Is there an existing issue for this?

What happened?

I generated a 27x4x15 x/y/z grid of 512x640 images in txt2img, with the attached x/y/z settings chrome_2023-03-02_08-47-44

Upon viewing the result, I noticed the bottom row becomes progressively more cut off as the actual image grid does not start until a progressively lower and lower point on the image. I've attached scaled jpeg since the original is a bit unwieldy. xyz_grid-0371-1765535728-(masterpiece), (best quality), (ultra-detailed),(best shadow_0 7), (best illustration), (an extremely delicate and beautiful), p

Shown here is a reproduction interrupted early on for space and time purposes from latest commit xyz_grid-0387-1765535728-(masterpiece), (best quality), (ultra-detailed),(best shadow_0 7), (best illustration), (an extremely delicate and beautiful), p

Steps to reproduce the problem

Create a x/y/z grid of for instance 512x620 images, x containing a large number of entries may be important? I reproed with 27x4x15, x addnet model 1, y addnet weight 1, z checkpoint name.

FWIW some of the checkpoint names in the z "axis" had long strings, and almost all the addnet strings in x were long

If you observe the result you find that with each z grid a noticable slight drop in starting position of images occurs

WebUI run through Chrome Version 110.0.5481.178 (Official Build) (64-bit)

What should have happened?

all subgrids should be started at a fixed coordinate in the vertical direction

Commit where the problem happens

0cc0ee1, also commit before latest set of script updates on Feb 19th

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

set COMMANDLINE_ARGS= --xformers --no-half-vae
set STABLE_DIFFUSION_COMMIT_HASH="c12d960d1ee4f9134c2516862ef991ec52d3f59e"
set ATTN_PRECISION=fp16

List of extensions

a1111-sd-webui-tagcomplete https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git 82395850 (Sat Feb 25 12:03:05 2023) unknown sd-scripts https://github.com/kohya-ss/sd-scripts ae33d724 (Sat Feb 4 12:21:24 2023) unknown sd-webui-additional-networks https://github.com/kohya-ss/sd-webui-additional-networks 4b110358 (Fri Feb 3 13:34:54 2023) unknown sd-webui-controlnet https://github.com/Mikubill/sd-webui-controlnet c16489c0 (Sun Feb 26 03:08:03 2023) unknown sd-webui-utilities https://github.com/space-nuko/sd-webui-utilities 93334bc2 (Mon Feb 20 00:45:59 2023) unknown sdweb-merge-board https://github.com/bbc-mc/sdweb-merge-board.git f59c60fd (Wed Jan 25 15:00:09 2023) unknown stable-diffusion-webui https://github.com/catppuccin/stable-diffusion-webui.git 6c75a39e (Fri Feb 17 22:44:29 2023) unknown stable-diffusion-webui-daam https://github.com/toriato/stable-diffusion-webui-daam.git 0906c850 (Thu Jan 26 04:20:48 2023) unknown stable-diffusion-webui-dataset-tag-editor https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor 7191240d (Sun Feb 26 05:32:13 2023) unknown stable-diffusion-webui-model-toolkit https://github.com/arenatemp/stable-diffusion-webui-model-toolkit 8d8f073f (Fri Feb 17 20:39:41 2023) unknown stable-diffusion-webui-tokenizer https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git ac6d541c (Sat Dec 10 12:58:31 2022) unknown stable-diffusion-webui-two-shot https://github.com/opparco/stable-diffusion-webui-two-shot 9936c52e (Sun Feb 19 08:40:41 2023) unknown stable-diffusion-webui-wd14-tagger https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git 590c9a73 (Sun Feb 19 11:51:48 2023) unknown ultimate-upscale-for-automatic1111 https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git 0a3d03a4 (Tue Feb 7 06:07:23 2023) unknown LDSR built-in
Lora built-in
ScuNET built-in
SwinIR built-in
prompt-bracket-checker built-in

Console logs

venv "C:\Stable Diffusion git\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8
Fetching updates for Stable Diffusion...
Checking out commit for Stable Diffusion with hash: "c12d960d1ee4f9134c2516862ef991ec52d3f59e"...
Installing requirements for Web UI

Launching Web UI with arguments: --xformers --no-half-vae
[AddNet] Updating model hashes...
100%|██████████████████████████████████████████████████████████████████████████████| 379/379 [00:00<00:00, 2482.50it/s]
[AddNet] Updating model hashes...
100%|█████████████████████████████████████████████████████████████████████████████| 379/379 [00:00<00:00, 42105.24it/s]
Loading weights [a074b8864e] from C:\Stable Diffusion git\stable-diffusion-webui\models\Stable-diffusion\Counterfeit-V2.5_pruned.safetensors
Creating model from config: C:\Stable Diffusion git\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights found near the checkpoint: C:\Stable Diffusion git\stable-diffusion-webui\models\Stable-diffusion\Counterfeit-V2.5_pruned.vae.pt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(84): [cut for privacy]
Model loaded in 9.4s (load weights from disk: 0.1s, create model: 0.4s, apply weights to model: 3.5s, apply half(): 0.6s, load VAE: 0.8s, move model to device: 0.8s, load textual inversion embeddings: 3.2s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
X/Y/Z plot will create 1620 images on 15 27x4 grids. (Total steps to process: 32400)
restoring last networks
original forward/weights is restored.
LoRA weight_unet: 0.6, weight_tenc: 0.6, model: [cut for privacy](8f606d73ae42)
dimension: 128, alpha: 128.0, multiplier_unet: 0.6, multiplier_tenc: 0.6
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
original forward/weights is backed up.
enable LoRA for text encoder
enable LoRA for U-Net
shapes for 0 weights are converted.
LoRA model [cut for privacy] loaded: <All keys matched successfully>
setting (or sd model) changed. new networks created.
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.18it/s]
restoring last networks                                                           | 60/32400 [00:49<1:47:54,  5.00it/s]
original forward/weights is restored.
LoRA weight_unet: 0.6, weight_tenc: 0.6, model: [cut for privacy](2965db0ce322)
dimension: 128, alpha: 128.0, multiplier_unet: 0.6, multiplier_tenc: 0.6
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
original forward/weights is backed up.
enable LoRA for text encoder
enable LoRA for U-Net
shapes for 0 weights are converted.
LoRA model [cut for privacy] loaded: <All keys matched successfully>
setting (or sd model) changed. new networks created.
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.73it/s]
restoring last networks                                                           | 80/32400 [00:56<1:59:37,  4.50it/s]
original forward/weights is restored.
LoRA weight_unet: 0.6, weight_tenc: 0.6, model: [cut for privacy](5e3cec3f4f82)
dimension: 128, alpha: 128.0, multiplier_unet: 0.6, multiplier_tenc: 0.6
create LoRA for Text Encoder: 72 modules.
create LoRA for U-Net: 192 modules.
original forward/weights is backed up.
enable LoRA for text encoder
enable LoRA for U-Net
shapes for 0 weights are converted.
LoRA model [cut for privacy](5e3cec3f4f82) loaded: <All keys matched successfully>
setting (or sd model) changed. new networks created.
 25%|████████████████████▊                                                              | 5/20 [00:00<00:02,  5.25it/s]
Total progress:   0%|▏                                                           | 85/32400 [02:20<14:52:20,  1.66s/it]

Additional information

No response

JenXIII commented 1 year ago

For anyone looking to repro, I can also reproduce this with just two items in the z "coordinate"

DejitaruJin commented 1 year ago

Adding this to my ever-growing "may as well fix this too" list since I'm messing with the X/Y/Z script so much.

Edit: If I can actually reproduce it... Either my refactoring fixed it, or someone made changes to images.py that I haven't downloaded yet myself.