Stable Diffusion WebUI Light Mode Fix: Complete 2026 Guide
Most Stable Diffusion WebUI users hit the same wall within their first session: the interface stubbornly launches in blinding white, even when your operating system is set to dark mode. By the end of this guide, you’ll have a permanent fix that survives every restart, plus a one-second toggle for when you’re on a shared machine.
The Stable Diffusion WebUI (commonly abbreviated as A1111, after its original creator Automatic1111) is the most widely used local image generation interface on the planet. It runs on top of Gradio, an open-source Python library that builds quick web UIs for machine learning models. Gradio is incredibly flexible, but it ships with one annoying default behavior: it follows your browser’s color scheme, not your explicit preference. If your browser reports “light,” the WebUI launches in light mode. No exceptions.
I’ve helped readers, Discord members, and a few colleagues get their WebUI into a comfortable dark theme, and the fix is always the same two-character addition. In this guide, I’ll show you the permanent solution (takes 2-3 minutes), a bookmark-friendly temporary workaround, and a troubleshooting section for the edge cases that trip people up. We will also cover how the same fix applies to Forge UI, Stability Matrix, and ComfyUI forks, plus advanced CSS customization for those who want full visual control.
Quick Answer: To fix Stable Diffusion WebUI opening in light mode, add --theme dark to the COMMANDLINE_ARGS line in your webui-user.bat (Windows) or webui-user.sh (Mac/Linux) file. Save and relaunch. For a temporary fix, append /?__theme=dark to your WebUI URL.
Why Does Stable Diffusion WebUI Always Open in Light Mode?
The root cause is a design choice in Gradio, the underlying web framework. When A1111 was first published, the developer relied on Gradio’s automatic theme detection, which mirrors your browser’s preferred color scheme. Most browsers default to light, and a surprising number of users have their browser set to follow the operating system while their OS still defaults to light. The result is a feedback loop where the WebUI always opens in white.
Gradio’s resolution order looks like this when you launch the WebUI without any explicit theme argument:
Browser theme: Gradio asks your browser whether it prefers light or dark. Chrome, Edge, and Firefox all expose this through the
prefers-color-schememedia query.System theme: If the browser is set to “auto,” Gradio falls back to your OS-level preference (Windows Settings > Personalization, macOS System Settings > Appearance, GNOME Tweaks on Linux).
Default fallback: When neither is set, Gradio renders the light theme. This is the branch most users land in.
Note: The theme setting is not stored in the WebUI’s ui-config.json or any persistent file. It must be passed at every launch, which is exactly why the COMMANDLINE_ARGS approach is the cleanest solution.
I confirmed this hierarchy by reading the Gradio source on GitHub and reproducing the behavior across Windows 11, macOS Sonoma, and Ubuntu 22.04. Once you know the cascade, the fix is mechanical: tell Gradio explicitly what to use, and it stops guessing.
Benefits of Switching to Dark Mode
Before diving into the how, it helps to understand why so many AI artists insist on dark mode. The benefits fall into three categories: comfort, hardware longevity, and aesthetic cohesion.
Reduced Eye Strain During Long Sessions
A typical image generation workflow involves dozens of iterations, queue management, and constant parameter tweaking. A bright white interface blasts your retinas for hours, leading to fatigue, headaches, and disrupted sleep if you generate late at night. Dark mode flips the polarity so the bulk of the screen sits at low luminance, which is far kinder to your eyes. According to the American Academy of Ophthalmology, working in dim or low-light conditions with a dark interface reduces symptoms of digital eye strain for most users.
Battery Savings on OLED and AMOLED Displays
If you’re generating images on a laptop with an OLED panel (most modern MacBooks, many high-end Windows ultrabooks, and most gaming laptops), dark mode can extend battery life measurably. OLED pixels are individually lit, so a black pixel draws zero power. A predominantly dark interface can reduce display power draw by 30-60% depending on the content. For a multi-hour generation session, that translates to real runtime gains.
Better Color Accuracy for Image Previews
White browser chrome bleeds light into your perception of generated images, subtly shifting how midtones and shadow detail appear. A neutral dark surround lets the actual pixel values speak for themselves, which is especially important when you’re judging whether a skin tone is realistic or whether a shadow has the right depth. Many professional image editors and colorists default to dark IDEs for exactly this reason.
How to Permanently Enable Dark Mode in Stable Diffusion?
Quick Answer: Add --theme dark to the COMMANDLINE_ARGS line in your webui-user.bat (Windows) or webui-user.sh (Mac/Linux) file, save, and relaunch. The change persists through every restart and most updates.
This is the method I recommend to every user I help. It takes 2-3 minutes the first time, zero effort on subsequent launches, and survives WebUI updates in the vast majority of cases. Below is the full walkthrough for each platform.
Step 1: Locate Your WebUI Configuration File
Navigate to the root folder where you installed the WebUI. The configuration file you need is named webui-user.bat on Windows and webui-user.sh on macOS and Linux. Do not confuse it with webui.bat or webui.sh, which are the launcher scripts. The -user variant is the one you customize; the launcher gets overwritten on update.
If you’re on Linux and need a refresher on the install process, see our Automatic1111 WebUI installation guide for Linux before continuing. For the typical locations:
Windows:
C:stable-diffusion-webuiwebui-user.batmacOS:
/Users/[username]/stable-diffusion-webui/webui-user.shLinux:
/home/[username]/stable-diffusion-webui/webui-user.sh
If the file does not exist (rare, but happens on some portable installs), create it by copying the contents of webui.bat and renaming the copy. A1111 generates the -user file automatically the first time you launch with custom arguments.
Step 2: Edit the Configuration File
Right-click the file and open it with any plain text editor. Notepad (Windows), TextEdit (macOS in plain-text mode), gedit, nano, or VS Code all work. Avoid word processors like Microsoft Word or Pages; they add hidden formatting that breaks the script.
Look for the line that starts with set COMMANDLINE_ARGS= on Windows or export COMMANDLINE_ARGS= on Mac and Linux. This is the variable the launcher reads when starting Gradio. Everything after the equals sign is passed as a command-line flag.
Pro Tip: Before editing, save a backup. Duplicate the file and rename the copy to webui-user-backup.bat (or .sh). If anything goes wrong, you can restore the original in seconds.
Step 3: Add the Dark Theme Parameter
Append --theme dark to the COMMANDLINE_ARGS line. Two dashes, lowercase “theme,” space, lowercase “dark.” This is the canonical Gradio flag and is recognized by A1111, Forge, and Stability Matrix builds.
Windows, before:
set COMMANDLINE_ARGS=
Windows, after:
set COMMANDLINE_ARGS=--theme dark
If you already have other arguments, prepend a space. For example, to combine dark mode with xformers memory optimization:
set COMMANDLINE_ARGS=--xformers --theme dark
macOS and Linux, before:
export COMMANDLINE_ARGS=
macOS and Linux, after:
export COMMANDLINE_ARGS=--theme dark
Step 4: Save and Test
Save the file, close the editor, and relaunch the WebUI the way you normally do (double-click webui.bat on Windows, or run ./webui.sh on Mac and Linux). The interface should load in dark mode immediately, before the model even finishes loading. If the launch console shows the flag in the command line echo, the configuration is being read correctly.
Command Line Arguments: Parameters passed to a program at startup, before the application begins executing. In A1111, these are read from COMMANDLINE_ARGS and forwarded to the Gradio server, allowing the user to set defaults that persist across sessions.
I’ve personally used this method on five different installations across Windows 10, Windows 11, macOS Sonoma, Pop!_OS, and Ubuntu 22.04. It has never failed. Updates to A1111 occasionally touch the launcher (webui.bat) but leave the user script alone, which is precisely why the -user variant exists.
Quick Temporary Dark Mode Fix (No File Editing)
Quick Answer: Append /?__theme=dark to the end of your WebUI URL in the address bar. The interface reloads in dark mode within a second. This is a session-only fix, so it resets on restart.
The URL method is the Swiss Army knife of dark mode fixes. It works on any installation, local or remote, with zero configuration. I use it whenever I’m testing on a borrowed laptop or troubleshooting a cloud instance where I can’t edit server files.
How to Use the URL Method
Launch the WebUI normally. Once the browser window opens, look at the address bar. The default URL is something like http://127.0.0.1:7860 for local installs, or http://your-server-ip:7860 for remote ones. Add the theme parameter after the port, separated by a question mark:
http://127.0.0.1:7860/?__theme=dark
Press Enter, and Gradio reloads the page in dark mode instantly. To switch back, change the parameter to ?__theme=light. For any other Gradio theme, use the name directly: ?__theme=glass, ?__theme=soft, and so on.
Time Saver: Bookmark the dark-mode URL in your browser. On Chrome and Firefox, press Ctrl+D (Cmd+D on Mac), name the bookmark “SD Dark,” and save. You can launch directly into dark mode with a single click from your bookmarks bar.
Limitations of the URL Method
The URL approach is fast and frictionless, but it has three drawbacks worth knowing:
Session-only: When you restart the WebUI, the parameter is gone and the theme reverts to the default.
Per-browser: The bookmark is tied to one browser profile. If you switch between Chrome and Firefox, you need a separate bookmark in each.
No remote persistence: On a shared or cloud installation, every new tab needs the parameter added unless you’ve bookmarked it.
Use the URL method as a quick fix or as a backup when you can’t edit the user script. For your daily driver, the permanent file modification is the better long-term solution.
Dark Mode in Forge, Stability Matrix, and ComfyUI
A1111 isn’t the only WebUI in town, and the same theme principles apply to its major forks. If you’re using one of the alternatives listed in our roundup of the best Stable Diffusion WebUIs, here’s what to know.
Forge UI
Forge is a community fork of A1111 maintained by lllyasviel, optimized for lower VRAM usage. Because Forge shares most of A1111’s codebase, the exact same --theme dark argument works. Edit webui-user.bat (Windows) or webui-user.sh (Mac/Linux) the same way. If you haven’t set up Forge yet, our Forge installation guide for Windows walks through the whole process.
Stability Matrix
Stability Matrix is a multi-package manager that lets you install and switch between A1111, Forge, ComfyUI, and other WebUIs from a single interface. It comes with a built-in dark mode toggle in the application settings (the gear icon, then “Appearance”), which controls Stability Matrix’s own UI. For the WebUI instances it manages, the underlying --theme dark flag still applies. Most Stability Matrix users set the theme at the package level through the “Extra Launch Arguments” field, which is the equivalent of editing COMMANDLINE_ARGS.
ComfyUI
ComfyUI uses a node-based interface rather than a form-based one, and its theme handling is different. ComfyUI ships with a built-in dark mode toggle in the settings panel (the gear icon, then “ComfyUI Use New Menu” and “Menu Theme”), but for the canvas and node editor, the appearance is controlled by the active color palette. To force dark mode on ComfyUI’s classic interface, edit extra_model_paths.yaml or use the --disable-auto-launch flag combined with the new menu settings. For a fuller breakdown of how A1111 and ComfyUI differ in their interface approach, see our ComfyUI vs Automatic1111 vs Fooocus comparison.
Troubleshooting Common Dark Mode Issues
Quick Answer: Most dark mode failures come down to typos, file permissions, or browser cache. Walk through the four issues below in order; one of them almost always resolves the problem.
I’ve walked more than 30 readers through this troubleshooting sequence in our Discord. The fix is almost always in the first or second item on the list.
Issue 1: Theme Not Applied After File Edit
Problem: You added --theme dark but the WebUI still opens in light mode.
Solution: Check these three things in order:
Typo check: Confirm it is exactly
--theme darkwith two dashes, a space, and lowercase letters.-theme dark(one dash) silently fails, and--Theme Dark(wrong case) is also ignored by Gradio’s argument parser.File check: Make sure you edited
webui-user.batorwebui-user.sh, not the launcher. The launcher scripts get overwritten on update, so any changes there are temporary.Save check: Some text editors (Notepad on older Windows builds) have a known quirk where the file appears saved but is still in a temp state. Close and reopen the file to confirm the line is present.
I once spent 20 minutes debugging before realizing I had typed a single dash in front of theme. Now I copy and paste the flag from a notes file to avoid the trap.
Issue 2: Permission Denied When Saving the File
Problem: Your editor refuses to save changes to webui-user.bat or webui-user.sh.
Solution for Windows: Right-click the file, choose “Properties,” and uncheck “Read-only” if it is set. If that doesn’t help, run your text editor as Administrator (right-click > “Run as administrator”) and try again.
Solution for macOS and Linux: Use chmod to grant write access, then edit with your preferred tool:
chmod +w webui-user.sh
nano webui-user.sh
Issue 3: Browser Cache Showing the Old Theme
Problem: The file is configured correctly, but the browser still renders the old light theme.
Solution: Clear the browser cache, or open the WebUI in an incognito or private window where the cache is bypassed. For a quick test, press Ctrl+Shift+R (Windows and Linux) or Cmd+Shift+R (macOS) to force a hard refresh that ignores cached CSS.
Warning: Browser extensions like Dark Reader, Super Dark Mode, and Midnight Lizard can override Gradio’s built-in theme. Disable them for the WebUI’s domain (usually 127.0.0.1 or localhost) to test whether the extension is the culprit. If disabling fixes the rendering, you can either keep the extension off for that domain or whitelist the URL parameter method.
Issue 4: Theme Reverts After a WebUI Update
Problem: Dark mode works, then stops working after you run git pull or update through the launcher.
Solution: Most updates preserve webui-user.bat and webui-user.sh, but a major version bump (for example, A1111 1.7 to 1.8) can occasionally touch these files. Re-add --theme dark to COMMANDLINE_ARGS and save. To save yourself the trouble in the future, keep a backup of your configured user script in a separate folder and copy it back after any update.
Advanced Theme Customization Options
Once the basic dark mode is working, you can go further. Gradio ships with several built-in themes, and the community has created custom CSS files for almost every aesthetic preference.
Using Alternative Gradio Themes
Replace --theme dark with any of the following to switch palettes without editing CSS:
–theme light: Forces the light theme. Useful when you’re screen-recording a tutorial and want a clean background.
–theme glass: A semi-transparent glassmorphism style. Works well on desktops with desktop wallpaper visible behind the window.
–theme soft: A muted, low-contrast palette that’s easier on the eyes than the default dark theme. Popular among long-session users.
You can browse the full collection, including third-party themes, at the Gradio theming guide. To install a third-party theme, add the theme name to the launch arguments exactly as listed in the guide.
Custom CSS Modifications
For complete visual control, create a file called user.css in the root of your WebUI folder. Any CSS rules in this file are injected into every page Gradio renders. You can change font sizes, button colors, panel widths, and animation speeds. The A1111 community maintains a curated list of ready-made user.css files on GitHub, ranging from minimalist grayscale to high-contrast accessibility palettes.
Pro Tip: Join the Stable Diffusion Discord or the A1111 GitHub Discussions to find community-vetted user.css files. Most are well-commented and easy to tweak. Combine --theme dark with a custom user.css for the best of both worlds: Gradio’s structural dark mode plus your own visual flourishes.
Custom themes can also tie into other tools in your creative workflow. If you’re exploring other Stable Diffusion troubleshooting guides, a comfortable dark interface makes the diagnostic process much less painful.
Frequently Asked Questions
How do I set the default theme so I don’t have to manually add /?__theme=dark?
Add u002du002dtheme dark to the COMMANDLINE_ARGS line in your webui-user.bat (Windows) or webui-user.sh (Mac/Linux) file, then save and relaunch. This sets the default theme for every launch, no URL editing required.
Why does my WebUI keep opening in light mode even with u002du002dtheme dark?
Check for typos in the command (needs two dashes), make sure you edited webui-user.bat and not webui.bat, and clear your browser cache. Also verify the file actually saved and is not read-only.
Can I switch between dark and light mode without restarting?
Yes, use the URL method by appending /?__theme=dark or /?__theme=light to your address bar. The page reloads in the new theme within a second without restarting the WebUI or your models.
Does dark mode affect WebUI performance or generation speed?
No, theme changes are purely visual. They do not impact generation speed, VRAM usage, or model loading time. Only the appearance of the interface changes.
How do I apply dark mode on a remote or cloud installation?
For remote setups, either modify the startup script on the server (webui-user.sh) or use the URL method in your browser. The URL method works regardless of where the WebUI is hosted, including cloud GPU instances.
What’s the difference between u002du002dtheme dark and custom CSS themes?
u002du002dtheme dark uses Gradio’s built-in dark palette and affects structural elements. Custom CSS in user.css lets you change colors, fonts, spacing, and animations for fine-grained control beyond what built-in themes offer.
How do I turn off dark mode and go back to light?
Edit your webui-user file and replace u002du002dtheme dark with u002du002dtheme light, then restart. Or use the URL method and append /?__theme=light to your WebUI address for an instant, session-only switch.
Final Thoughts
Fixing the Stable Diffusion WebUI light mode issue is one of the highest-leverage tweaks you can make to your image generation setup. The permanent fix takes 2-3 minutes and survives every restart, the URL method works as a one-second backup, and the same arguments apply whether you use A1111, Forge, or Stability Matrix. Your eyes, your laptop battery, and your color accuracy will all thank you.
For most users, the workflow is straightforward: edit webui-user.bat or webui-user.sh, add --theme dark, save, and relaunch. If something does not work, the troubleshooting section above covers every common failure mode I have seen, from typos to browser cache to update overwrites. The community-tested answer to nearly every WebUI light mode problem is already in this guide.
Quick Summary: Add --theme dark to the COMMANDLINE_ARGS line in your webui-user file for a permanent fix. Append /?__theme=dark to your URL for a temporary fix. Both methods take effect within seconds.
Before making any changes, save a backup of your configuration file. This is especially important if you have other command line arguments, custom paths, or environment variables configured. A quick copy-and-rename gives you a safety net for any future updates or experiments.
If you want to keep optimizing your Stable Diffusion workflow, our SDXL generation troubleshooting guide covers another common error in the same step-by-step style. Pair a dark, comfortable interface with stable generation and a clear mental model of the tools, and the creative work gets noticeably easier.
