How To Open Stable Diffusion WebUI In Dark Mode

Your Stable Diffusion Automatic1111 WebUI opens in light mode and you can’t find the setting to change it? We’re here to help – here are two ways to change the default theme of the WebUI from light to dark, and the other way around! Stable Diffusion WebUI opening in light mode? – Here is aquick fix.

Why Does The Automatic1111 WebUI Open In Light Mode?

If you’ve been using the WebUI for quite some time in dark mode and it suddenly opens up and surprises your eyes with an unpleasant light bath it might be because you’ve opened it in a browser that forces websites and web apps to open in light mode by default.

As Stable Diffusion is based on the Gradio front-end framework, it does what Gradio-based apps do by default – it uses your default browser theme as the theme for the application.

While there isn’t any dedicated button for changing the mode from light to dark in the WebUI interface itself, you can change this setting in two different ways. Here they are.

How Do You Force Stable Diffusion WebUI Into Dark Mode?

There are two main ways of switching the WebUI from light to dark mode and the other way around.
There are two main ways of switching the WebUI from light to dark mode and the other way around.

To put Automatic1111 WebUI in dark mode and make it stay that way you need to edit the .bat file which is used to start the program and insert a command line argument that will change the mode to dark each time the program starts up.

Here is how do to this in just a few steps:

  1. Open the directory you have the WebUI installed in.
  2. Edit the webui-user.bat file with a text editor of your choice.
  3. In the line with the “set COMMANDLINE_ARGS=” variable add in the “–theme dark” flag.
  4. Now the full line should look like this: “set COMMANDLINE_ARGS= –theme dark” (plus your other optional flags if you’re using them).
  5. Save the file and restart your WebUI. All done!
This is how our webui-user.bat file looks after inserting the dark theme flag (yours might look a little bit different).
This is how our webui-user.bat file looks after inserting the dark theme flag (yours might look a little bit different).

Done! Now the WebUI will always open in dark mode, regardless of what browser you access it through.

A Quicker Temporary Dark Mode Fix For The Impatient

An alternative way of switching the WebUI to dark mode is appending “/?__theme=dark” at the end of the WebUI URL in your browser search bar.

Edit the URL to look like this: “http://127.0.0.1:7860/?__theme=dark” and then refresh the page. The WebUI should now display in dark mode.

Keep in mind that when refreshing the page you’ll lose all the text that’s in your input fields, so copy that over into a notepad if necessary.

This quick fix is not persistent and you’d have to do this every single time you open up the WebUI. It’s much better to change the mode setting in the commandline arguments as shown above.

How To Make The Stable Diffusion WebUI Open With Light Theme?

If you prefer a light theme for one reason or the other, the fix is pretty much the same.

To force the WebUI into light mode, instead of inserting the “–theme dark” flag into the webui-user.bat file, inser the “–theme light” flag.

After you save the file and restart the WebUI it should now be forced into light mode each time it opens up, regardless of your default browser theme.

Similarily, you can opt for the quicker way of doing this by editing the WebUI URL to be “http://127.0.0.1:7860/?__theme=light” and then refreshing the page.

Did You Know? – Stable Diffusion WebUI Gradio Themes

The Automatic1111 supports hundreds of Gradio themes you can choose from.
The Automatic1111 supports hundreds of Gradio themes you can choose from.

You might have not known about this, but you can use lots of different Gradio compatible themes with the Automatic1111 WebUI, not only the plain light & dark themes we’re all used to. Browse the themes from the huggingface Gradio Theme Gallery if you need some inspiration.

You can change the default WebUI theme to any other Gradio compatible theme in this menu.
You can change the default WebUI theme to any other Gradio compatible theme in this menu.

To access the Gradio theme selection menu, enter the Settings tab, then locate and open the User Interface menu on the left sidebar. Here in the dropdown menu you can change the plain default theme to any other theme made for Gradio apps.

Hope we helped you with your problem and now you’ll be able to enjoy your WebUI just the way you like it. Until next time and happy generating!

Check out also: How To Train Own Stable Diffusion LoRA Models – Full Tutorial!

Tom Smigla
Tom Smiglahttps://techtactician.com/
Tom is the founder of TechTactician.com with years of experience as a professional hardware and software reviewer. Armed with a master’s degree in Cultural Studies / Cyberculture & Media, he created the "Consumer Usability Benchmark Methodology" to ensure all the content he produces is practical and real-world focused.

Check out also:

Latest Articles