Coder Social home page Coder Social logo

config-presets's Introduction

What does this do?

This Automatic1111 extension adds a configurable dropdown to allow you to change settings in the txt2img and img2img tabs of the Web UI.

This allows you to do things like swap from low quality rendering settings to high quality. Or apply hires settings that uses your favorite anime upscaler. Or set image dimensions to make a wallpaper. You can even use it to set custom script fields like XYZ plot values or ControlNet values.

Works with stable-diffusion-webui-forge. Untested with SD.Next.

Updating from A1111 1.8.0 to 1.9.0

A1111 1.9.0 added a new "Schedule type" dropdown next to the "Sampling method" dropdown which splits off the scheduler from the sampler. This means that all of your config presets that have a saved sampler needs to be renamed/fixed to remove the scheduler text at the end. For example, if you have txt2img_sampling set to "DPM++ 2M Karras", it now needs to be set to "DPM++ 2M" with the new txt2img_scheduler dropdown set to "Karras". You can do this by manually editing your config-txt2img.txt and config-img2img.txt files at /extensions/Config-Presets, or by deleting the bad presets in the web UI and remaking them.

If you get a AssertionError: bad sampler name this is why. You need to fix your sampler names to match the new naming convention in A1111 1.9.0.

Screenshots

The new dropdown in the image gallery.

gallery

Dropdown values (configurable), select one and the generation settings values will be applied to the Web UI.

dropdown

Clicking the add/remove [๐Ÿ–Œ๏ธ] button lets you create and delete custom presets of settings currently in the Web UI. Custom fields added by other scripts/extensions can also be used by clicking the [๐Ÿ“‚ Add custom fields...] button. Each button has tooltips to help you.

addremove

Screenshot of config-txt2img.json, which can be opened with the open config file [๐Ÿ“‚] button. You can use this if you want manual control while editing your presets. If you decide to edit the config this way, you can use the refresh [๐Ÿ”„] button. config-img2img.json also exists for the img2img tab.

config

Installation

Easy way

  • In your Automatic1111 Web UI, go to the Extensions tab > Install from URL > URL for extension's git repository: https://github.com/Zyin055/Config-Presets
  • Click the Install button

Manually

  • git clone this repo to the extensions folder in your Web UI installation

Known issues

  • Unable to save fields in the quick access area at the top of the page (checkpoint, vae, clip skip, etc)
  • Unable to save multi-select fields, such as the XYZ script's checkpoint name and sampler fields

Changelog

Click to view Changelog

4/14/2024

  • Fixed backwards compatibility issue introduced in yesterdays update.

4/13/2024

  • Updated for Automatic1111 v1.9.0
  • There is a new "Schedule type" dropdown next to the "Sampling method" dropdown which splits off the scheduler from the sampler. This means that all of your config presets that have a saved sampler needs to be renamed/fixed to remove the scheduler text at the end. For example, if you have txt2img_sampling set to "DPM++ 2M Karras", it now needs to be set to "DPM++ 2M" with the new txt2img_scheduler dropdown set to "Karras". You can do this by manually editing your config-txt2img.txt and config-img2img.txt files at /extensions/Config-Presets, or by deleting the bad presets in the web UI and remaking them.

4/02/2024

  • Improved error handling when the config files are edited manually

3/28/2024

  • Made the buttons smaller, fixes cosmetic alignment issue
  • Added a refresh button to reload the config file from disk, useful if you edit the config text file manually
  • Updated default config presets

2/05/2024

  • Fixed an error when saving the hires fix sampler dropdown field (hr_sampler) and selecting the value "Use same sampler"

11/18/2023

  • Fixed an issue when saving a dropdown field in Web UI versions before 1.6.0

9/16/2023

  • Added a Reapply button

9/04/2023

  • Fixed config presets that used radio button components not working

8/31/2023

  • Updated for Automatic1111 v1.6.0
  • Added support for "Refiner" (txt2img_enable-checkbox) and "Switch at" (txt2img_switch_at) components for txt2img and img2img, which are used for SDXL Refiner models. The refiner checkpoint component is not supported.

5/15/2023

  • The UI no longer needs to be reloaded when creating a new config preset

4/29/2023

  • Updated for the March 29th Automatic1111 version which uses Gradio 3.23
  • Added the ability to add almost any field on the UI to a config preset with the "Add tracked fields..." button

3/06/2023

  • Added the ability to select which fields are saved when creating a new config preset (before, this could have been done manually by editing the .json config file)
  • Moved some buttons around in the UI for creating a new config preset
  • Added Hires Upscaler (txt2img_hr_upscaler), Upscale by (txt2img_hr_scale), and Restore Faces (txt2img_restore_faces) as eligible fields to be used in a config preset
  • Tweaked default config preset values created during installation
  • Removed "Default" preset since it doesn't work with new system that lets you ignore fields

2/10/2023

  • Manually removing a preset value in the config file will make that value be ignored

2/09/2023

  • Added 768x768, 1080p, 1440p, and 4k presets for txt2img (they won't show up for existing installations, you'd need to delete your config-txt2img.json file to have it recreated with the new presets)

1/02/2023

  • Your custom presets will be wiped, you will need to remake any saved custom presets because of changes made in Automatic1111
  • The Config Presets dropdown in the txt2img and img2img tabs now use separate config files and thus have separate presets
  • Saving a new preset now requires a Web UI restart (done automatically)
  • Added support for the Sampler method turning from a checkbox into a dropdown
  • Added support for the removal of Firstpass width/height being replaced by Upscale by

12/21/2022

  • Added the "Add/Remove..." button to create and delete config presets within the Web UI

12/19/2022

  • config.json will be created on first startup, user edits will not be overwritten when updating the extension after updating to this version

12/15/2022

  • Fix for installation error on linux

12/13/2022

  • config.json was tweaked, added Firstpass width and Firstpass height
  • Better support for img2img tab compatibility

12/12/2022

  • Initial Release

config-presets's People

Contributors

gerschel avatar mark-greenbook avatar nykwil avatar s-del avatar symbiomatrix avatar wywywywy avatar zyin055 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

config-presets's Issues

[Bug] A1111`s webui dev launch error

[ERROR][Config Presets] The txt2img component 'txt2img_restore_faces' could not be processed. This may be because you are running an outdated version of the Config-Presets extension, or you included a component ID in the custom tracked components config file that does not exist, no longer exists (if you updated an extension), or is an invalid component (if this is the case, you need to manually edit the config file at J:\SDWebUI\extensions\Config-Presets\config-txt2img-custom-tracked-components.txt or just delete it so it resets to defaults). This extension will not work until this issue is resolved.

[ERROR][Config Presets] The img2img component 'img2img_restore_faces' could not be processed. This may be because you are running an outdated version of the Config-Presets extension, or you included a component ID in the custom tracked components config file that does not exist, no longer exists (if you updated an extension), or is an invalid component (if this is the case, you need to manually edit the config file at J:\SDWebUI\extensions\Config-Presets\config-img2img-custom-tracked-components.txt or just delete it so it resets to defaults). This extension will not work until this issue is resolved.

deleting the settings txt doesn't work

Feature request: allow customisable component IDs

Currently, the list of component IDs that this extension can control is hardcoded in the script.

This should be made into a config file, so users can customise what they want to store, such as parameters of extensions.

This will also satisfy issues #31 #32 (but maybe not #28 & #29 because they are more complicated).

Save Script name instead of index

Hi there -- great work on this plugin, I believe it is absolutely essential for any serious workflow with A1111. Only one thing persistently gives me headaches, and that is that the script list is stored as an index value, which easily changes whenever you add or remove plugins, or revert to older configurations of A1111, etc. This results in exceptions or the wrong script being selected, which is a dealbreaker for workflow.

It would be great if the script could be stored as a string field with the script's name (as these do not change often if at all), which would be used to search the existing installed scripts and select the first instance of the script with the stored name that is found. If the name is not found, it would fail gracefully. This would prevent problems with name collisions (if that's even possible) and with missing scripts due to configuration (although the plugin won't load properly if the script is missing and being tracked, which is a separate issue).

The logic should include a fallback for older configuration files that are still using index values, a simple test for an int should suffice, otherwise the string logic is used. For upgrading purposes, it could be as simple as loading in a known good configuration where all configurations are loading properly, and then rewriting the configurations one by one to update to the string field. An Update all button would be great which performs a search and replace, although diligent users can search and replace themselves in a text editor.

Any thoughts? I'm not as familiar with the backend code to know whether there are any obstacles to implementing this, but I think it would provide a much improved and more stable experience. thx

[Bug]: Selecting a style with prompt longer than 75 characters results in RuntimeError: The expanded size of the tensor (77) must match the existing size (154) at non-singleton dimension 0. Target sizes: [77, 768]. Tensor sizes: [154, 768]

Selecting a Style that has either a positive or negative prompt longer than 75 characters results in the following error:
RuntimeError: The expanded size of the tensor (77) must match the existing size (154) at non-singleton dimension 0. Target sizes: [77, 768]. Tensor sizes: [154, 768]

image

As a workaround, you have to click the Apply select styles to the prompt button

This only happens if you load a Config Preset first. If you don't load a Config Preset, the Style will work as expected.

aDetailer Section Now Broken - Extension Load Fails

I've just loaded the LATEST version of this extension on the LATEST version of Automatic1111 and the extensions refuses to load up on restart. The message in the console is:

[ERROR][Config Presets] The txt2img component 'script_txt2img_adetailer_ad_inpaint_full_res' could not be processed. This may be because you are running an outdated version of the Config-Presets extension, you included a component ID in the custom tracked components config file that does not exist, it no longer exists (if you updated an extension or Automatic1111), or is an invalid component (if this is the case, you need to manually edit the config file at C:\AI\stable-diffusion-webui\extensions\Config-Presets\config-txt2img-custom-tracked-components.txt or just delete it so it resets to defaults). This extension will not work until this issue is resolved.

It seems to be caused by the aDetailer Section on these entries:

script_txt2img_adetailer_ad_inpaint_full_res
script_txt2img_adetailer_ad_inpaint_full_res_padding
script_txt2img_adetailer_ad_inpaint_full_res_2nd
script_txt2img_adetailer_ad_inpaint_full_res_padding_2nd

Is this a known problem??

compatibility issue with new web ui?

when boot on the newest webui

[ERROR][Config-Presets] The component 'txt2img_height' no longer exists in the Web UI. Try updating the Config-Presets extension. This extension will not work until this issue is resolved.
[ERROR][Config-Presets] The component 'img2img_steps' no longer exists in the Web UI. Try updating the Config-Presets extension. This extension will not work until this issue is resolved.

Feature: txt2img_hr_resize_x and txt2img_hr_resize_y

Could you extend list of saved/restored options with txt2img_hr_resize_x and txt2img_hr_resize_y.

The patch is:

diff --git a/scripts/config_presets.py b/scripts/config_presets.py
index c4df7cc..162ac84 100644
--- a/scripts/config_presets.py
+++ b/scripts/config_presets.py
@@ -350,6 +350,8 @@ class Script(scripts.Script):
             "txt2img_restore_faces",
             "txt2img_enable_hr",
             "txt2img_hr_scale",
+            "txt2img_hr_resize_x",
+            "txt2img_hr_resize_y",
             "txt2img_hr_upscaler",
             "txt2img_hires_steps",
             "txt2img_denoising_strength",

Type hints TypeError

def load_txt2img_custom_tracked_component_ids() -> list[str]: TypeError: 'type' object is not subscriptable
i can't create a pull request.
from typing import List and change list[str] to List[str]

Issues with setting ControlNet components using ConfigPresets (see issue on CN repo)

Hi all,

Don't know if any of you have encountered this, but ConfigPresets and ControlNet do not play 100% nice together. After setting the ControlNet components with ConfigPresets, everything works perfectly, but only with a workaround (Check and recheck the Pixel Perfect checkbox) due to some of the change listener behavior on ControlNet's components. I recently logged an issue in the ControlNet repo to see if it was something they could fix, and they said no, not for now at least.

Curious to hear your thoughts whether there's anything we could do on the ConfigPresets side, maybe we could collaborate to support ControlNet specifically, since it is one of A1111's most powerful features.

Let me know what you think, here is the issue with all the details:
Mikubill/sd-webui-controlnet#1297

[Feature Request] ControlNet Support

It would be great if ControlNet support was added. So I can easily save ControlNet's preprocessor, model, weight, Ending Control Step. I tried following the instructions to create the custom entries, but failed. Thank you!

SD.Next Second Pass change fixes.

Edit the file automatic\extensions\Config-Presets\scripts\config_presets.py

Hit Ctrl+F and find self.txt2img_component_ids

Change
txt2img_hr_upscaler to txt2img_sampling_alt
and
txt2img_hires_steps to txt2img_steps_alt

FEATURE REQUEST: Checkbox groups

With my list of tracked elements growing very large, it has inspried me to request a new feature to make selecting which elements to store in any configuration much easier and far less painful. This would require a bit of UI work, here is an example of what I'm thinking:

CP-UI-proposal copy

Unchecking the main group header would enable/disable all the checkmarks for that group. Otherwise, you have to comb through dozens of checkmarks and disable a lot of things, for instance, if you want to save gen params but no control net, or vice versa. Thoughts?

Save causes error.

Anybody know how to avoid this error? On latest webui version. Is there a conflict?

[Config-Presets] Changed to: SDXL --- 1024x1024
Traceback (most recent call last):
File "D:\auto1111 SDXL\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "D:\auto1111 SDXL\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "D:\auto1111 SDXL\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\auto1111 SDXL\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\auto1111 SDXL\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "D:\auto1111 SDXL\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "D:\auto1111 SDXL\stable-diffusion-webui\extensions\Config-Presets\scripts\config_presets.py", line 1138, in func
new_setting_map[component_id] = modules.sd_samplers.samplers_map[new_value.lower()]
AttributeError: 'int' object has no attribute 'lower'

Face Restore Option

Hi!
Would it be possible to add option to activate "Restore faces" on txt2img and img2img ?
That would be almost full set of preset settings and just great.

Thanks for your work.

Config Preset UI no longer visible in SD.Next

The latest commit of SD.Next makes Config Preset's UI no longer visible under the image previewer.

Apparently the cause of this is being anchored to the row of buttons that display after an image is generated (Show, Save, Zip, Delete, etc).

These buttons aren't displayed until an image is generated.

Suggest anchoring elsewhere.

Feature request: Save the Highres Fix width and height

Thanks for this extension, certainly something I was looking for.

It'd be awesome if it was possible to save the width and height listed under Highres Fix, currently it's only possible to save the Upscale ratio but in my use case I would prefer to use the width and height instead as the ratio doesn't get me to the exact dimensions I need.

image

Presets for XYZ-plot don't work

I have presets for XYZ-plot with samplers and steps. It worked correctly.
In the actual version of WebUI this extension does not work correctly: fields X/Y/Z type is filled via presets, but X/Y/Z values not filling and are kept empty. No any error message in the console.

โ€ข version: v1.3.2
โ€ข python: 3.10.6
โ€ข torch: 2.0.1+cu118
โ€ข xformers: N/A
โ€ข gradio: 3.32.0
โ€ข checkpoint: 099e07547a
โ€ข Config-Presets f91c65b

Prompt and Negative Prompt

I think being able to put prompt and negative prompt to the config preset would be helpful as some checkpoint models actually require you to enter specific positive or negative prompts to make it work correctly.

https://civitai.com/models/1250/the-simpsons this one for example needs "asim style" for the prompt to make it work.

I don't know about anyone else, but I definitely struggle with remembering all the quirks of some of the models I have and this feature would save lot of looking stuff up when I could just have it in a preset already for me.

And I think it would also enhance this suggestion: #4
Although I'm fine without it autoswitching the models, I can do that myself and just name the preset after the model I should be using for each preset

Save Upscaler Value

Hello there,

I was wondering if it would be at all possible to add the option to save the Upscaler that is selected.
Having read some of the other requests noted below I appreciate that you are reluctant to add additional items, but I thought it would be worth asking anyway.

Thank you.

Add/Remove button in txt2img stopped working

First of all, THANK YOU for this plugin. It is absolutely essential for any kind of reasonable workflow for complex projects. I have been setting up custom tracked elements with great success and using it religiously on a big project.

I am currently futzing around with a new custom script but it doesn't interact with the html in any way and is an img2img script. Today, I tried to add a txt2img preset for the first time since updating with the latest code from two days ago, and nothing happens, no change to the html, no list of tracked elements, no errors in the console. Img2img UI works fine still. Any thoughts?

Thanks!

Just because I made that repo public then doesn't mean I didnt have a private one and work on this specific thing

#12

What time frame is this, two weeks ago. -> https://github.com/gradio-app/gradio/discussions/2769

updated last week -> https://gist.github.com/Gerschel/51a0e2a9089795ff399f9e346ae68085

You obviously copied my shit, you say so, just because I went from byte code to clear code in the public doesn't mean I don't have it documented that I am the developer. I have my time stamped comitts.

updating wiped my custom settings

hi,

I updated the extension today to find out it wiped all the settings i had carefully customized for my needs. That's less than convenient.

May be not updating the config.json when updating the script would be a good idea.

Not setting width/height

This is a great idea, a feature I've wanted for a while. I've installed it and so far just I'm just using the default presets. Unfortunately when I do, it does not change the output width/height (but does set the other generation params). I'm not sure what to do to make it work. I've disabled it for now but hoping for some help.

[SD.Next] 'txt2img_enable_hr' could not be processed.

I found the following error in sd.next:

[ERROR][Config Presets] The txt2img component 'txt2img_enable_hr' could not be processed. This may be because you are running an outdated version of the Config-Presets extension, or you included a component ID in the custom tracked components config file that does not exist, no longer exists (if you updated an extension), or is an invalid component (if this is the case, you need to manually edit the config file at E:\sd.next\automatic\extensions\Config-Presets\config-txt2img-custom-tracked-components.txt or just delete it so it resets to defaults). This extension will not work until this issue is resolved.

As a result config preset ui is not visible

Originally posted by @steto123 in #50 (comment)

[Bug] Extensions do not work.

I installed from the Extensions tab and got the following error, it still occurs after restarting.

Applying xformers cross attention optimization.
Model loaded.
[ERROR] Config Presets: Could not find config file at '/home/ubuntu-wsl2/git/stable-diffusion-webui/extensions/Config-Presets\config.json'. The Config Presets dropdown will not work!
Error running after_component: /home/ubuntu-wsl2/git/stable-diffusion-webui/extensions/Config-Presets/scripts/config_presets.py
Traceback (most recent call last):
  File "/home/ubuntu-wsl2/git/stable-diffusion-webui/modules/scripts.py", line 381, in after_component
    script.after_component(component, **kwargs)
  File "/home/ubuntu-wsl2/git/stable-diffusion-webui/extensions/Config-Presets/scripts/config_presets.py", line 59, in after_component
    for k in self.config_presets:
AttributeError: 'Script' object has no attribute 'config_presets'

[ERROR] Config Presets: Could not find config file at '/home/ubuntu-wsl2/git/stable-diffusion-webui/extensions/Config-Presets\config.json'. The Config Presets dropdown will not work!
Error running after_component: /home/ubuntu-wsl2/git/stable-diffusion-webui/extensions/Config-Presets/scripts/config_presets.py
Traceback (most recent call last):
  File "/home/ubuntu-wsl2/git/stable-diffusion-webui/modules/scripts.py", line 381, in after_component
    script.after_component(component, **kwargs)
  File "/home/ubuntu-wsl2/git/stable-diffusion-webui/extensions/Config-Presets/scripts/config_presets.py", line 59, in after_component
    for k in self.config_presets:
AttributeError: 'Script' object has no attribute 'config_presets'

Loaded a total of 0 textual inversion embeddings.
Embeddings:
Running on local URL:  http://127.0.0.1:7860

It is possible that other extensions are conflicting, but I am reporting it anyway. It is obvious that it is an excellent extension and we would love to use it โค.

Firstpass width and firstpass height settings may be necessary

It is known that if the aspect ratio of the original resolution and the resolution of the highres fix are aligned, it is possible to fix the highres without changing the composition.
For example, the workflow is as follows. If I get good results with 768x512, I turn on highres fix and set first pass to 768x512 and resolution to 1536x1024.

Feature Requests

The extension is working great, tyvm! I have a couple feature requests:

  1. When "default" is the currently selected config and I've manually made changes to the UI, like changing steps, it would be nice if choosing "default" again would force it back to those default settings. What I notice now is it seems to ignore the request, maybe because no actual change is being made in the UI. This may be an HTML/Gradio side issue that's not fixable directly, though an "apply" button might help.
  2. It would be nice if settings that are not present in the preset config JSON are left untouched when that preset is selected and applied. What I noticed is: I created a series of presets solely to set width, height and upscaling. I deleted unrelated settings like batch size. When I applied the preset, I noticed it reverted my batch size from "8" to "1".

[Feature Request] config.json should be ignored

In my opinion the config.json file should be added to .gitignore, so that users' changes won't be overwritten.

If needed, there can also be a config.json.example file so that users know how to configure it even if they've modified the config.json file.

Add Model option

First off, I was thinking about wanting a feature like this for a while, I'm glad you made it!

So, feature request: right now the controllable options are limited - in particular I'd love if you add an option to set the model by name.

For example, I'd want an SD 2.1 preset that instantly changes model to SD 2.1 and width/height to 768.

There's a lot of other potentially useful options worth adding as well, so I'll just reference my own Infinite-Grid extension's option list for your consideration - https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script/blob/master/scripts/infinity_grid.py#L147-L173
Feel free to use it as a reference for ideas and/or code for adding new options.

Feature request: SD upscale script (img2img)

It would be nice if the script selection and SD upscale options would be saved too. I think that would be reasonable, because its a "core"-script? I get the idea that scripts are not saved, because they are too individual. But I think the SD upscale script is the most used and it would be helpful if those settings (overlap, scale factor and upscaler) would be stored in the preset too.

[Feature Request] Refresh button

In A1111, there's a refresh button next to the Checkpoints dropdown list.

Config-Presets could implement the same UI, so that when we change the config.json, we can just click a button to reload the entries without having to restart the whole thing.

Cannot re-apply the current preset.

I've been using this ext for a while and I really like it!
However, here's the thing: if i want to change the preset, it's ok. But if I want to use the preset which is already there (the one showing in the box), it does not apply to my WebUI.
I dont know if this is a bug or not. Sometimes I changed some settings in my WebUI and then I want to use the preset I usually use. So I have to change to another preset then change it back. Because if you see a preset shown in the box, it cannot be applied by just clicking it.

Is it possible that, whatever preset I choose in the pull-down menu, it just applies.

I'm using the lastest A1111 SD webui (1.4.0) with python: 3.10.11 โ€€โ€ขโ€€ torch: 2.0.1+cu118 โ€€โ€ขโ€€ xformers: N/A โ€€โ€ขโ€€ gradio: 3.32.0

BUG: Config Presets breaks in A1111 v1.6

FYI, in case you didn't know, Config Presets is broken in A1111 version 1.6, because they removed the Restore faces checkbox and changed the enable HR Fix checkbox to be triggered by the state of the new expander. I found that these element ids were hardcoded into the plugin, as shown in this code:

`def init(self, *args, **kwargs):
super().init(*args, **kwargs)

    # Load custom tracked components
    txt2img_custom_tracked_components_ids = load_txt2img_custom_tracked_component_ids()
    img2img_custom_tracked_components_ids = load_img2img_custom_tracked_component_ids()

    # These are the settings from the UI that are saved for each preset
    self.txt2img_component_ids = [
        "txt2img_sampling",
        "txt2img_steps",
        "txt2img_width",
        "txt2img_height",
        "txt2img_batch_count",
        "txt2img_batch_size",
        "txt2img_restore_faces",
        "txt2img_enable_hr",
        "txt2img_hr_scale",
        "txt2img_hr_upscaler",
        "txt2img_hires_steps",
        "txt2img_denoising_strength",
        "txt2img_cfg_scale",
    ]
    self.txt2img_component_ids += txt2img_custom_tracked_components_ids # add the custom tracked components

    self.img2img_component_ids = [
        "img2img_sampling",
        "img2img_steps",
        "img2img_width",
        "img2img_height",
        "img2img_batch_count",
        "img2img_batch_size",
        "img2img_cfg_scale",
        "img2img_denoising_strength",
        "img2img_restore_faces",
    ]
    self.img2img_component_ids += img2img_custom_tracked_components_ids # add the custom tracked components

    # Mapping between component labels and the actual components in ui.py
    self.txt2img_component_map = {k: None for k in self.txt2img_component_ids}  # gets filled up in the after_component() method
    self.img2img_component_map = {k: None for k in self.img2img_component_ids}  # gets filled up in the after_component() method

    # Load txt2img and img2img config files
    self.txt2img_config_presets = load_txt2img_config_file()
    self.img2img_config_presets = load_img2img_config_file()

`
I was able to disable the necessary fields to get up and running, but for end user experience, you may want to consider not hardcoding any element ids at all and using the configuration file for all relevant IDs. That way, if something fundamental changes in A1111, a user can go in to their config file and disable as necessary to get back up and running without having to open up plugin code.

Cheers

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.