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

AttributeError: 'RegionDiffusion' object has no attribute 'tokenizer' #7

Open
jasoncow007 opened this issue Oct 2, 2023 · 3 comments

Comments

@jasoncow007
Copy link

Traceback (most recent call last):
File "D:\sd-webui-aki-v4\py310\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "D:\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "D:\sd-webui-aki-v4\py310\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\sd-webui-aki-v4\py310\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\sd-webui-aki-v4\py310\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "D:\sd-webui-aki-v4\py310\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "D:\sd-webui-aki-v4\py310\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "D:\sd-webui-aki-v4\extensions\sd-webui-rich-text\scripts\rich_text_on_tab.py", line 123, in generate
region_text_prompts, region_target_token_ids, base_tokens = get_region_diffusion_input(
File "D:\sd-webui-aki-v4\extensions\sd-webui-rich-text\scripts\models\utils\richtext_utils.py", line 146, in get_region_diffusion_input
base_tokens = model.tokenizer._tokenize(base_text_prompt)
File "D:\sd-webui-aki-v4\py310\lib\site-packages\torch\nn\modules\module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'RegionDiffusion' object has no attribute 'tokenizer'

@songweige
Copy link
Owner

I think this might be related to the failure of loading the model. Did you see multiple lines of "[INFO] loading stable diffusion"(

print(f'[INFO] loading stable diffusion {model_id} ... attempt {load_attemp}')
)? I have added some code to print more information about errors. Could you try to update the extension again and see if there something new?

@jasoncow007
Copy link
Author

it didn't download the model automaticly,,,,,,what's the path of the model

[INFO] loading stable diffusion...
[INFO] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 0
[ERROR] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 0 failed with error runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
[INFO] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 1
[ERROR] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 1 failed with error runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
[INFO] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 2
[ERROR] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 2 failed with error runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
[INFO] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 3
[ERROR] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 3 failed with error runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
[INFO] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 4
[ERROR] loading stable diffusion runwayml/stable-diffusion-v1-5 ... attempt 4 failed with error runwayml/stable-diffusion-v1-5 does not appear to have a file named config.json.
[INFO] loaded stable diffusion!

@songweige
Copy link
Owner

It is supposed to download the checkpoint automatically from https://huggingface.co/runwayml/stable-diffusion-v1-5. I guess there might be some incomplete downloading. Could you check the folder .cache/huggingface/diffusers/' and delete the cache of the checkpoint and try again? Also, do you have a different version of diffusers other than 0.18.2`.?

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

No branches or pull requests

2 participants