Skip to content

input release dispatcher#8785

Closed
anapnoe wants to merge 3 commits into
AUTOMATIC1111:masterfrom
anapnoe:input-release-dispatcher
Closed

input release dispatcher#8785
anapnoe wants to merge 3 commits into
AUTOMATIC1111:masterfrom
anapnoe:input-release-dispatcher

Conversation

@anapnoe

@anapnoe anapnoe commented Mar 21, 2023

Copy link
Copy Markdown

This PR is a universal fix for all input number fields and sliders of the UI including scripts and extensions to dispatch the change event on release of current action thus gaining better user experience, responsiveness and performance. It is optimized to work with total of 5 extra event listeners for all sliders and numeric input fields, achieving low overhead and minimum memory impact noted that gradio's current solution version 3.22 uses 3 extra event listeners for each slider without addressing the numeric input fields at all
you don't need to modify any of the source py files for this to work you can enable it or disable it globally through options

gradio-app/gradio#3204

slider_proto.mp4

Environment this was tested in

  • OS: [Windows]
  • Browser: [chrome, Firefox]

@anapnoe anapnoe requested a review from AUTOMATIC1111 as a code owner March 21, 2023 14:32
@AUTOMATIC1111

Copy link
Copy Markdown
Owner

Well, I did upgrade to the last gradio, so this would probably need to be reworked a bit to support it. Gradio did add a release event, but it does not fire on changes from the number edit, which makes it not useful.

Since this is a fix to one function, I'd like it to sit in a separate .js file named appropriately. You can use onUiLoaded callback for the code that needs to be executed once after the app is loaded.

@anapnoe anapnoe deleted the input-release-dispatcher branch April 29, 2023 16:47
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.

2 participants