brkirch / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
197 stars 10 forks source link

[Bug]: AttributeError: 'Identity' object has no attribute 'process_texts' #9

Closed byewind1 closed 1 year ago

byewind1 commented 1 year ago

Is there an existing issue for this?

What happened?

MacOS 13.3.1 / safari browser, error in the forward prompt bar

Steps to reproduce the problem

  1. ReloadUI
  2. Write prompt or apply selected style to current prompt
  3. Then this would happen

What should have happened?

should No this error

Commit where the problem happens

python: 3.10.10  •  torch: 2.0.0a0+git88b0249  •  xformers: N/A  •  gradio: 3.16.2  •  commit: 106c9ac5  •  checkpoint: 13249548d8

What platforms do you use to access the UI ?

MacOS

What browsers do you use to access the UI ?

Apple Safari

Command Line Arguments

NO

List of extensions

Lora, controlnet, Prompt Translator extension

Console logs

raceback (most recent call last):
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/Users/ren/stable-diffusion-webui/modules/call_queue.py", line 15, in f
    res = func(*args, **kwargs)
  File "/Users/ren/stable-diffusion-webui/modules/ui.py", line 277, in update_token_counter
    token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], key=lambda args: args[0])
  File "/Users/ren/stable-diffusion-webui/modules/ui.py", line 277, in <listcomp>
    token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], key=lambda args: args[0])
  File "/Users/ren/stable-diffusion-webui/modules/sd_hijack.py", line 219, in get_prompt_lengths
    _, token_count = self.clip.process_texts([text])
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Identity' object has no attribute 'process_texts'
Traceback (most recent call last):
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/Users/ren/stable-diffusion-webui/modules/call_queue.py", line 15, in f
    res = func(*args, **kwargs)
  File "/Users/ren/stable-diffusion-webui/modules/ui.py", line 277, in update_token_counter
    token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], key=lambda args: args[0])
  File "/Users/ren/stable-diffusion-webui/modules/ui.py", line 277, in <listcomp>
    token_count, max_length = max([model_hijack.get_prompt_lengths(prompt) for prompt in prompts], key=lambda args: args[0])
  File "/Users/ren/stable-diffusion-webui/modules/sd_hijack.py", line 219, in get_prompt_lengths
    _, token_count = self.clip.process_texts([text])
  File "/Users/ren/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Identity' object has no attribute 'process_texts'

Additional information

No response

byewind1 commented 1 year ago

If you restart the program, it seems like the problem disappears, which is strange