I Run stable diffusion,It`s wrong RuntimeError: "LayerNormKernelImpl" not implemented for 'Half',help me,how i do?
I have no idea for it
I Run stable diffusion,It`s wrong RuntimeError: "LayerNormKernelImpl" not implemented for 'Half',help me,how i do?
I have no idea for it
I solved it in the following way, modify the launch.py
file in the following way, add the following line of code:
commandline_args = os.environ.get('COMMANDLINE_ARGS', "--skip-torch-cuda-test --no-half")
'LayerNorm' is one of the layers in the Model. Looks like you're trying to load the diffusion model in float16(Half) format on CPU which is not supported. For float16 format, GPU needs to be used. For CPU run the model in float32 format.
I am not sure what your environment is. I can show you what I have encountered. I also encountered this error during my Colab testing, which appeared after I changed my model. Then I realized that I had forgotten to assign the pipe to CUDA. After running the code below, everything was fine.
pipe = pipe.to("cuda")
In Windows System, Edit webui-user.bat file
set COMMANDLINE_ARGS= --skip-torch-cuda-test --no-half
Instantiate the pipeline with float32
, it will run slower but it will run ;)
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
RuntimeError: “LayerNormKernelImpl” not implemented for ‘Half’
I have successfully solved this problem by way of
Start the webUI with the following Mac OS Terminal command.
cd stable-diffusion-webui ./webui.sh --precision full --no-half
Special Thank >> https://stable-diffusion-art.com/install-mac/comment-page-1/