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

Add sd-webui-extended-style-saver #226

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

harukei-tech
Copy link
Contributor

@harukei-tech harukei-tech commented Nov 3, 2023

Info

https://github.com/harukei-tech/sd-webui-extended-style-saver

Checklist:

  • I have read the Readme.md
  • The description is written in English.
  • The index.json and extension_template.json have not been modified.
  • The entry is placed in the extensions directory with the .json file extension.

@w-e-w
Copy link
Collaborator

w-e-w commented Nov 6, 2023

@harukei-tech from my testing your extension fails to function
the error caused by your extension even causes web UI to fail
image
please retest your extension
when testing remember to use a clean install of webui 1.6.1 and or dev branch

Error

note this is only the first exception output

*** Error calling: B:\GitHub\stable-diffusion-webui\extensions\sd-webui-extended-style-saver\scripts\extended_styles.py/ui
    Traceback (most recent call last):
      File "B:\GitHub\stable-diffusion-webui\modules\scripts.py", line 402, in wrap_call
        return func(*args, **kwargs)
      File "B:\GitHub\stable-diffusion-webui\extensions\sd-webui-extended-style-saver\scripts\extended_styles.py", line 75, in ui
        self.ui_txt2img()
      File "B:\GitHub\stable-diffusion-webui\extensions\sd-webui-extended-style-saver\scripts\extended_styles.py", line 105, in ui_txt2img
        apply_button.click(
      File "B:\GitHub\stable-diffusion-webui\venv\lib\site-packages\gradio\events.py", line 140, in __call__
        dep, dep_index = self.trigger.set_event_trigger(
      File "B:\GitHub\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 287, in set_event_trigger
        "outputs": [block._id for block in outputs],
      File "B:\GitHub\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 287, in <listcomp>
        "outputs": [block._id for block in outputs],
    AttributeError: 'NoneType' object has no attribute '_id'

@w-e-w w-e-w marked this pull request as draft November 6, 2023 06:18
@harukei-tech
Copy link
Contributor Author

@w-e-w
Thank you for your polite bug report!

Upon checking with a clean-installed version of dev branch, I confirmed the 'NoneType' error as you pointed out.

While this issue has been resolved, I discovered another error related to ControlNet in subsequent processes. Resolving this new issue would take some time, I have removed the processing related to ControlNet and will address it another branch.

Since the description in the file extensions/sd-webui-extended-style-saver.json of this PR does not mention ControlNet, nothing was updated.

Thank you again for your attention and verification.
image

@harukei-tech harukei-tech marked this pull request as ready for review November 10, 2023 15:29
@w-e-w
Copy link
Collaborator

w-e-w commented Nov 10, 2023

I will check the extension again when I have time

if the trouble you're having with controlnet is due to load order this might help a bit
#225 (comment)

also I'm currently working on the system that wold allow an extension to have total control of the load order every script and the execution order of every callback
note: this may or may not merged into to webUI I haven't passed this through AUTO yet

after my system came out you shouldn't need to add zz https://github.com/harukei-tech/sd-webui-extended-style-saver/blob/master/readme/README.md#what-does-the-zz--prefix-mean
but ideally you'll be able to get it working without any load order configuration

@w-e-w
Copy link
Collaborator

w-e-w commented Nov 13, 2023

nice retested and it didn't explode

even though in my opinion I would probably use the default built-in styles
if you just saving type engine info and then click apply it can basically be used similar to this extension but this is just my opinion

tip:
you don't have to actually modify the settings to apply sd_model_checkpoint and sd_vae
https://github.com/harukei-tech/sd-webui-extended-style-saver/blob/master/scripts/service/extended_style_service.py#L55-L62
instead you can just add it to override settings
image
the advantage of doing it this way is that for one it doesn't modify the settings which means that it's better in multi-user use case
using override settings basically changed the setting temporarily when the image is generated, so it's guaranteed that it will be color correct model
where are settings is global so in a multi-use scenario if one user change the model then the models will be changed for every one
override settings is very powerful almost all settings can be changed with it

just something that you can work on if you're interested

@w-e-w w-e-w merged commit e407eed into AUTOMATIC1111:extensions Nov 13, 2023
1 check passed
@harukei-tech
Copy link
Contributor Author

harukei-tech commented Nov 15, 2023

@w-e-w
Thank you for your review and merge.
I also appreciate your good advice! I plan to address each of them.

ControlNet Support

Load Order

Thank you for providing the example of the hack method.
That method's process uses external source code so it's hard for me to comprehend right away.
I'll read it again when I have finished responding to the following Issue.

Current issue in sd-webui-extended-style-saver

This is not related to the load order.

When gr.Image.update is performed on the image component of ControlNet,
the gradio framework's preprocess executes about 4-5 times with different arguments.

It eventually completes successfully, but a type mismatch error appears in the terminal several times.
It is difficult and time consuming to figure out whether SD, Gradio, or ControlNet should be addressed.

Override Settings

I wasn't aware of such an option. 😮
Thanks for the useful information!

I would like to try incorporating it, but could you please tell me how to display this item?
Even when I try navigating to "Settings > User interface > txt2img/img2img UI item order", it doesn't appear.
I searched the internet for information on how to display it but couldn't find any.

@w-e-w
Copy link
Collaborator

w-e-w commented Nov 15, 2023

override setting doesn't appear in the UI it's not meant to be used by the user directly
it automatically appears when you read PNG info, an override setting entry will appear if it is used,
or use as internal option in extensions or scripts, see the built-in XYZ script, in there I use override settings to apply lots of options

--

ui

2023-11-16.02_12_12_876.chrome.mp4

xyz

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/5e80d9ee99c5899e5e2b130408ffb65a0585a62a/scripts/xyz_grid.py#L149-L154

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/5e80d9ee99c5899e5e2b130408ffb65a0585a62a/scripts/xyz_grid.py#L76-L80

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