Skip to content

Commit

Permalink
dreambooth_gui: fix toml value filtering condition
Browse files Browse the repository at this point in the history
In python3, `0 == False` will evaluate True.
That can cause arg values of 0 to be wrongly eliminated from the toml output.
The conditional must check the type when comparing for False.
  • Loading branch information
b-fission committed Aug 6, 2024
1 parent 203b835 commit f1d7c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kohya_gui/dreambooth_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def train_model(
config_toml_data = {
key: value
for key, value in config_toml_data.items()
if value not in ["", False, None]
if not any([value == "", value is False, value is None])
}

config_toml_data["max_data_loader_n_workers"] = int(max_data_loader_n_workers)
Expand Down

0 comments on commit f1d7c02

Please sign in to comment.