diff --git a/.env b/.env new file mode 100644 index 000000000..52d0322b2 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +TENSORBOARD_PORT=6006 diff --git a/.release b/.release index 8603b5d5d..e7088bda7 100644 --- a/.release +++ b/.release @@ -1 +1 @@ -v24.0.7 \ No newline at end of file +v24.0.8 \ No newline at end of file diff --git a/README.md b/README.md index 0880392ac..00f977eb2 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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: @@ -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: @@ -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: @@ -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 ``` @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml index ddd20f227..4932bcee2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,6 +15,7 @@ services: - 7860:7860 environment: SAFETENSORS_FAST_GPU: 1 + TENSORBOARD_PORT: ${TENSORBOARD_PORT:-6006} tmpfs: - /tmp volumes: @@ -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 diff --git a/kohya_gui/class_tensorboard.py b/kohya_gui/class_tensorboard.py index f28e01f7e..5e95ebf53 100644 --- a/kohya_gui/class_tensorboard.py +++ b/kohya_gui/class_tensorboard.py @@ -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( @@ -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) @@ -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], diff --git a/kohya_gui/common_gui.py b/kohya_gui/common_gui.py index 2876ab7ae..12947b0a8 100644 --- a/kohya_gui/common_gui.py +++ b/kohya_gui/common_gui.py @@ -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"]: diff --git a/test/config/dreambooth-AdamW8bit.json b/test/config/dreambooth-AdamW8bit.json index 48794323e..51f0962d1 100644 --- a/test/config/dreambooth-AdamW8bit.json +++ b/test/config/dreambooth-AdamW8bit.json @@ -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,