sd-library-notes icon indicating copy to clipboard operation
sd-library-notes copied to clipboard

Refresh button

Open arcum42 opened this issue 2 years ago • 3 comments

It's already in the todo list, but we should probably have issues for things in the to do list, and this is one of the more urgent ones.

If you do: from modules.ui_components import ToolButton

you'll be able to use the tool buttons the main ui uses, then you can do something like: embedding_refresh_button = ToolButton(value=refresh_symbol, elem_id="embedding_refresh_button")

next to each pulldown to add a refresh button that looks like the one by the models.

Then we can do something like: embedding_refresh_button.click(fn=self.reload, inputs=[], outputs=[])

to link it up, though you'd obviously need some sort of reload function, either one that reloads all the pulldowns, or one for each pulldown. I think we'd need to actually delete everything out of the pulldowns and readd them, too, in case any files got renamed or deleted...

arcum42 avatar Mar 09 '23 23:03 arcum42

(And yes, I basically got partway through implementing it, then realised I wasn't sure how to delete things from pulldowns, took a break, and haven't been back to it...)

arcum42 avatar Mar 09 '23 23:03 arcum42

Thanks for creating these issues. I've had a couple goes at trying to implement this but I keep running into an issue with updating the elements. Admittedly I haven't put a TON of effort into it, but I'm still learning my way around gradio.

I agree on refreshing because of changes, I think the overhead of rebuilding the list from scratch is low enough that we could just delete the list and build it again from scratch on each refresh.

Zetaphor avatar Mar 10 '23 19:03 Zetaphor

@Zetaphor No problem. This extension is something I've felt was needed anyways, and I'd be thinking about and possibly working on trying to do something similar otherwise. It's a lot easier to make suggestions and occasionally create prs here, though.

I was tending towards one refresh function for that reason...

And yeah, don't really know my way around gradio either, I was mostly poking around the extension code in auto1111 to get an idea of what could be done.

arcum42 avatar Mar 11 '23 06:03 arcum42