aigc-apps / sd-webui-EasyPhoto

📷 EasyPhoto | Your Smart AI Photo Generator.
Apache License 2.0
4.9k stars 388 forks source link

[Bug]: No longer works in SD Forge after Forge upgraded to Gradio 4. #434

Open rbrtwtrs opened 1 month ago

rbrtwtrs commented 1 month ago

Is there an existing issue for this?

Is EasyPhoto the latest version?

What happened?

https://github.com/lllyasviel/stable-diffusion-webui-forge upgraded to Gradio 4 + WebUI 1.10. This has broken a number of Extensions including EasyPhoto.

Steps to reproduce the problem

  1. Update stable -diffusion-webui-forge

What should have happened?

No tab visible

Commit where the problem happens

webui: EastPhoto:

What browsers do you use to access the UI ?

Brave

Command Line Arguments

Launching from Stability Matrix

List of enabled extensions

Screenshot 2024-07-29 133259

Console logs

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f1.0.2v1.10.1-previous-37-g3bc9402d
Commit hash: 3bc9402de9f906dd5df504c1f24d88589c2d3074
Installing requirements
C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-inpaint-background\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-reactor\install.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
CUDA 12.1
C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Launching Web UI with arguments: --gradio-allowed-path 'C:\StabilityMatrix\Data\Images'
Total VRAM 24564 MB, total RAM 64729 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3090 Ti : native
Hint: your device supports --pin-shared-memory for potential speed improvements.
Hint: your device supports --cuda-malloc for potential speed improvements.
Hint: your device supports --cuda-stream for potential speed improvements.
VAE dtype: torch.bfloat16
CUDA Stream Activated:  False
2024-07-29 13:19:18.645936: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-07-29 13:19:19.581243: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
Using pytorch cross attention
ControlNet preprocessor location: C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\models\ControlNetPreprocessor
[-] ADetailer initialized. version: 24.6.0, num models: 19
[sdwi2iextender] Developper warning:
[sdwi2iextender] ./modules/img2img.py is being recompiled at run time with a patch. Your debugger will not work in this file.
[sdwi2iextender] If you need debug tools in this file, disable all extensions that use the sdwi2iextender library.
[sdwi2iextender] This patch is temporary and will be removed when v1.9 will be released.
sd-webui-prompt-all-in-one background API service started successfully.
13:19:30 - ReActor - STATUS - Running v0.7.1-a1 on Device: CUDA
Loading weights [8b886bbe13] from C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\models\Stable-diffusion\mklanRealisticPony_nextgenPonyv1.safetensors
*** Error calling: C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py/ui
    Traceback (most recent call last):
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\scripts.py", line 545, in wrap_call
        return func(*args, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py", line 348, in ui
        btns = [
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py", line 349, in <listcomp>
        ARButton(ar=ar, value=label)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py", line 31, in __init__
        super().__init__(**kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\ui_components.py", line 23, in __init__
        super().__init__(*args, elem_classes=["tool", *elem_classes], value=value, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\gradio_extensions.py", line 126, in __repaired_init__
        original(self, *args, **fixed_kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\component_meta.py", line 163, in wrapper
        return fn(self, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\button.py", line 61, in __init__
        super().__init__(
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\gradio_extensions.py", line 35, in IOComponent_init
        res = original_IOComponent_init(self, *args, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\component_meta.py", line 163, in wrapper
        return fn(self, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\base.py", line 224, in __init__
        self.component_class_id = self.__class__.get_component_class_id()
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\base.py", line 118, in get_component_class_id
        module_path = sys.modules[module_name].__file__
    KeyError: 'sd-webui-ar.py'

---
model_type EPS
UNet ADM Dimension 2816
*** Error calling: C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py/ui
    Traceback (most recent call last):
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\scripts.py", line 545, in wrap_call
        return func(*args, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py", line 348, in ui
        btns = [
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py", line 349, in <listcomp>
        ARButton(ar=ar, value=label)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-ar_xhox\scripts\sd-webui-ar.py", line 31, in __init__
        super().__init__(**kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\ui_components.py", line 23, in __init__
        super().__init__(*args, elem_classes=["tool", *elem_classes], value=value, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\gradio_extensions.py", line 126, in __repaired_init__
        original(self, *args, **fixed_kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\component_meta.py", line 163, in wrapper
        return fn(self, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\button.py", line 61, in __init__
        super().__init__(
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\gradio_extensions.py", line 35, in IOComponent_init
        res = original_IOComponent_init(self, *args, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\component_meta.py", line 163, in wrapper
        return fn(self, **kwargs)
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\base.py", line 224, in __init__
        self.component_class_id = self.__class__.get_component_class_id()
      File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\venv\lib\site-packages\gradio\components\base.py", line 118, in get_component_class_id
        module_path = sys.modules[module_name].__file__
    KeyError: 'sd-webui-ar.py'

---
2024-07-29 13:19:33,765 - ControlNet - INFO - ControlNet UI callback registered.
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
Running on local URL:  http://127.0.0.1:7860
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}

To create a public link, set `share=True` in `launch()`.
Startup time: 72.4s (prepare environment: 42.3s, launcher: 2.3s, import torch: 5.2s, setup paths: 4.2s, initialize shared: 0.3s, other imports: 0.8s, list SD models: 0.2s, load scripts: 6.9s, create ui: 5.0s, gradio launch: 3.3s, app_started_callback: 1.8s).
To load target model SDXLClipModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) =  23291.7470703125
[Memory Management] Model Memory (MB) =  2144.3546981811523
[Memory Management] Minimal Inference Memory (MB) =  1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) =  20123.392372131348
Moving model(s) has taken 0.45 seconds
Model loaded in 11.0s (calculate hash: 0.1s, forge instantiate config: 1.4s, forge load real models: 5.1s, forge finalize: 1.2s, load textual inversion embeddings: 2.4s, calculate empty prompt: 0.7s).

Additional information

No response

xam0482 commented 1 month ago

sd-webui-ar 这个插件 按钮继承 ToolButton>gr.Button sys.modules[module_name] 中没有 sd-webui-ar 然后报错 gradio 类继承 修改了

我搞两天了也没搞明白

rbrtwtrs commented 1 month ago

Still fails without sd-webui-ar enabled. There is no EasyPhoto Tab but there is an accordion tab with "Dynamic Lora Weights (EasyPhoto builtin)" There is an open issue at https://github.com/lllyasviel/stable-diffusion-webui-forge/issues

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Version: f1.0.2v1.10.1-previous-62-ge3522c89 Commit hash: e3522c89191a01e0dd5855abbfd15cb685be3634 Installing requirements is_installed check for tensorflow-cpu failed as 'spec is None' Installing requirements for easyphoto-webui Installing requirements for tensorflow C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-inpaint-background\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-reactor\install.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources CUDA 12.1 C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions-builtin\forge_legacy_preprocessors\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions-builtin\sd_forge_controlnet\install.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Launching Web UI with arguments: --gradio-allowed-path 'C:\StabilityMatrix\Data\Images' Total VRAM 24564 MB, total RAM 64729 MB Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3090 Ti : native Hint: your device supports --pin-shared-memory for potential speed improvements. Hint: your device supports --cuda-malloc for potential speed improvements. Hint: your device supports --cuda-stream for potential speed improvements. VAE dtype: torch.bfloat16 CUDA Stream Activated: False 2024-08-01 16:37:19.132073: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. 2024-08-01 16:37:20.164853: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0. Using pytorch cross attention Using pytorch cross attention ControlNet preprocessor location: C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\models\ControlNetPreprocessor [-] ADetailer initialized. version: 24.6.0, num models: 19 2024-08-01 16:37:30,146 - modelscope - INFO - PyTorch version 2.1.2+cu121 Found. 2024-08-01 16:37:30,162 - modelscope - INFO - TensorFlow version 2.16.1 Found. 2024-08-01 16:37:30,162 - modelscope - INFO - Loading ast index from C:\Users\rbrtw.cache\modelscope\ast_indexer 2024-08-01 16:37:30,630 - modelscope - INFO - Loading done! Current index file version is 1.9.3, with md5 e81d9fa8efecccbceabbbe9926052339 and a total number of 943 components indexed [sdwi2iextender] Developper warning: [sdwi2iextender] ./modules/img2img.py is being recompiled at run time with a patch. Your debugger will not work in this file. [sdwi2iextender] If you need debug tools in this file, disable all extensions that use the sdwi2iextender library. [sdwi2iextender] This patch is temporary and will be removed when v1.9 will be released. sd-webui-prompt-all-in-one background API service started successfully. 16:37:34 - ReActor - STATUS - Running v0.7.1-a1 on Device: CUDA Loading weights [8557e300af] from C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\models\Stable-diffusion\afroditexlNSFW_20.safetensors AnimateDiffScript init AnimateDiffScript init Skipped: unet = diffusers.UNet2DConditionModel Working with z of shape (1, 4, 32, 32) = 4096 dimensions. model_type EPS UNet ADM Dimension 2816 2024-08-01 16:37:38,075 - ControlNet - INFO - ControlNet UI callback registered. *** Error executing callback ui_tabs_callback for C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-EasyPhoto\scripts\easyphoto_ui.py Traceback (most recent call last): File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\modules\script_callbacks.py", line 283, in ui_tabs_callback res += c.callback() or [] File "C:\StabilityMatrix\Data\Packages\Stable Diffusion WebUI Forge\extensions\sd-webui-EasyPhoto\scripts\easyphoto_ui.py", line 254, in on_ui_tabs instance_images = gr.Gallery().style(columns=[4], rows=[2], object_fit="contain", height="auto") AttributeError: 'Gallery' object has no attribute 'style'


Running on local URL: http://127.0.0.1:7860 To load target model JointCLIP Begin to load 1 model [Memory Management] Current Free GPU Memory (MB) = 23291.7470703125 [Memory Management] Model Memory (MB) = 1753.803913116455 [Memory Management] Minimal Inference Memory (MB) = 1024.0 [Memory Management] Estimated Remaining GPU Memory (MB) = 20513.943157196045

To create a public link, set share=True in launch(). Startup time: 63.0s (prepare environment: 28.1s, launcher: 2.4s, import torch: 5.7s, setup paths: 4.8s, initialize shared: 0.3s, other imports: 1.1s, opts onchange: 0.3s, list SD models: 0.2s, load scripts: 9.5s, create ui: 5.6s, gradio launch: 3.4s, app_started_callback: 1.4s). Moving model(s) has taken 3.40 seconds Model loaded in 10.8s (forge instantiate config: 1.6s, forge load real models: 4.5s, load textual inversion embeddings: 0.8s, calculate empty prompt: 3.7s).

rbrtwtrs commented 1 month ago

The error in the log indicates an issue with the Gallery object in the EasyPhoto extension not having a style attribute. This is likely due to an API change or incompatibility in the Forge upgraded Gradio 4 library.