Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v24.0.8 #2398

Merged
merged 5 commits into from
Apr 27, 2024
Merged

v24.0.8 #2398

Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TENSORBOARD_PORT=6006
2 changes: 1 addition & 1 deletion .release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v24.0.7
v24.0.8
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The GUI allows you to set the training parameters and generate and run the requi
- [SDXL training](#sdxl-training)
- [Masked loss](#masked-loss)
- [Change History](#change-history)
- [2024/04/26 (v24.0.8)](#20240426-v2408)
- [2024/04/25 (v24.0.7)](#20240425-v2407)
- [2024/04/22 (v24.0.6)](#20240422-v2406)
- [2024/04/19 (v24.0.5)](#20240419-v2405)
Expand Down Expand Up @@ -105,7 +106,7 @@ To set up the project, follow these steps:
2. Clone the repository by running the following command:

```shell
git clone https://github.com/bmaltais/kohya_ss.git
git clone --recursive https://github.com/bmaltais/kohya_ss.git
```

3. Change into the `kohya_ss` directory:
Expand Down Expand Up @@ -153,7 +154,7 @@ To set up the project on Linux or macOS, perform the following steps:
2. Clone the repository by running the following command:

```shell
git clone https://github.com/bmaltais/kohya_ss.git
git clone --recursive https://github.com/bmaltais/kohya_ss.git
```

3. Change into the `kohya_ss` directory:
Expand Down Expand Up @@ -198,7 +199,7 @@ To install the necessary components for Runpod and run kohya_ss, follow these st

```shell
cd /workspace
git clone https://github.com/bmaltais/kohya_ss.git
git clone --recursive https://github.com/bmaltais/kohya_ss.git
```

4. Run the setup script:
Expand Down Expand Up @@ -266,7 +267,7 @@ Install the NVIDIA Container Toolkit with this guide.
#### Use the pre-built Docker image

```bash
git clone https://github.com/bmaltais/kohya_ss.git
git clone --recursive https://github.com/bmaltais/kohya_ss.git
cd kohya_ss
docker compose up -d
```
Expand Down Expand Up @@ -453,6 +454,10 @@ ControlNet dataset is used to specify the mask. The mask images should be the RG

## Change History

### 2024/04/26 (v24.0.8)

- Set `max_train_steps` to 0 if not specified in older `.json` config files.

### 2024/04/25 (v24.0.7)

- Prevent crash if tkinter is not installed
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- 7860:7860
environment:
SAFETENSORS_FAST_GPU: 1
TENSORBOARD_PORT: ${TENSORBOARD_PORT:-6006}
tmpfs:
- /tmp
volumes:
Expand Down Expand Up @@ -42,7 +43,8 @@ services:
container_name: tensorboard
image: tensorflow/tensorflow:latest-gpu
ports:
- 6006:6006
# !Please change the port in .env file
- ${TENSORBOARD_PORT:-6006}:6006
volumes:
- ./dataset/logs:/app/logs
command: tensorboard --logdir=/app/logs --bind_all
Expand Down
25 changes: 16 additions & 9 deletions kohya_gui/class_tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def get_button_states(self, started=False):
visible=visibility and (not started or self.headless)
), gr.Button(visible=visibility and (started or self.headless))

def open_tensorboard_url(self):
tensorboard_url = f"http://localhost:{self.tensorboard_port}"
self.log.info(f"Opening TensorBoard URL in browser: {tensorboard_url}")
webbrowser.open(tensorboard_url)

def start_tensorboard(self, logging_dir=None):
if self.tensorboard_proc is not None:
self.log.info(
Expand Down Expand Up @@ -74,17 +79,13 @@ def start_tensorboard(self, logging_dir=None):
self.log.error("Failed to start Tensorboard:", e)
return self.get_button_states(started=False)

def open_tensorboard_url():
time.sleep(self.wait_time)
if not self.stop_event.is_set():
tensorboard_url = f"http://localhost:{self.tensorboard_port}"
self.log.info(f"Opening TensorBoard URL in browser: {tensorboard_url}")
webbrowser.open(tensorboard_url)

if not self.headless:
self.stop_event.clear()
self.thread = Thread(target=open_tensorboard_url)
self.thread.start()

time.sleep(self.wait_time)
if not self.stop_event.is_set():
self.thread = Thread(target=self.open_tensorboard_url)
self.thread.start()

return self.get_button_states(started=True)

Expand Down Expand Up @@ -119,6 +120,12 @@ def gradio_interface(self):
visible=visibility and self.headless,
elem_id="myTensorButtonStop",
)
button_open_tensorboard = gr.Button(
value="Open tensorboard",
elem_id="myTensorButton",
visible=not visibility,
link=f"http://localhost:{self.tensorboard_port}",
)
button_start_tensorboard.click(
self.start_tensorboard,
inputs=[self.logging_dir],
Expand Down
2 changes: 1 addition & 1 deletion kohya_gui/common_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def update_my_data(my_data):
my_data[key] = int(value)
except ValueError:
# Handle the case where the string is not a valid float
my_data[key] = int(1600)
my_data[key] = int(0)

# Convert values to int if they are strings
for key in ["max_token_length"]:
Expand Down
2 changes: 1 addition & 1 deletion test/config/dreambooth-AdamW8bit.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"max_timestep": 1000,
"max_token_length": 75,
"max_train_epochs": 0,
"max_train_steps": 0,
"max_train_steps": "",
"mem_eff_attn": false,
"min_bucket_reso": 256,
"min_snr_gamma": 0,
Expand Down
Loading