vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.61k stars 411 forks source link

[Issue]: ModernUI issue with windows native scaling #3185

Closed GriZen83 closed 3 months ago

GriZen83 commented 4 months ago

Issue Description

I am using 7900xtx and is using Zluda. I have used the previous versions of this excellent app to compare with. And I have some feedback for you.

Ui scaleability are broken on some displays. If you use 300% in windows in the modern skin it will be broken as the Prompt will not will show up at all. Other elements such as lora information/notes will also not show up at 300%, but will appear at 200% at 4k. One click prompt extension will also not show up in modern skin but in the standard ui.

[EDITED - below here are unrelated issues that are not part of this ticket]

I understand Zluda is a hack so I expect problems but some rather major changes has begun to happen since the latest update. Face restore and Adetailer have becom really slow 2s/it it takes 40 secs to render a face while the entire picture with sdxl 1024x1024 takes 2,5its/s or 10 secs at 30steps. And that seems wierd.

There is also a problem with batches that causes my system to become unresponsable example: 1x4 batch when you save the picture takes as long as the generating the picture itself. Perhaps is happening during the vae step. 5x4 is nearly guarenteed to make the system to become unresponsive and that did not happened last week. Anyway good work!

Version Platform Description

Windows 11. 32gb ram. CPU: AMD7700X GPU:AMD RX79000xtx Hellhound. Webbrowser: Vivaldi

Relevant log output

2024-05-30 14:48:21,809 | sd | DEBUG | ui_sections | Sampler set options: spacing=default timesteps=
2024-05-30 14:48:21,817 | sd | DEBUG | shared | Unused settings: ['multiple_tqdm', 'token_merging_ratio']
2024-05-30 14:48:47,869 | sd | INFO | sd_models | Applying ToDo: ratio=0.3
2024-05-30 14:48:47,900 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLPipeline
2024-05-30 14:48:51,205 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLPipeline task=DiffusersTaskType.TEXT_2_IMAGE batch=1/4x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 6, 'num_inference_steps': 30, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_end': None, 'output_type': 'latent', 'width': 1024, 'height': 1024, 'parser': 'Full parser'}
2024-05-30 14:49:24,728 | sd | INFO | images | Save: image="outputs\text\2024-05-30\00243-autismmixSDXL_autismmixConfetti-score 9 score 8 up score 7 up.jpg" type=JPEG resolution=1024x1024 size=167848
2024-05-30 14:49:24,730 | sd | INFO | devices | High memory utilization: GPU=100% RAM=68% {'ram': {'used': 21.08, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:49:25,804 | sd | DEBUG | devices | GC: collected=1499 device=cuda {'ram': {'used': 6.96, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0} time=1.07
2024-05-30 14:49:25,852 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLPipeline
2024-05-30 14:49:25,856 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLPipeline task=DiffusersTaskType.TEXT_2_IMAGE batch=2/4x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 6, 'num_inference_steps': 30, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_end': None, 'output_type': 'latent', 'width': 1024, 'height': 1024, 'parser': 'Full parser'}
2024-05-30 14:49:42,349 | sd | DEBUG | face-details | Face HiRes: faces=[{'score': 0.78, 'size': '124x156'}] args={'conf': 0.6, 'iou': 0.5, 'max_det': 5} denoise=0.4 blur=10 resolution=1024x1024 padding=10
2024-05-30 14:49:42,352 | sd | DEBUG | sd_models | Pipeline class change: original=StableDiffusionXLPipeline target=StableDiffusionXLInpaintPipeline device=cuda:0 fn=init
2024-05-30 14:49:42,370 | sd | DEBUG | masking | Mask: size=1024x1024 masked=39937px area=0.04 auto=None blur=0.039 erode=0.01 dilate=0.0390625 type=Grayscale time=0.02
2024-05-30 14:49:42,421 | sd | INFO | devices | High memory utilization: GPU=100% RAM=64% {'ram': {'used': 19.85, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:49:43,313 | sd | DEBUG | devices | GC: collected=148 device=cuda {'ram': {'used': 6.99, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.89
2024-05-30 14:49:43,340 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLInpaintPipeline
2024-05-30 14:49:43,346 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLInpaintPipeline task=DiffusersTaskType.INPAINTING batch=1/1x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 7.0, 'num_inference_steps': 50, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_start': None, 'denoising_end': None, 'output_type': 'latent', 'image': [<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1F2250D4BB0>], 'mask_image': <PIL.Image.Image image mode=L size=1024x1024 at 0x1F2250D5630>, 'strength': 0.4, 'height': 1024, 'width': 1024, 'parser': 'Full parser'}
2024-05-30 14:50:00,494 | sd | DEBUG | launch | Server: alive=True jobs=1 requests=987 uptime=11560 memory=9.67/31.12 backend=Backend.DIFFUSERS state=idle
2024-05-30 14:50:26,416 | sd | INFO | devices | High memory utilization: GPU=93% RAM=31% {'ram': {'used': 9.64, 'total': 31.12}, 'gpu': {'used': 22.27, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:50:26,853 | sd | DEBUG | devices | GC: collected=263 device=cuda {'ram': {'used': 6.88, 'total': 31.12}, 'gpu': {'used': 7.44, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.44
2024-05-30 14:50:32,365 | sd | DEBUG | processing_helpers | Applying color correction: correction=(1024, 1024, 3) image=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1F2250D4550>
2024-05-30 14:50:33,341 | sd | INFO | devices | High memory utilization: GPU=100% RAM=58% {'ram': {'used': 18.0, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:50:34,308 | sd | DEBUG | devices | GC: collected=127 device=cuda {'ram': {'used': 7.0, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.97
2024-05-30 14:50:34,310 | sd | INFO | processing | Processed: images=1 time=51.96 its=0.38 memory={'ram': {'used': 7.0, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:50:34,379 | sd | INFO | images | Save: image="outputs\text\2024-05-30\00244-autismmixSDXL_autismmixConfetti-score 9 score 8 up score 7 up.jpg" type=JPEG resolution=1024x1024 size=192717
2024-05-30 14:50:34,428 | sd | DEBUG | sd_models | Pipeline class change: original=StableDiffusionXLInpaintPipeline target=StableDiffusionXLPipeline device=cuda:0 fn=process_diffusers
2024-05-30 14:50:34,459 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLPipeline
2024-05-30 14:50:34,464 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLPipeline task=DiffusersTaskType.TEXT_2_IMAGE batch=3/4x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 6, 'num_inference_steps': 30, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_end': None, 'output_type': 'latent', 'width': 1024, 'height': 1024, 'parser': 'Full parser'}
2024-05-30 14:50:51,123 | sd | DEBUG | face-details | Face HiRes: faces=[{'score': 0.74, 'size': '147x196'}] args={'conf': 0.6, 'iou': 0.5, 'max_det': 5} denoise=0.4 blur=10 resolution=1024x1024 padding=10
2024-05-30 14:50:51,137 | sd | DEBUG | masking | Mask: size=1024x1024 masked=53374px area=0.05 auto=None blur=0.039 erode=0.01 dilate=0.0390625 type=Grayscale time=0.01
2024-05-30 14:50:51,187 | sd | INFO | devices | High memory utilization: GPU=100% RAM=63% {'ram': {'used': 19.62, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:50:51,913 | sd | DEBUG | devices | GC: collected=148 device=cuda {'ram': {'used': 7.01, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.73
2024-05-30 14:50:51,931 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLInpaintPipeline
2024-05-30 14:50:51,934 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLInpaintPipeline task=DiffusersTaskType.INPAINTING batch=1/1x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 7.0, 'num_inference_steps': 50, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_start': None, 'denoising_end': None, 'output_type': 'latent', 'image': [<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1F2250D5C60>], 'mask_image': <PIL.Image.Image image mode=L size=1024x1024 at 0x1F2250D6CB0>, 'strength': 0.4, 'height': 1024, 'width': 1024, 'parser': 'Full parser'}
2024-05-30 14:51:34,491 | sd | INFO | devices | High memory utilization: GPU=93% RAM=30% {'ram': {'used': 9.42, 'total': 31.12}, 'gpu': {'used': 22.25, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:51:34,922 | sd | DEBUG | devices | GC: collected=263 device=cuda {'ram': {'used': 6.8, 'total': 31.12}, 'gpu': {'used': 7.44, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.43
2024-05-30 14:51:40,046 | sd | DEBUG | processing_helpers | Applying color correction: correction=(1024, 1024, 3) image=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1F2250D66B0>
2024-05-30 14:51:40,795 | sd | INFO | devices | High memory utilization: GPU=100% RAM=57% {'ram': {'used': 17.79, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:51:41,463 | sd | DEBUG | devices | GC: collected=127 device=cuda {'ram': {'used': 6.92, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.67
2024-05-30 14:51:41,464 | sd | INFO | processing | Processed: images=1 time=50.34 its=0.40 memory={'ram': {'used': 6.92, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:51:41,505 | sd | INFO | images | Save: image="outputs\text\2024-05-30\00245-autismmixSDXL_autismmixConfetti-score 9 score 8 up score 7 up.jpg" type=JPEG resolution=1024x1024 size=190751
2024-05-30 14:51:41,546 | sd | DEBUG | sd_models | Pipeline class change: original=StableDiffusionXLInpaintPipeline target=StableDiffusionXLPipeline device=cuda:0 fn=process_diffusers
2024-05-30 14:51:41,569 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLPipeline
2024-05-30 14:51:41,573 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLPipeline task=DiffusersTaskType.TEXT_2_IMAGE batch=4/4x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 6, 'num_inference_steps': 30, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_end': None, 'output_type': 'latent', 'width': 1024, 'height': 1024, 'parser': 'Full parser'}
2024-05-30 14:51:57,795 | sd | DEBUG | face-details | Face HiRes: faces=[{'score': 0.68, 'size': '183x226'}] args={'conf': 0.6, 'iou': 0.5, 'max_det': 5} denoise=0.4 blur=10 resolution=1024x1024 padding=10
2024-05-30 14:51:57,810 | sd | DEBUG | masking | Mask: size=1024x1024 masked=70078px area=0.07 auto=None blur=0.039 erode=0.01 dilate=0.0390625 type=Grayscale time=0.01
2024-05-30 14:51:57,860 | sd | INFO | devices | High memory utilization: GPU=100% RAM=63% {'ram': {'used': 19.54, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:51:58,608 | sd | DEBUG | devices | GC: collected=148 device=cuda {'ram': {'used': 6.93, 'total': 31.12}, 'gpu': {'used': 7.54, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.75
2024-05-30 14:51:58,636 | sd | INFO | processing_diffusers | Base: class=StableDiffusionXLInpaintPipeline
2024-05-30 14:51:58,641 | sd | DEBUG | processing_args | Diffuser pipeline: StableDiffusionXLInpaintPipeline task=DiffusersTaskType.INPAINTING batch=1/1x1 set={'prompt_embeds': torch.Size([1, 77, 2048]), 'pooled_prompt_embeds': torch.Size([1, 1280]), 'negative_prompt_embeds': torch.Size([1, 77, 2048]), 'negative_pooled_prompt_embeds': torch.Size([1, 1280]), 'guidance_scale': 7.0, 'num_inference_steps': 50, 'eta': 1.0, 'guidance_rescale': 0.7, 'denoising_start': None, 'denoising_end': None, 'output_type': 'latent', 'image': [<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1F2250D6140>], 'mask_image': <PIL.Image.Image image mode=L size=1024x1024 at 0x1F2250D5570>, 'strength': 0.4, 'height': 1024, 'width': 1024, 'parser': 'Full parser'}
2024-05-30 14:51:59,632 | sd | DEBUG | launch | Server: alive=True jobs=1 requests=987 uptime=11679 memory=8.21/31.12 backend=Backend.DIFFUSERS state=idle
2024-05-30 14:52:41,183 | sd | INFO | devices | High memory utilization: GPU=93% RAM=30% {'ram': {'used': 9.43, 'total': 31.12}, 'gpu': {'used': 22.26, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:52:41,615 | sd | DEBUG | devices | GC: collected=263 device=cuda {'ram': {'used': 6.82, 'total': 31.12}, 'gpu': {'used': 7.43, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.43
2024-05-30 14:52:46,669 | sd | DEBUG | processing_helpers | Applying color correction: correction=(1024, 1024, 3) image=<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1F2250D5630>
2024-05-30 14:52:47,199 | sd | INFO | devices | High memory utilization: GPU=100% RAM=57% {'ram': {'used': 17.81, 'total': 31.12}, 'gpu': {'used': 23.98, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:52:47,879 | sd | DEBUG | devices | GC: collected=127 device=cuda {'ram': {'used': 6.93, 'total': 31.12}, 'gpu': {'used': 7.55, 'total': 23.98}, 'retries': 0, 'oom': 0} time=0.68
2024-05-30 14:52:47,881 | sd | INFO | processing | Processed: images=1 time=50.08 its=0.40 memory={'ram': {'used': 6.93, 'total': 31.12}, 'gpu': {'used': 7.55, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:52:47,920 | sd | INFO | images | Save: image="outputs\text\2024-05-30\00246-autismmixSDXL_autismmixConfetti-score 9 score 8 up score 7 up.jpg" type=JPEG resolution=1024x1024 size=185323
2024-05-30 14:52:47,922 | sd | INFO | processing | Processed: images=4 time=240.05 its=0.50 memory={'ram': {'used': 6.91, 'total': 31.12}, 'gpu': {'used': 7.55, 'total': 23.98}, 'retries': 0, 'oom': 0}
2024-05-30 14:52:47,946 | sd | INFO | images | Save: image="outputs\grids\2024-05-30\00023-autismmixSDXL_autismmixConfetti-score 9 score 8 up score 7 up-grid.jpg" type=JPEG resolution=2048x2048 size=733232

Backend

Diffusers

Branch

Master

Model

SD-XL

Acknowledgements

vladmandic commented 4 months ago

we cannot address multiple issues in a single ticket - every issue should be a separate ticket. i understand that is overhead for you to report, but think of people trying to help and resolve the issues - its impossible to work on completely unrelated issues in a single ticket.

i'm going to redesignate this ticket to handle modernui scaling issue.

the rest is about performance - and from what i can tell, it comes down to low vram causing swapping. default settings change and by default sdnext is tuned for performance and that means intentionally not moving things in and out of vram. if you want to do things at higher resolution or higher batches, you need to enable memory savings options such as medvram or vae slicing and tiling or ...

GriZen83 commented 4 months ago

Very well, Thank you for the help.

vladmandic commented 3 months ago

closing in favor of https://github.com/BinaryQuantumSoul/sdnext-modernui/issues/73