mit-han-lab / fastcomposer

[IJCV] FastComposer: Tuning-Free Multi-Subject Image Generation with Localized Attention
https://fastcomposer.mit.edu
MIT License
658 stars 37 forks source link

Failed to set up the environment. #9

Closed NaokiSato102 closed 1 year ago

NaokiSato102 commented 1 year ago

I tried to set up the environment based on the URL below, but the following error occurred. https://economylife.net/no-lora-fast-composer-install/

File "D:\Programs_D_MachineLearning\FastComposer0101\fastcomposer\venv\lib\site-packages\fastcomposer-0.0.1-py3.9.egg\fastcomposer\model.py", line 191, in <module>
File "D:\Programs_D_MachineLearning\FastComposer0101\fastcomposer\venv\lib\site-packages\fastcomposer-0.0.1-py3.9.egg\fastcomposer\model.py", line 192, in FastComposerTextEncoder
AttributeError: type object 'CLIPTextTransformer' has no attribute '_build_causal_attention_mask'

I searched for this error, but I couldn't find any information.

JPW0080 commented 1 year ago

If you have stable diffusion webui installed somewhere, try this

Command Prompt: \stable-diffusion-webui\venv\Scripts\activate.bat pip install transformers==4.25.1 D: cd D:\Programs_D_MachineLearning mkdir FastComposer0102 git clone https://github.com/mit-han-lab/fastcomposer.git mkdir D:\Programs_D_MachineLearning\FastComposer0102\fastcomposer\model\fastcomposer

Copy and Paste run_gradio.py from D:\Programs_D_MachineLearning\FastComposer0102\fastcomposer\demo to the root of D:\Programs_D_MachineLearning\FastComposer0102\fastcomposer

Place the fastcomposer model files in D:\Programs_D_MachineLearning\FastComposer0102\fastcomposer\model\fastcomposer

Command Prompt: D: cd D:\Programs_D_MachineLearning\FastComposer0102\fastcomposer python run_gradio.py --finetuned_model_path model/fastcomposer/pytorch_model.bin --mixed_precision "fp16"

qinghew commented 1 year ago

I also met this error. pip install transformers==4.25.1 will be fine.

Guangxuan-Xiao commented 1 year ago

Thank you for raising this issue, I've add transformers==4.25.1 in the environment setup section. Please let me know if you have more questions.

NaokiSato102 commented 1 year ago

Due to my busy schedule, my confirmation was delayed, but the method you introduced worked successfully. Thank you all very much.