stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: AttributeError: 'Textbox' object has no attribute 'elem_classes'

Open Nicoolodion opened this issue 2 years ago • 2 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

I did a git pull, and then I startet it and it gave the error:"AttributeError: 'Textbox' object has no attribute 'elem_classes'" and then "AttributeError: 'Textbox' object has no attribute 'type'. Did you mean: 'style'?". It doesn't even start the webui.

Steps to reproduce the problem

  1. start the "webui-user.bat" file
  2. watch how the error message gets displayed

What should have happened?

don't display an error and start the webui

Commit where the problem happens

4c1ad743e3baf1246db0711aa0107debf036a12b

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--deepdanbooru --xformers --api --cors-allow-origins http://localhost:5173 --opt-split-attention

List of extensions

ABG_extension, aesthetic-gradients, deforum-for-automatic1111-webui, openOutpaint-webUI-extension, openpose-editor, posex, PromptGallery-stable-diffusion-webui, sd_dreambooth_extension, sd_smartprocess, sd-webui-additional-networks, stable-diffusion-webui-depthmap-script, stable-diffusion-webui-inspiration (I copied the name from /extensions)

Console logs

venv "F:\Stable Diffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Commit hash: 4c1ad743e3baf1246db0711aa0107debf036a12b
Installing requirements for Web UI
Installing requirements for Anime Background Remover
Installing requirements for Anime Background Remover
Installing requirements for Anime Background Remover

preinit openOutpaint


Installing requirements for Prompt Gallery


#######################################################################################################
Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Dreambooth revision: 4ca69a904f5ddd5651d87032b3dca515eea505ba
SD-WebUI revision: 4c1ad743e3baf1246db0711aa0107debf036a12b

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[+] xformers version 0.0.14.dev0 installed.
[+] torch version 1.13.1+cu117 installed.
[+] torchvision version 0.14.1+cu117 installed.

#######################################################################################################

loading Smart Crop reqs from F:\Stable Diffusion\stable-diffusion-webui\extensions\sd_smartprocess\requirements.txt
Checking Smart Crop requirements.


Launching Web UI with arguments: --deepdanbooru --xformers --api --cors-allow-origins http://localhost:5173 --opt-split-attention
openOutpaint init

SD-Webui API layer loaded
Loading weights [d01b3a0365] from F:\Stable Diffusion\stable-diffusion-webui\models\Stable-diffusion\Midnight Melt.safetensors
Creating model from config: F:\Stable Diffusion\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights found near the checkpoint: F:\Stable Diffusion\stable-diffusion-webui\models\Stable-diffusion\Midnight Melt.vae.ckpt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(3): easynegative, lasterk-24500, mignon-62500
Model loaded in 4.3s (load weights from disk: 0.1s, create model: 0.5s, apply weights to model: 1.0s, apply half(): 0.5s, load VAE: 0.4s, move model to device: 0.6s, load textual inversion embeddings: 1.2s).
Traceback (most recent call last):
  File "F:\Stable Diffusion\stable-diffusion-webui\modules\ui.py", line 460, in create_ui
    txt2img_prompt, txt2img_prompt_styles, txt2img_negative_prompt, submit, _, _, txt2img_prompt_style_apply, txt2img_save_style, txt2img_paste, extra_networks_button, token_counter, token_button, negative_token_counter, negative_token_button = create_toprow(is_img2img=False)
  File "F:\Stable Diffusion\stable-diffusion-webui\modules\ui.py", line 288, in create_toprow
    prompt = gr.Textbox(label="Prompt", elem_id=f"{id_part}_prompt", show_label=False, lines=3, placeholder="Prompt (press Ctrl+Enter or Alt+Enter to generate)")
  File "F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 331, in __init__
    IOComponent.__init__(
  File "F:\Stable Diffusion\stable-diffusion-webui\modules\scripts.py", line 544, in IOComponent_init
    add_classes_to_gradio_component(self)
  File "F:\Stable Diffusion\stable-diffusion-webui\modules\scripts.py", line 529, in add_classes_to_gradio_component
    comp.elem_classes = ["gradio-" + comp.get_block_name(), *(comp.elem_classes or [])]
AttributeError: 'Textbox' object has no attribute 'elem_classes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Stable Diffusion\stable-diffusion-webui\launch.py", line 352, in <module>
    start()
  File "F:\Stable Diffusion\stable-diffusion-webui\launch.py", line 347, in start
    webui.webui()
  File "F:\Stable Diffusion\stable-diffusion-webui\webui.py", line 243, in webui
    shared.demo = modules.ui.create_ui()
  File "F:\Stable Diffusion\stable-diffusion-webui\modules\ui.py", line 459, in create_ui
    with gr.Blocks(analytics_enabled=False) as txt2img_interface:
  File "F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1095, in __exit__
    self.config = self.get_config_file()
  File "F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1071, in get_config_file
    "props": utils.delete_none(block.get_config())
  File "F:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 352, in get_config
    "type": self.type,
AttributeError: 'Textbox' object has no attribute 'type'. Did you mean: 'style'?
Drücken Sie eine beliebige Taste . . .

Additional information

The Issue startet with my git pull on 25.03.23 and wasn't fixed on the one on 26.03.23. (I know that these dates don't say much but I don't know the commit number anymore). But I could have happened earlier.

Nicoolodion avatar Mar 26 '23 14:03 Nicoolodion

Mine happened starting it up this morning. Exact same issue. Yesterday was fine too!

AudioStick avatar Mar 26 '23 15:03 AudioStick

Delete and recreate venv folder maybe, Gradio was recently updated

space-nuko avatar Mar 26 '23 17:03 space-nuko

Delete and recreate venv folder maybe, Gradio was recently updated

Just tried it, but It didn't change anything.

Nicoolodion avatar Mar 26 '23 18:03 Nicoolodion

Same bug. Solution, deleting venv didn't work as well.

Antimon22 avatar Mar 26 '23 18:03 Antimon22

+1

viktorsec avatar Mar 26 '23 20:03 viktorsec

same issue here

samp3209 avatar Mar 26 '23 22:03 samp3209

It look like the same:

#8970

FreeBlues avatar Mar 26 '23 22:03 FreeBlues

same issue after pulled the latest code

Season02 avatar Mar 27 '23 11:03 Season02

Just did the newest git pull. One error got solved, but one is still there (AttributeError: 'Blocks' object has no attribute 'elem_classes'). The solution seems to be to just wait...

Nicoolodion avatar Mar 27 '23 12:03 Nicoolodion

I had this issue and fixed it. I had other arguments set to skip the base project's requirements installation. (I'm guessing gradio needed to be updated). So other people should make sure their base installation is running or just do a pip -r requirements.txt.

ArrowM avatar Mar 28 '23 00:03 ArrowM

+1

anchoret2009 avatar Mar 28 '23 03:03 anchoret2009

Just update the version of gradio in all requirements.txt to 3.23.0

gradio==3.23.0

And check gradio version in venv

source venv/bin/activate && pip list | grep gradio

hwansnaa avatar Mar 29 '23 08:03 hwansnaa

issue still persists in latest commit. Gradio version upgrade didn't fix.

SilverDash avatar Apr 06 '23 22:04 SilverDash

issue still persists in latest commit. Gradio version upgrade didn't fix.

I'm pretty sure you missing a requirements.txt from a addon/extensions of yours, which installs a older version of gradio again, because the bug in gradio is fixed. I had the same problem. You can look in your venv/lib/site-packages, there should be a gradio-3.23.0.dist-info folder, but most likely there is one with an older version. But Updating this will not help, because the extension req will overwirte that again, if it is not changed. Best search in the main folder for all requirements.txt and look into them.

Antimon22 avatar Apr 07 '23 13:04 Antimon22