How To Fix Stable Diffusion Error Code 128

Stable Diffusion is a programmatic technology; you can create any graphic illustration by inputting the text description.

It is a Text to Image model released in the year 2022; you can create your image just by giving detailed instructions with the help of an expert hand.

Stable Diffusion is a free, open-source program module for PC and Mac Users.

You can also apply Stable Diffusion to tasks such as inpainting, outpainting, and generating image-to-image translations by inputting text prompts.

However, many users face errors while Installing the Stable Diffusin by the Error message Error code 128, followed by

stderr: fatal: detected dubious ownership in the repository at ‘{File path}’ is on a file system that does not record ownership

To add an exception for this directory, call:

git config –global –add safe.directory { file path}

In this article, you will understand why the error occurs and how to launch the stable Diffusion successfully.

Why Stable Diffusion Error Code 128 Occurs?

stable diffusion error code 128 Error

Stable Diffusion Error Code 128 occurs when there is an ownership issue with the downloaded repository or an incomplete file inside the repository. You need to check the Stable Diffusion repository and reinstall it if needed.

These are the following causes

  • There needs to be proper ownership detected. 
  • The file inside the Stable Diffusion is not completely cloned
  • You might not run the file as an administrator while Installing

How To Fix Stable Diffusion Error Code 128

Before Installing the stable Diffusion, ensure you have the required system configuration.

You can check the system requirement here.

If you get Error Code 128, follow the steps below

1. Add Your Email Address On Git Client

Sometimes the error code 128 occurs if the file cannot identify its owner.

Adding an email address will resolve the error.

To add an Email address

  • Open Git Hub client application 
  • Click on File and Tab on Options
  • Click on Git Tab from the opened window
  • Input your name and Email address associated with your Git Account.
  • Click on the Save button from the opened window.
  • Now download the File from Git hub by clicking the commit to master Button to download the file.

Now you can access the stable diffusion file without any error.

2. Fix The Stable Diffusion Path

You have to check the repositories folder and make sure everything in this folder is complete.

As the error message says, first run, try to fix the path. 

The error occurs because of an issue with the installed path or repository.

Run the following command

  • git config –global –edit

This command will automatically edit and fix the repository.

If it cannot find the recorded file,

  •  git config –global –add safe.directory D:\28_Stable_Diffusion\stable\s\repositories/stable-diffusion-stability-a

The file path might vary it depends on your downloaded location.

Also, Check for any typo errors while Inputting the command.

If it doesn’t solve the issue, Reinstall it again.

3. Delete The Repository And Reinstall It Again

Deleting the file from the directory will help you with the fresh installation.

  • First, please delete one like the “stable-diffusion-stability-ai” folder from your Windows.
  • Delete app data by typing %Localappdata%, and find and locate the Stable diffusion folder.

If you cannot find the folder, do not worry. Please ignore it.

  • Please delete temporary files by running the command %temp% in the Run command box.
  • Resatart your system.
  • Go to D drive and Create a Fresh Folder name Stable Diffusion
  • Download the file from the Git library and extract it to the newly created Stable Diffusion folder in the D drive.

After the download the file successfully, follow the next step.

4. Run The “Webui-User.Bat” File As Administrator

  • Find and Locate Webui-User.Bat File
  • Right-click on it and Click On the run as Administrator.

Now try launching the Stable Diffusion, and You can access it without any error.

I hope you found this article useful and Finally fixed the Error code 128. Now you can start to create your favourite illustrations without the help of an expert.