Skip to content

Added Gradio WebUI for browser-based training#1330

Draft
krigeta wants to merge 4 commits intoNerogar:masterfrom
krigeta:webui-concepts-fix
Draft

Added Gradio WebUI for browser-based training#1330
krigeta wants to merge 4 commits intoNerogar:masterfrom
krigeta:webui-concepts-fix

Conversation

@krigeta
Copy link
Copy Markdown

@krigeta krigeta commented Feb 18, 2026

Summary

This PR adds a browser-based WebUI for OneTrainer using Gradio 5.x. The WebUI is a complete replica of the existing desktop UI, accessible through any web browser.

What's Added

  • New WebUI module (modules/webui/) — complete Gradio interface with all tabs
  • All training features — model selection, training parameters, concepts, sampling, LoRA, cloud config
  • Real-time training — progress bars, status updates, ETA display
  • Dark/light theme toggle — persists across sessions
  • Zero modifications to existing OneTrainer code — completely non-destructive

New Files

  • modules/webui/app.py — main Gradio application
  • modules/webui/webui_state.py — thread-safe training state
  • modules/webui/webui_bridge.py — training lifecycle management
  • modules/webui/config_io.py — config serialization helpers
  • modules/webui/tabs/*.py — 11 tab modules (general, model, data, concepts, training, sampling, backup, tools, embeddings, lora, cloud)
  • scripts/train_webui.py — WebUI entry point
  • requirements-webui.txt — Gradio dependency
  • start-webui.bat — Windows launch script

How to Use

Install Gradio:
pip install -r requirements-webui.txt

Launch WebUI:
python scripts/train_webui.py

Or on Windows:
start-webui.bat

Then open http://localhost:7860 in your browser.

Features

  • ✅ All 11 tabs from desktop UI replicated
  • ✅ Model type/training method switching with conditional fields
  • ✅ Dynamic concept/sample/embedding lists
  • ✅ Real-time training progress and control
  • ✅ Start/stop/sample/backup/save controls
  • ✅ Config preset save/load
  • ✅ Dark/light theme toggle
  • ✅ Works alongside existing desktop UI (no conflicts)

Testing

Tested on Windows 11 with:

  • Gradio 5.0.0+
  • Full training workflow (config, concepts, sampling, training execution)

Notes

  • The WebUI reuses all existing backend code (create_trainer, TrainCallbacks, TrainCommands, TrainConfig)
  • No breaking changes to existing functionality
  • Desktop UI continues to work exactly as before
  • All files are isolated in new modules/webui/ directory

@krigeta krigeta changed the title fix: WebUI concepts tab redesign and sampling file I/O Added Gradio WebUI for browser-based training Feb 18, 2026
@yamatazen
Copy link
Copy Markdown

Any screenshots?

@thecat99z
Copy link
Copy Markdown

Any screenshots?

2026-02-18 16-52-13 2026-02-18 16-52-52 2026-02-18 16-53-11 2026-02-18 16-59-26

But training doesn't work for what I've tried. It doesn't load any of the json presets and tweaking manually doesn't work too since it's then stuck to SD 1.5 training parameters.

@onerok
Copy link
Copy Markdown

onerok commented Feb 18, 2026

It doesn't load any of the json presets and tweaking manually doesn't work too since it's then stuck to SD 1.5 training parameters.

Same.

Looks promising, but @krigeta needs to do some work before submitting this PR.

@dxqb
Copy link
Copy Markdown
Collaborator

dxqb commented Feb 19, 2026

This looks surprisingly complete for a first draft.

  • how was generative AI used in creating this code? just to better understand the choices that were made. For example: some fields are missing. Was that your choice, or just AI doing AI things?
  • switching between tabs is slow on my PC, which is surprising for a webUI. between the more heavy tabs such as training and concepts it can take 10-20 seconds, and I got a popup that something is slowing down Firefox.
    The UI being slow is the main complaint about the tkinter UI and why people are asking for an alternative UI.
  • somewhat related to the AI question: do you see any chance to abstract the current tkinter code into code that is frontend independent, and is then used by both UIs?
    Simple example:
    Here
    https://github.com/krigeta/OneTrainer/blob/f0c7baae9593b4bf9953b49d7a73bced08b79656/modules/webui/tabs/training_tab.py#L76
    and here
    components.label(frame, 2, 0, "Learning Rate",

    the same entry components are created in webUI and tkinter, respectively - with labels and tooltips in both code files.
    It's not maintainable to duplicate all this data.

@dxqb dxqb marked this pull request as draft February 21, 2026 06:33
@dxqb dxqb added the followup Failure to provide config or other info or needs followup label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

followup Failure to provide config or other info or needs followup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants