Coder Social home page Coder Social logo

Comments (5)

Zyin055 avatar Zyin055 commented on July 23, 2024

Likely won't happen.

Components do not have any association with other components other than their ID name. Even if we did manually create a grouping to make sets of components, this type of sorted layout in the GUI would require a bunch of work to get it working with the way Config Presets currently handles custom fields.

from config-presets.

Symbiomatrix avatar Symbiomatrix commented on July 23, 2024

A visual separation doesn't seem too difficult to achieve, fields_checkboxgroup is fairly standalone and might be rendered in a loop by grouping extension ids from the base list (the naming scheme is fairly reliable at least in the major ones).
What I think might pose a problem is components affecting other components; not sure gradio supports this natively, had to use tabs in the past, Vlad's added some hide / unhide thing in recent versions, but I suspect it's some js hackery. Perhaps instead, if the group checkbox is unchecked then all children values are simply ignored without changing the check values themselves.

from config-presets.

marcsyp avatar marcsyp commented on July 23, 2024

@Symbiomatrix not sure if this is still on your radar but I still yearn for this functionality fairly regularly -- did you do any exploration on this? Thanks!

from config-presets.

enternalsaga avatar enternalsaga commented on July 23, 2024

or just a master checkbox to toggle all checkboxes? Im tired turning off check boxes when my need is only few components among dozens I've produced. Any thought? Thanks.

from config-presets.

Symbiomatrix avatar Symbiomatrix commented on July 23, 2024

@marcsyp Sorry, never check notifications.
What zyin said way back still holds true - getting a high level of polish on the particular layout and functionality you propose is a lot of gui work, and I daresay for a relatively esoteric QOL improvement. Adding js to the mix further complicates things (and I know too little js to predict what may arise or how to do it).
A patchwork solution can be achieved with relative ease: as I'd suggested, creating group level checkboxes, dumping them together before all the component checkboxes, then using a group-components relation to ignore all the unchecked groups when saving.

  • First, you add another set of checkboxes for the groups, similar to fields_checkboxgroup ; only difference is changing component_ids to a list containing the group checkboxes' displayed names.
    fields_checkboxgroup = gr.CheckboxGroup(choices=component_ids,
  • The group needs to be rendered above fields over here.
    fields_checkboxgroup.render()
  • Add the new set of checkboxes as an input parameter to the save_config bit.
    [save_textbox] + [fields_checkboxgroup] + [component_map[comp_name] for comp_name in
  • Add the new parameter to the function signature (actually the func within save, it's just a wrapper for customising func).
    def func(new_setting_name, fields_to_save_list, *new_setting):
  • Add a "if group checkbox is off then continue" condition to this portion of the saving to ignore unchecked groups. A simple hardcoded dictionary in the early parts of the program will serve nicely, eg DGROUPS = {"gen_params": ["txt2img_sampling", "txt2imgsteps" ...], "controlnet-0":[... , or one could get fancy and assign to it all components whose name is similar (eg "controlnet-0":[comp for comp in self.txt2img_component_ids if "ControlNet-0" in comp]).
    if component_id not in fields_to_save_list:

from config-presets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.