Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI/Web: Reduce animation of default --progress_bars setting to improve speed #1613

Merged
merged 1 commit into from
Jul 1, 2023

Conversation

one-lithe-rune
Copy link
Contributor

@one-lithe-rune one-lithe-rune commented Jul 1, 2023

Addresses #1457

Motivation

There is small but noticeable difference in generation speed between running with the UI minimized and with it not, in favor of the minimized case. This is also seen if you size the app or browser window such that the gallery showing generated images is outside the browser viewport.

In addition, currently the no-progress_bars command-line option doesn't appear to improve speed after the first image in the batch, I'm guess something changed with the upgrade to gradio 3.34.0 there.

All these looks like they are being caused by the two CSS animations that are run by gradio during generation, the 'sweep across the gallery' animation you get during the first image generation of a batch, and the 'pulsing border' animation you get on both the gallery and the generation status text box. This latter one happens even when you have --no-progress_bars set.

Code Changes

  • Use the "minimal" setting for show_progress in gradio functions when the (currently default) --progress_bars option is set. This removes the 'sweep across the gallery' animation. You still get the textual progress indicator in the top right corner of the gallery.
  • Remove the pulsation animation from the border of galleries and generation status textboxes for both --progress_bars and --no_progress_bars settings. The orange color is retained.

Measured Generation Speed Changes

All these are using the same prompt and other settings from the UI using SharkEulerDiscrete, on an SD 1.5 based model, ui=web, Firefox browser on Windows 10:

Txt2Imge without changes:

h768 x w512 (--progress_bar)
50it [00:04, 10.02it/s]
50it [00:04, 10.03it/s]
50it [00:04, 10.01it/s]
50it [00:04, 10.02it/s]
50it [00:04, 10.01it/s]
50it [00:05,  9.97it/s]

h768 x w512 (--no-progress_bar)
50it [00:04, 10.34it/s]
50it [00:05,  9.98it/s]
50it [00:05,  9.95it/s]
50it [00:05,  9.93it/s]
50it [00:05,  9.96it/s]
50it [00:05,  9.93it/s]

Txt2Img with changes:

h768 x w512 (--progress_bar)

50it [00:04, 10.28it/s]
50it [00:04, 10.31it/s]
50it [00:04, 10.31it/s]
50it [00:04, 10.30it/s]
50it [00:04, 10.31it/s]
50it [00:04, 10.32it/s]

h768 x w512 (--no-progress_bar)

50it [00:04, 10.28it/s]
50it [00:04, 10.29it/s]
50it [00:04, 10.27it/s]
50it [00:04, 10.26it/s]
50it [00:04, 10.27it/s]
50it [00:04, 10.29it/s]

* uses the "minimal" setting for show_progress in gradio functions when
the (currently default) --progress_bars option is set. This removes the
'sweep across the gallery' animation.
* removes the pulsation animation from the border of galleries and
generation status textboxes for both --progress_bars and
no_progress_bars settings. The orange color is retained.
* removing these animations gives a small bump to generation speed
@powderluv powderluv merged commit 7392b22 into nod-ai:main Jul 1, 2023
@one-lithe-rune one-lithe-rune deleted the ui_lighter_progress_bars branch July 1, 2023 04:30
@NeedsMoar
Copy link

It is in fact consistent now (I'd not tested in a while). I reverted to an older driver version so I could get tuned numbers.

--no-progress_bar
h768 x w512
60it [00:04, 13.05it/s]
60it [00:04, 13.19it/s]
60it [00:04, 13.14it/s]
60it [00:04, 13.19it/s]
60it [00:04, 12.95it/s]
60it [00:04, 13.11it/s]

Default (--progress_bar, I think)
60it [00:04, 13.21it/s]
60it [00:04, 13.07it/s]
60it [00:04, 13.17it/s]
60it [00:04, 13.20it/s]
60it [00:04, 13.22it/s]
60it [00:04, 13.24it/s]

Although the progress bars don't actually show up anywhere either way (haven't for a while) so I'm not sure what the flag does anymore. I believe this model is sd1.4 based but other than that there isn't much difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants