AUTOMATIC1111 / stable-diffusion-webui

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

Laggy webui in img2img tab in browser, local and gradio - Seems to correlate with new color-sketch img2img editor #1750

Closed Flonixcorn closed 1 year ago

Flonixcorn commented 1 year ago

In the img2img tab since the new update it is very laggy when typing prompts and drawing a inpainting mask.

Make some images in txt2img, send them to img2img, do some inpainting etc get back, create some more imgs via txt then send to img2img and its getting laggy

Does this on all browser, gradio online and offline, precision mode etc all off Commit hash: 67d011b02eddc20202b654dfea56528de3d5edf7obtained manually by running git rev-parse HEAD]

junguler commented 1 year ago

same here, just git pulled the last 3 commits upto 1009 and now it's insanely laggy

JackWH commented 1 year ago

The lagginess begins after completing a generation once the preview image(s) appear in the UI. Lagginess gets noticeably worse with larger batch sizes, to the point the UI is completely unresponsive in batches of 10+.

In earlier commits the preview pane would empty out when running a new batch, which would instantly restore full performance until the current batch finished loading and appeared onscreen.

dfaker commented 1 year ago

Always nice when one's own commits pop up.

In the img2img tab since the new update it is very laggy when typing prompts and drawing a inpainting mask.

Make some images in txt2img, send them to img2img, do some inpainting etc get back, create some more imgs via txt then send to img2img and its getting laggy

Just put some logging on the title checks and sets and it's only firing when you're getting each individual progress reports back from the server, and specifically only updating it on change, silent when you're not actively generating.

Can we confirm the OS and a couple of the browsers by name and I'll check those directly.

dfaker commented 1 year ago

Just offered a PR #1764 to optionally enable the title updates, as someone else said they had tooling that depended on the title being constant, but in that I profiled a few runs with in on and off after a few back and forths on img2img:

Title progress On Title progress Off
Time taken: 49.11s Time taken: 49.08s
Time taken: 49.11s Time taken: 49.41s
Time taken: 49.34s Time taken: 48.95s
Time taken: 49.33s Time taken: 49.34s

So not convinced this has a measurable effect unless this turns out to be restricted to certain mobile devices.

dfaker commented 1 year ago

Do we want to try running with:

--gradio-img2img-tool=editor

To see if going back to the old img2img cropping editor, rather than the drawing tool helps?

midihex commented 1 year ago

Win 10, Chrome & Edge Generate an image, send to inpaint is fine without and with --gradio-img2img-tool=editor Generate an image send to img2img is fine with --gradio-img2img-tool=editor but Generate an image send to img2img without --gradio-img2img-tool=editor grinds the img2img/inpaint pages to almost a halt. Only noticed this from today.

ProGamerGov commented 1 year ago

This issue seems to be related: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/1722