Skip to content

Qt UI file split#1565

Merged
dxqb merged 50 commits into
mergefrom
pyside_copy
Jul 1, 2026
Merged

Qt UI file split#1565
dxqb merged 50 commits into
mergefrom
pyside_copy

Conversation

@dxqb

@dxqb dxqb commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR copies all Ctk files of #1445 to Qt files. It doesn't implement them yet, just copy. The implementation is in #1446

I'll keep this a separate commit in git history, for good "blame" tracability ("what has changed between Ctk and Qt")

dxqb and others added 30 commits May 10, 2026 14:11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… VideoToolUI

Removes abstract _create_browse_dir_button/_create_browse_file_button from
BaseVideoToolUIView and uses the combined path_entry component instead, fixing
widget alignment issues. Adds allow_video_files flag to path_entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…IView

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…files)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Base view concrete methods were accessing self.controller, self.ui_state,
and toolkit-specific action methods that were only set by CTK subclass
__init__ after the base __init__ call, with no enforcement in the base.

- BaseTrainUIView: add controller/ui_state as constructor params; fix
  sync_cloud_secrets to use controller.train_config; add @AbstractMethod
  for export_training, generate_debug_package, open_profiling_tool
- CtkTrainUIView: reorder __init__ to create deps before base init call;
  replace self.train_config with self.controller.train_config
- BaseCloudTabView: add controller as constructor param
- CtkCloudTabView: pass controller to base __init__, drop redundant assignment
- BaseCaptionUIView: add ABC + @AbstractMethod for 6 action callbacks
- BaseConceptTabView: remove concrete _update_filters() (accessed CTK vars);
  add ConceptConfig import; add concept: ConceptConfig param to
  BaseConceptWidgetView.__init__
- CtkConceptTabView: implement _update_filters(); pass concept to base init
- BaseConceptWindowView: initialize bucket_ax/text_color/canvas to None
- BaseTrainingTabView: replace callbacks dict with 6 @AbstractMethod
  declarations; restore_optimizer_config(variable: str) matches controller
- CtkTrainingTabView: implement all 6 abstract methods directly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ctypes DPI awareness call is toolkit-specific (fixes CTK transparency
on Windows monitor changes). It already exists in CtkTrainUIView.py and
has no place in the toolkit-agnostic controller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
search_var/filter_var/show_disabled_var were stored in the base but never
used there after _update_filters() was removed. Subclasses manage them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirrors the change from upstream commit e928dda (Remove COFT #1447),
which removed COFT from LoraTab.py. The merge didn't carry it across
the rename to CtkLoraTabView.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brings in upstream changes (remove COFT #1447, remove cautious_mask #1451,
fix aux optimizer defaults #1444). Conflicts resolved by keeping the
ctk_abstraction refactored versions (self.components, controller delegation).
COFT removal applied manually to BaseLoraTabView.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eep ctk_abstraction for UI conflicts

- Apply LoKr and Scaled OFT additions to BaseLoraTabView/LoraTabController
- Apply ETA session-tracking fix to TrainUIController
- Apply local row counter fix to BaseTrainingTabView.__create_text_encoder_frame
- Keep both supported_caption_extensions and json_path_modifier in path_util

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Was sitting on the same row at columns 3-4; now on its own row directly
below the toggle for clearer visual grouping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Was sitting on the same row at columns 3-4; now on its own row directly
below the toggle for clearer visual grouping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erge

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dxqb and others added 20 commits June 13, 2026 11:04
# Conflicts:
#	modules/ui/BaseConceptWindowView.py
#	modules/ui/CtkConceptWindowView.py
# Conflicts:
#	modules/ui/BaseConceptWindowView.py
#	modules/ui/BaseTimestepDistributionWindowView.py
#	modules/ui/BaseTrainingTabView.py
#	modules/ui/CtkConceptWindowView.py
#	modules/ui/CtkTimestepDistributionWindowView.py
#	modules/ui/CtkTrainingTabView.py
previous_image/next_image called self.view.switch_image, but switch_image
lives on the controller, not the view; arrow keys raised AttributeError.
Also convert the _make_svd_frames docstring to a # comment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… split

The Base/Ctk/Controller refactor deleted modules/ui/CaptionUI.py,
ConvertModelUI.py and VideoToolUI.py, but the three entry scripts still
imported them, crashing on launch with ModuleNotFoundError. Wire each script
through the new controller + create_window(parent, view_cls) pattern (as
TrainUIController already does internally).

The new views are CTkToplevel, not CTk roots, so launch them under a hidden
CTk root and wait_window on the toplevel to avoid a stray empty "tk" window
and to exit cleanly on close.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The ctk view refactor moved ConceptWindow.__download_dataset into the new
ConceptWindowController.download_dataset from a base predating PR #1524, which
silently reverted that PR's fix: the method again called
huggingface_hub.login(token=..., new_session=False) with no empty-token guard.

new_session was removed from login() in huggingface-hub 1.16, so every call
raised TypeError, swallowed by the surrounding except, so snapshot_download
never ran and dataset download was fully broken. Re-apply #1524 at the new
location: only login when a token is configured, and drop new_session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Base/Ctk refactor renamed UIState to BaseUIState (UIState.py) plus
CtkUIState (CtkUIState.py) and updated validation.py, but missed the ctk
sibling: ctk_validation.py still imported the now-nonexistent UIState under
TYPE_CHECKING. Point it at CtkUIState, the concrete state actually passed to
these ctk validators (mirroring validation.py -> BaseUIState).

Invisible to ruff and the runtime (used in a string annotation, under
TYPE_CHECKING, with future annotations), so only a type checker would flag it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BaseConfigListView and BaseAdditionalEmbeddingsTabView imported customtkinter
solely for a `-> ctk.CTkToplevel` return annotation on the abstract
open_element_window, the lone toolkit reference in the Base layer (the sibling
abstract methods return toolkit objects unannotated). Drop the annotation and
the import so the Base layer is genuinely toolkit-free; the concrete Ctk
subclasses keep their own CTkToplevel annotation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… split

The ctk view split copied OptimizerParamsWindow into a controller from a base
that predated #1444, reverting `if not current_state:` back to
`if current_state is None:`. Since muon_adam_config defaults to {} (not None),
the empty initial state fell through to from_dict({}), so the Muon/aux-Adam
window opened with bare default_values() instead of MUON_AUX_ADAM_DEFAULTS /
ADAMW_ADV. Restore the upstream one-line guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…izer params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gc to close

connect_window_closed bound <Destroy> unconditionally, so the callback
fired once per descendant widget as the toplevel tore down. Guard on the
event widget being the window itself so it fires exactly once.

With that in place, open_sampling_tool defers torch_gc to window close via
connect_window_closed instead of running it inline at open time, restoring
the original 'free GPU memory after the sample window closes' behaviour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dxqb dxqb changed the title Pyside copy Qt UI file split Jul 1, 2026
@dxqb dxqb changed the base branch from master to merge July 1, 2026 04:22
@dxqb dxqb merged commit ebb6f38 into merge Jul 1, 2026
1 check passed
@dxqb dxqb deleted the pyside_copy branch July 1, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant