ljleb / sd-webui-freeu

a1111 implementation of https://github.com/ChenyangSi/FreeU
MIT License
307 stars 16 forks source link

Infotext bug #27

Closed wcde closed 1 year ago

wcde commented 1 year ago

Not working with dev branch Auto1111. At webui start get this:

*** Error calling: F:\AI\stable-diffusion-webui\extensions\sd-webui-freeu\scripts\freeu.py/ui
    Traceback (most recent call last):
      File "F:\AI\stable-diffusion-webui\modules\scripts.py", line 402, in wrap_call
        return func(*args, **kwargs)
      File "F:\AI\stable-diffusion-webui\extensions\sd-webui-freeu\scripts\freeu.py", line 177, in ui
        schedule_infotext.change(
      File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\events.py", line 140, in __call__
        dep, dep_index = self.trigger.set_event_trigger(
      File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 286, in set_event_trigger
        "inputs": [block._id for block in inputs],
      File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 286, in <listcomp>
        "inputs": [block._id for block in inputs],
    AttributeError: 'NoneType' object has no attribute '_id'

After opening web-interface, Auto1111 crashes with this:

Traceback (most recent call last):
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1434, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in postprocess_data
    self.validate_outputs(fn_index, predictions)  # type: ignore
  File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1272, in validate_outputs
    raise ValueError(
ValueError: An event handler didn't receive enough output values (needed: 310, received: 2).

Without calling schedule_infotext.change() it works fine. Passed steps_component is None.

ljleb commented 1 year ago

Ah I thought I could rely on component creation order when creating the ui. I'll make it so that order does not matter.

ljleb commented 1 year ago

Pushed a fix, let me know if the problem persists.

wcde commented 1 year ago

Still same error on startup. But now webui doesn't crash.

ljleb commented 1 year ago

I tested on the dev branch and I'm unable to reproduce. I think for some reason the components with elem_id="{tab}_steps" are not caught by the on_before_component callback. Maybe an extension messing with stuff?

wcde commented 1 year ago

Disabling all extensions does not help. I did some testing and it looks like some combination of webui settings is causing the error. It's hard to say what exactly, but clean config does not cause errors.

ljleb commented 1 year ago

Is it related to one of these options? image

wcde commented 1 year ago

Yes, error if ui_reorder non-default.

ljleb commented 1 year ago

My bad, callback should be called on after component, not before. Should be fixed now.