Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
24372b5
Add toggles to the UI to add flipped versions of the datasets, X, Y o…
jaretburkett Aug 24, 2025
f48d21c
Upgrade a LoRA rank if the new one is larger so users can increase th…
jaretburkett Aug 24, 2025
ea01a1c
Fixed a bug where samples would fail if merging in lora on sampling f…
jaretburkett Aug 25, 2025
119653c
Force width, height, and num frames to always be the proper sizes for…
jaretburkett Aug 25, 2025
37eda7b
Add a tab to the UI to show the config file for the job. Read only.
jaretburkett Aug 25, 2025
d0338b8
Allow dropping images directly into dataset folder without having to …
jaretburkett Aug 25, 2025
5ad190b
Improve UI for sample images when there are no samples
jaretburkett Aug 27, 2025
fd13bd7
Add a Download button on samples to download all the samples as a zip…
jaretburkett Aug 27, 2025
1f541bc
Changes to handle a different DFE arch
jaretburkett Aug 27, 2025
fc5b416
Switch order to save first, then sample.
jaretburkett Aug 27, 2025
9ef425a
Fixed issue with training qwen with cached text embeds with a batch s…
jaretburkett Aug 28, 2025
e334941
Updated runpod docs
jaretburkett Aug 28, 2025
056711d
Fix issue with wan22 14b that woudl load both transformers temporaril…
jaretburkett Aug 28, 2025
6fc9ec1
Added example config for training wan22 14b 24GB on images
jaretburkett Aug 28, 2025
193c1b2
Add a watcher to constantly check for stop signal from the UI. This w…
jaretburkett Aug 31, 2025
0f2239c
Add force sample toggle to the ui
jaretburkett Aug 31, 2025
7040d8d
Preperation for audio
jaretburkett Sep 2, 2025
85dcae6
Set full size control images to default true
jaretburkett Sep 2, 2025
f699f4b
Add ability to set transparent color for control images
jaretburkett Sep 2, 2025
6450467
Comment out fast stop watcher. Could potentiallty be causing some wei…
jaretburkett Sep 4, 2025
af6fdaa
Add ability to train a full rank LoRA. (experimental)
jaretburkett Sep 9, 2025
b95c17d
Add initial support for chroma radiance
jaretburkett Sep 10, 2025
3666b11
DEF for fake vae and adjust scaling
jaretburkett Sep 13, 2025
218f673
Added support for new concept slider training script to CLI and UI
jaretburkett Sep 16, 2025
24a576a
Regularize the slider targets.
jaretburkett Sep 17, 2025
2120dc5
Upgrade job to new ui trainer to fix issue with slider config showing…
jaretburkett Sep 17, 2025
e4ae97e
add dataset-level distillation-style regularization
squewel Sep 17, 2025
e27e229
add prior_reg flag to FileItemDTO
squewel Sep 17, 2025
3cdf50c
Merge pull request #426 from squewel/prior_reg
jaretburkett Sep 18, 2025
390e21b
Integrate dataset level trigger words and allow them to be cached. De…
jaretburkett Sep 18, 2025
20dfe1b
Small double tap of detach on qwen just for good measure
jaretburkett Sep 18, 2025
28728a1
Added experimental dfe 5
jaretburkett Sep 21, 2025
f744751
Add stepped loss type
jaretburkett Sep 22, 2025
454be09
Initial support for qwen image edit plus
jaretburkett Sep 24, 2025
1069dee
Added ui sopport for multi control samples and datasets. Added qwen i…
jaretburkett Sep 25, 2025
0eaa3d2
Merge pull request #434 from ostris/qwen_image_edit_plus
jaretburkett Sep 25, 2025
e04f55c
Fixed scaling issue with control images
jaretburkett Sep 26, 2025
be99063
Remove dropout from cached text embeddings even if used specifies it …
jaretburkett Sep 26, 2025
6da4172
Add extra detachments just to be sure on qiep
jaretburkett Sep 27, 2025
3b1f7b0
Allow user to set the attention backend. Add method to recomver from …
jaretburkett Sep 27, 2025
98d35f3
Add hidream ARA
jaretburkett Sep 27, 2025
f0646a0
Reworked ui sample image modal to show more information and function …
jaretburkett Sep 27, 2025
4e207d9
Add seed to the sample image modal
jaretburkett Sep 28, 2025
c20240b
Add advanced menu on job to allow user to do things like make a job a…
jaretburkett Sep 28, 2025
c233a80
Reqorked visibility toggle on samples, should help when dealing with …
jaretburkett Sep 28, 2025
ebadb32
On samples page, auto scroll to bottom on load. Added a floating butt…
jaretburkett Sep 29, 2025
2e9de5e
Add ability to delete samples from the ui
jaretburkett Sep 29, 2025
6a77b0c
Merge branch 'main' into gs/merge-main
gschoeni Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a watcher to constantly check for stop signal from the UI. This w…
…ill force a stop within 2 seconds instead of having to wait on a long hung process.
  • Loading branch information
jaretburkett committed Aug 31, 2025
commit 193c1b2dfab7a8ef1732e1ede9fdbade42c1af11
47 changes: 46 additions & 1 deletion extensions_built_in/sd_trainer/UITrainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import concurrent.futures
from extensions_built_in.sd_trainer.SDTrainer import SDTrainer
from typing import Literal, Optional

import threading
import time
import signal

AITK_Status = Literal["running", "stopped", "error", "completed"]

Expand All @@ -30,6 +32,49 @@ def __init__(self, process_id: int, job, config: OrderedDict, **kwargs):
self._async_tasks = []
# Initialize the status
self._run_async_operation(self._update_status("running", "Starting"))
self._stop_watcher_started = False
self.start_stop_watcher(interval_sec=2.0)

def start_stop_watcher(self, interval_sec: float = 5.0):
"""
Start a daemon thread that periodically checks should_stop()
and terminates the process immediately when triggered.
"""
if getattr(self, "_stop_watcher_started", False):
return
self._stop_watcher_started = True
t = threading.Thread(
target=self._stop_watcher_thread, args=(interval_sec,), daemon=True
)
t.start()

def _stop_watcher_thread(self, interval_sec: float):
while True:
try:
if self.should_stop():
# Mark and update status (non-blocking; uses existing infra)
self.is_stopping = True
self._run_async_operation(
self._update_status("stopped", "Job stopped (remote)")
)
# Best-effort flush pending async ops
try:
asyncio.run(self.wait_for_all_async())
except RuntimeError:
pass
# Try to stop DB thread pool quickly
try:
self.thread_pool.shutdown(wait=False, cancel_futures=True)
except TypeError:
self.thread_pool.shutdown(wait=False)
print("")
print("****************************************************")
print(" Stop signal received; terminating process. ")
print("****************************************************")
os.kill(os.getpid(), signal.SIGINT)
time.sleep(interval_sec)
except Exception:
time.sleep(interval_sec)

def _run_async_operation(self, coro):
"""Helper method to run an async coroutine and track the task."""
Expand Down