facechain: Facechain not working when installed via extensions

Hi, i just downloaded facechain via the extensions tab in automatic1111 but i couldnt get it to work i throws several errors. I would be glas if someone could help me resolve the issue. This is my log:

`Already up to date. venv “C:\StableDiffusion\stable-diffusion-webui\venv\Scripts\Python.exe” Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.7.0 Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e –installing mmcv… Installing requirements for mmcv Couldn’t install requirements for mmcv. Command: “C:\StableDiffusion\stable-diffusion-webui\venv\Scripts\python.exe” -m pip install mmcv-full==1.7.0 --prefer-binary Error code: 1 stdout: Collecting mmcv-full==1.7.0 Using cached mmcv-full-1.7.0.tar.gz (593 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status ‘error’

stderr: WARNING: Ignoring invalid distribution -rotobuf (c:\stablediffusion\stable-diffusion-webui\venv\lib\site-packages) WARNING: Ignoring invalid distribution -rotobuf (c:\stablediffusion\stable-diffusion-webui\venv\lib\site-packages) error: subprocess-exited-with-error

python setup.py egg_info did not run successfully. exit code: 1

[14 lines of output] Traceback (most recent call last): File “<string>”, line 2, in <module> File “<pip-setuptools-caller>”, line 34, in <module> File “C:\Users\rouve\AppData\Local\Temp\pip-install-0smz74z2\mmcv-full_b8e4dcac16d84821b7691f0db34993ae\setup.py”, line 461, in <module> ext_modules=get_extensions(), File “C:\Users\rouve\AppData\Local\Temp\pip-install-0smz74z2\mmcv-full_b8e4dcac16d84821b7691f0db34993ae\setup.py”, line 365, in get_extensions ext_ops = extension( File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py”, line 1048, in CUDAExtension library_dirs += library_paths(cuda=True) File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py”, line 1186, in library_paths paths.append(_join_cuda_home(lib_dir)) File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py”, line 2223, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ’ OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. WARNING: Ignoring invalid distribution -rotobuf (c:\stablediffusion\stable-diffusion-webui\venv\lib\site-packages) WARNING: Ignoring invalid distribution -rotobuf (c:\stablediffusion\stable-diffusion-webui\venv\lib\site-packages) WARNING: Ignoring invalid distribution -rotobuf (c:\stablediffusion\stable-diffusion-webui\venv\lib\site-packages)

[notice] A new release of pip available: 22.2.1 -> 24.0 [notice] To update, run: C:\StableDiffusion\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip

ERROR facechain: failed to install mmcv, make sure to have “CUDA Toolkit” and “Build Tools for Visual Studio” installed Installing requirements for diffusers removing nvidia-cudnn-cu11 Launching Web UI with arguments: --xformers --theme dark --autolaunch Style database not found: C:\StableDiffusion\stable-diffusion-webui\styles.csv ControlNet preprocessor location: C:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads 2024-02-07 11:21:19,669 - ControlNet - INFO - ControlNet v1.1.440 2024-02-07 11:21:19,769 - ControlNet - INFO - ControlNet v1.1.440 Loading weights [e6bb9ea85b] from C:\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion\sd_xl_base_1.0_0.9vae.safetensors 2024-02-07 11:21:20,236 - ControlNet - INFO - ControlNet UI callback registered. Creating model from config: C:\StableDiffusion\stable-diffusion-webui\repositories\generative-models\configs\inference\sd_xl_base.yaml 2024-02-07 11:21:21,371 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found. 2024-02-07 11:21:21,423 - modelscope - INFO - Loading ast index from C:\Users\rouve.cache\modelscope\ast_indexer 2024-02-07 11:21:21,552 - modelscope - INFO - Loading done! Current index file version is 1.12.0, with md5 47d35f634fb1a9b1349293bd5ef1536f and a total number of 964 components indexed C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\app.py:1276: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead. output_images = gr.Gallery(label=‘Output’, show_label=False).style(columns=3, rows=2, height=600, [[‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/resources/inpaint_template\1.jpg’], [‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/resources/inpaint_template\2.jpg’], [‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/resources/inpaint_template\3.jpg’], [‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/resources/inpaint_template\4.jpg’], [‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/resources/inpaint_template\5.jpg’]] C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\app.py:1379: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead. output_images = gr.Gallery( [] C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\app.py:1530: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead. output_images = gr.Gallery( Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Startup time: 23.5s (prepare environment: 6.2s, import torch: 2.1s, import gradio: 0.7s, setup paths: 0.6s, initialize shared: 0.2s, other imports: 0.4s, setup codeformer: 0.2s, load scripts: 6.1s, initialize extra networks: 0.1s, create ui: 6.7s, gradio launch: 0.2s). Applying attention optimization: xformers… done. Model loaded in 8.4s (load weights from disk: 1.3s, create model: 0.7s, apply weights to model: 5.1s, apply half(): 0.1s, move model to device: 0.3s, load textual inversion embeddings: 0.2s, calculate empty prompt: 0.7s). INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK”`

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Comments: 15

Most upvoted comments

i was finally able to install it but it threw this error now:

instance_data_dir C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\worker_data\qw\training_data\AI-ModelScope/stable-diffusion-xl-base-1.0\jille Traceback (most recent call last): File “C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\facechain\train_text_to_image_lora_sdxl.py”, line 30, in <module> import cv2 ModuleNotFoundError: No module named ‘cv2’ Error executing the command: Command ‘[‘python’, ‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/facechain/train_text_to_image_lora_sdxl.py’, ‘–pretrained_model_name_or_path=AI-ModelScope/stable-diffusion-xl-base-1.0’, ‘–revision=v1.0.9’, ‘–sub_path=’, ‘–output_dataset_name=C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\worker_data\qw\training_data\AI-ModelScope/stable-diffusion-xl-base-1.0\jille’, ‘–caption_column=text’, ‘–resolution=512’, ‘–random_flip’, ‘–train_batch_size=1’, ‘–num_train_epochs=200’, ‘–checkpointing_steps=5000’, ‘–learning_rate=1.5e-04’, ‘–lr_scheduler=cosine’, ‘–lr_warmup_steps=0’, ‘–seed=42’, ‘–output_dir=C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\worker_data\qw\AI-ModelScope/stable-diffusion-xl-base-1.0\jille’, ‘–lora_r=4’, ‘–lora_alpha=32’, ‘–lora_text_encoder_r=32’, ‘–lora_text_encoder_alpha=32’]’ returned non-zero exit status 1. Traceback (most recent call last): File “C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\app.py”, line 147, in train_lora_fn subprocess.run(command, check=True) File “C:\Users\rouve\AppData\Local\Programs\Python\Python310\lib\subprocess.py”, line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command ‘[‘python’, ‘C:\StableDiffusion\stable-diffusion-webui\extensions\facechain/facechain/train_text_to_image_lora_sdxl.py’, ‘–pretrained_model_name_or_path=AI-ModelScope/stable-diffusion-xl-base-1.0’, ‘–revision=v1.0.9’, ‘–sub_path=’, ‘–output_dataset_name=C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\worker_data\qw\training_data\AI-ModelScope/stable-diffusion-xl-base-1.0\jille’, ‘–caption_column=text’, ‘–resolution=512’, ‘–random_flip’, ‘–train_batch_size=1’, ‘–num_train_epochs=200’, ‘–checkpointing_steps=5000’, ‘–learning_rate=1.5e-04’, ‘–lr_scheduler=cosine’, ‘–lr_warmup_steps=0’, ‘–seed=42’, ‘–output_dir=C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\worker_data\qw\AI-ModelScope/stable-diffusion-xl-base-1.0\jille’, ‘–lora_r=4’, ‘–lora_alpha=32’, ‘–lora_text_encoder_r=32’, ‘–lora_text_encoder_alpha=32’]’ returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py”, line 488, in run_predict output = await app.get_blocks().process_api( File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py”, line 1431, in process_api result = await self.call_function( File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py”, line 1103, in call_function prediction = await anyio.to_thread.run_sync( File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py”, line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py”, line 877, in run_sync_in_worker_thread return await future File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py”, line 807, in run result = context.run(func, *args) File “C:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py”, line 707, in wrapper response = f(*args, **kwargs) File “C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\app.py”, line 804, in run train_lora_fn(base_model_path=base_model_path, File “C:\StableDiffusion\stable-diffusion-webui\extensions\facechain\app.py”, line 150, in train_lora_fn raise gr.Error(“训练失败 (Training failed)”) gradio.exceptions.Error: ‘训练失败 (Training failed)’ INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict “HTTP/1.1 500 Internal Server Error” INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset “HTTP/1.1 200 OK”

Its now completely broken stable diffusion wont even start anymore

Alright that’s weird, as I’m currently using CUDA 11.8 and everything’s working as expected.

What happens when you try to start A1111?

Also, just an advise: this extension is full of problems. I uninstalled it and I am now using FaceSwapLab. No issue whatsoever.