Skip to content

Commit

Permalink
Merge branch 'sd3-flux.1' into dependabot/github_actions/crate-ci/typ…
Browse files Browse the repository at this point in the history
…os-1.26.8
  • Loading branch information
bmaltais authored Nov 2, 2024
2 parents dc76a79 + 2e6a69f commit bb937e6
Show file tree
Hide file tree
Showing 68 changed files with 5,055 additions and 1,429 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cudnn_windows/
bitsandbytes_windows/
bitsandbytes_windows_deprecated/
dataset/
models/
__pycache__/
venv/
**/.hadolint.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
id: publish
with:
context: .
Expand Down
2 changes: 1 addition & 1 deletion .release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v24.1.7
v24.2.0
73 changes: 62 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ The GUI allows you to set the training parameters and generate and run the requi
- [Potential Solutions](#potential-solutions)
- [SDXL training](#sdxl-training)
- [Masked loss](#masked-loss)
- [Guides](#guides)
- [Using Accelerate Lora Tab to Select GPU ID](#using-accelerate-lora-tab-to-select-gpu-id)
- [Starting Accelerate in GUI](#starting-accelerate-in-gui)
- [Running Multiple Instances (linux)](#running-multiple-instances-linux)
- [Monitoring Processes](#monitoring-processes)
- [Interesting Forks](#interesting-forks)
- [Change History](#change-history)

## 🦒 Colab

This Colab notebook was not created or maintained by me; however, it appears to function effectively. The source can be found at: <https://github.com/camenduru/kohya_ss-colab>.

I would like to express my gratitude to camendutu for their valuable contribution. If you encounter any issues with the Colab notebook, please report them on their repository.
I would like to express my gratitude to camenduru for their valuable contribution. If you encounter any issues with the Colab notebook, please report them on their repository.

| Colab | Info |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ |
Expand All @@ -69,7 +75,7 @@ To install the necessary dependencies on a Windows system, follow these steps:
1. Install [Python 3.10.11](https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe).
- During the installation process, ensure that you select the option to add Python to the 'PATH' environment variable.

2. Install [CUDA 11.8 toolkit](https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Windows&target_arch=x86_64).
2. Install [CUDA 12.4 toolkit](https://developer.nvidia.com/cuda-12-4-0-download-archive?target_os=Windows&target_arch=x86_64).

3. Install [Git](https://git-scm.com/download/win).

Expand Down Expand Up @@ -127,7 +133,7 @@ To install the necessary dependencies on a Linux system, ensure that you fulfill
apt install python3.10-venv
```

- Install the CUDA 11.8 Toolkit by following the instructions provided in [this link](https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64).
- Install the CUDA 12.4 Toolkit by following the instructions provided in [this link](https://developer.nvidia.com/cuda-12-4-0-download-archive?target_os=Linux&target_arch=x86_64).

- Make sure you have Python version 3.10.9 or higher (but lower than 3.11.0) installed on your system.

Expand Down Expand Up @@ -329,13 +335,27 @@ To upgrade your installation on Linux or macOS, follow these steps:
To launch the GUI service, you can use the provided scripts or run the `kohya_gui.py` script directly. Use the command line arguments listed below to configure the underlying service.

```text
--listen: Specify the IP address to listen on for connections to Gradio.
--username: Set a username for authentication.
--password: Set a password for authentication.
--server_port: Define the port to run the server listener on.
--inbrowser: Open the Gradio UI in a web browser.
--share: Share the Gradio UI.
--language: Set custom language
--help show this help message and exit
--config CONFIG Path to the toml config file for interface defaults
--debug Debug on
--listen LISTEN IP to listen on for connections to Gradio
--username USERNAME Username for authentication
--password PASSWORD Password for authentication
--server_port SERVER_PORT
Port to run the server listener on
--inbrowser Open in browser
--share Share the gradio UI
--headless Is the server headless
--language LANGUAGE Set custom language
--use-ipex Use IPEX environment
--use-rocm Use ROCm environment
--do_not_use_shell Enforce not to use shell=True when running external commands
--do_not_share Do not share the gradio UI
--requirements REQUIREMENTS
requirements file to use for validation
--root_path ROOT_PATH
`root_path` for Gradio to enable reverse proxy support. e.g. /kohya_ss
--noverify Disable requirements verification
```

### Launching the GUI on Windows
Expand Down Expand Up @@ -438,6 +458,37 @@ The feature is not fully tested, so there may be bugs. If you find any issues, p

ControlNet dataset is used to specify the mask. The mask images should be the RGB images. The pixel value 255 in R channel is treated as the mask (the loss is calculated only for the pixels with the mask), and 0 is treated as the non-mask. The pixel values 0-255 are converted to 0-1 (i.e., the pixel value 128 is treated as the half weight of the loss). See details for the dataset specification in the [LLLite documentation](./docs/train_lllite_README.md#preparing-the-dataset).

## Guides

The following are guides extracted from issues discussions

### Using Accelerate Lora Tab to Select GPU ID

#### Starting Accelerate in GUI

- Open the kohya GUI on your desired port.
- Open the `Accelerate launch` tab
- Ensure the Multi-GPU checkbox is unchecked.
- Set GPU IDs to the desired GPU (like 1).

#### Running Multiple Instances (linux)

- For tracking multiple processes, use separate kohya GUI instances on different ports (e.g., 7860, 7861).
- Start instances using `nohup ./gui.sh --listen 0.0.0.0 --server_port <port> --headless > log.log 2>&1 &`.

#### Monitoring Processes

- Open each GUI in a separate browser tab.
- For terminal access, use SSH and tools like `tmux` or `screen`.

For more details, visit the [GitHub issue](https://github.com/bmaltais/kohya_ss/issues/2577).

## Interesting Forks

To finetune HunyuanDiT models or create LoRAs, visit this [fork](https://github.com/Tencent/HunyuanDiT/tree/main/kohya_ss-hydit)

## Change History

See release information.
Added support for SD3 (Dreambooth and Finetuning) and Flux.1 (Dreambooth, LoRA and Finetuning).

See <https://github.com/kohya-ss/sd-scripts/blob/sd3/README.md> for more details.
1 change: 1 addition & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ parms="parms"
nin="nin"
extention="extention" # Intentionally left
nd="nd"
pn="pn"
shs="shs"
sts="sts"
scs="scs"
Expand Down
217 changes: 208 additions & 9 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#open_folder_small{
#open_folder_small {
min-width: auto;
flex-grow: 0;
padding-left: 0.25em;
Expand All @@ -7,22 +7,22 @@
font-size: 1.5em;
}

#open_folder{
#open_folder {
height: auto;
flex-grow: 0;
padding-left: 0.25em;
padding-right: 0.25em;
}

#number_input{
#number_input {
min-width: min-content;
flex-grow: 0.3;
padding-left: 0.75em;
padding-right: 0.75em;
}

.ver-class {
color: #808080;
color: #6d6d6d; /* Neutral dark gray */
font-size: small;
text-align: right;
padding-right: 1em;
Expand All @@ -35,13 +35,212 @@
}

#myTensorButton {
background: radial-gradient(ellipse, #3a99ff, #52c8ff);
background: #555c66; /* Muted dark gray */
color: white;
border: #296eb8;
border: none;
border-radius: 4px;
padding: 0.5em 1em;
/* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); Subtle shadow */
/* transition: box-shadow 0.3s ease; */
}

#myTensorButton:hover {
/* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); Slightly increased shadow on hover */
}

#myTensorButtonStop {
background: radial-gradient(ellipse, #52c8ff, #3a99ff);
color: black;
border: #296eb8;
background: #777d85; /* Lighter muted gray */
color: white;
border: none;
border-radius: 4px;
padding: 0.5em 1em;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
/* transition: box-shadow 0.3s ease; */
}

#myTensorButtonStop:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.advanced_background {
background: #f4f4f4; /* Light neutral gray */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease; /* Added transition for smooth shadow effect */
}

.advanced_background:hover {
background-color: #ebebeb; /* Slightly darker background on hover */
border: 1px solid #ccc; /* Add a subtle border */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.basic_background {
background: #eaeff1; /* Muted cool gray */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.basic_background:hover {
background-color: #dfe4e7; /* Slightly darker cool gray on hover */
border: 1px solid #ccc;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.huggingface_background {
background: #e0e4e7; /* Light gray with a hint of blue */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.huggingface_background:hover {
background-color: #d6dce0; /* Slightly darker on hover */
border: 1px solid #bbb;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.flux1_background {
background: #ece9e6; /* Light beige tone */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.flux1_background:hover {
background-color: #e2dfdb; /* Slightly darker beige on hover */
border: 1px solid #ccc;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.preset_background {
background: #f0f0f0; /* Light gray */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.preset_background:hover {
background-color: #e6e6e6; /* Slightly darker on hover */
border: 1px solid #ccc;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.samples_background {
background: #d9dde1; /* Soft muted gray-blue */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.samples_background:hover {
background-color: #cfd3d8; /* Slightly darker on hover */
border: 1px solid #bbb;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

/* Dark mode styles */
.dark .advanced_background {
background: #172029; /* Slightly darker gradio dark theme */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease; /* Added transition for smooth shadow effect */
}

.dark .advanced_background:hover {
background-color: #121920; /* Slightly darker background on hover */
border: 1px solid #000000; /* Add a subtle border */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.dark .basic_background {
background: #172029;
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.dark .basic_background:hover {
background-color: #11181e;
border: 1px solid #000000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.dark .huggingface_background {
background: #131c25;
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.dark .huggingface_background:hover {
background-color: #131c25;
border: 1px solid #000000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.dark .flux1_background {
background: #131c25;
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.dark .flux1_background:hover {
background-color: #131c25;
border: 1px solid #000000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.dark .preset_background {
background: #191d25;
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.dark .preset_background:hover {
background-color: #212530;
border: 1px solid #000000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.dark .samples_background {
background: #101e2c;
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.dark .samples_background:hover {
background-color: #17293a;
border: 1px solid #000000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.flux1_rank_layers_background {
background: #ece9e6; /* White background for clear theme */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.flux1_rank_layers_background:hover {
background-color: #dddad7; /* Slightly darker on hover */
border: 1px solid #ccc;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}

.dark .flux1_rank_layers_background {
background: #131c25; /* Dark background for dark theme */
padding: 1em;
border-radius: 8px;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.dark .flux1_rank_layers_background:hover {
background-color: #131c25; /* Slightly darker on hover */
border: 1px solid #000000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow on hover */
}
Loading

0 comments on commit bb937e6

Please sign in to comment.