Skip to content

Commit 4a847f5

Browse files
authored
Merge pull request #96 from grokuku/test
-switch base image to ubuntu 24.04 + python3.12 -added 50x0 architecture (TORCH_CUDA_ARCH_LIST="8.0 8.6 8.7 8.9 9.0 9.0a 10") -removed mip-splatting and vox2seq prebuild -added AI Toolkit
2 parents 51e56c7 + 4795766 commit 4a847f5

24 files changed

+737
-370
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build and Push Buildbase Image
2+
3+
on:
4+
workflow_dispatch: # Déclenchement manuel
5+
push:
6+
branches:
7+
- '**' # Ou ta branche de développement principale
8+
paths:
9+
- 'Dockerfile.buildbase'
10+
- '.github/workflows/build-buildbase-image.yml' # Si ce workflow lui-même change
11+
12+
jobs:
13+
build_and_push_buildbase:
14+
name: Build and Push stable-diffusion-buildbase
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
contents: read
19+
steps:
20+
- name: Free Disk Space
21+
uses: jlumbroso/free-disk-space@main
22+
with:
23+
tool-cache: true
24+
25+
# all of these default to true, but feel free to set to
26+
# false if necessary for your workflow
27+
android: true
28+
dotnet: true
29+
haskell: true
30+
large-packages: true
31+
swap-storage: true
32+
- name: Check out repository
33+
uses: actions/checkout@v4
34+
35+
- name: Login to GitHub Container Registry
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.repository_owner }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Extract metadata for buildbase image
43+
id: meta-buildbase
44+
uses: docker/metadata-action@v4
45+
with:
46+
images: ghcr.io/${{ github.repository_owner }}/stable-diffusion-buildbase
47+
tags: |
48+
type=raw,value=latest
49+
type=sha,prefix=,suffix=,format=short
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- name: Build and push compilation environment image
55+
uses: docker/build-push-action@v5
56+
with:
57+
context: .
58+
file: ./Dockerfile.buildbase
59+
push: true
60+
tags: ${{ steps.meta-buildbase.outputs.tags }}
61+
labels: ${{ steps.meta-buildbase.outputs.labels }}
62+
platforms: linux/amd64
63+
no-cache: true
64+
cache-from: type=gha
65+
cache-to: type=gha,mode=max

.github/workflows/publishImage.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ jobs:
2222
packages: write
2323
contents: read
2424
steps:
25-
- name: Free Disk Space
26-
uses: jlumbroso/free-disk-space@main
27-
with:
28-
tool-cache: true
25+
# - name: Free Disk Space
26+
# uses: jlumbroso/free-disk-space@main
27+
# with:
28+
# tool-cache: true
2929

3030
# all of these default to true, but feel free to set to
3131
# false if necessary for your workflow
32-
android: true
33-
dotnet: true
34-
haskell: true
35-
large-packages: true
36-
swap-storage: true
32+
# android: true
33+
# dotnet: true
34+
# haskell: true
35+
# large-packages: true
36+
# swap-storage: true
3737
- name: Check out the repo
3838
uses: actions/checkout@v2
3939

@@ -81,4 +81,4 @@ jobs:
8181
push: ${{ github.event_name != 'pull_request' && !env.ACT}}
8282
tags: ${{ steps.meta.outputs.tags }}
8383
labels: ${{ steps.meta.outputs.labels }}
84-
platforms: linux/amd64
84+
platforms: linux/amd64

.gitignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
# Description: This file specifies intentionally untracked files that Git should ignore.
2+
# Functionalities:
3+
# - Prevents sensitive information (e.g., API keys, passwords) from being committed to the repository.
4+
# - Excludes build artifacts and temporary files from version control.
5+
# - Reduces the size of the repository by excluding unnecessary files.
6+
# Choices and Reasons:
7+
# - .env: Excludes environment variable files, which often contain sensitive information.
8+
# - data/: Excludes the data directory, which may contain large datasets or other files that are not essential to the codebase.
9+
#
10+
# Additional Notes:
11+
# - This file should be placed in the root directory of the Git repository.
12+
# - Each line in the file specifies a pattern to be ignored.
13+
# - Patterns can include wildcards (e.g., *.log) and directory names.
114
.env
2-
data/
15+
data/
16+
*.tech

01.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@ source /functions.sh
44
export PATH="/home/abc/miniconda3/bin:$PATH"
55
export SD01_DIR=${BASE_DIR}/01-easy-diffusion
66

7-
#clean conda env
7+
# Clean Conda environment folders if required
88
clean_env ${SD01_DIR}/conda-env
99
clean_env ${SD01_DIR}/installer_files
1010

11-
#Create Conda Env
11+
# Create the Conda environment if it doesn't exist
1212
if [ ! -d ${SD01_DIR}/conda-env ]; then
1313
conda create -p ${SD01_DIR}/conda-env -y
1414
fi
1515

16-
#active env and install python
16+
# Activate the environment and install Python/pip
1717
source activate ${SD01_DIR}/conda-env
1818
conda install -n base conda-libmamba-solver -y
19-
conda install -c python=3.11 pip --solver=libmamba -y
19+
conda install -c python=3.12 pip --solver=libmamba -y
2020

21-
#create 'models' folders
21+
# Create required directories for Easy Diffusion
2222
mkdir -p ${SD01_DIR}/{models,version,plugins/ui,scripts}
2323
cd ${SD01_DIR}
2424

25-
#install manager plugin
25+
# Install the plugin manager if it's not already present
2626
if [ ! -f ${SD01_DIR}/plugins/ui/plugin-manager.plugin.js ]; then
2727
curl -L https://raw.githubusercontent.com/patriceac/Easy-Diffusion-Plugins/main/plugin-manager.plugin.js --output ${SD01_DIR}/plugins/ui/plugin-manager.plugin.js
2828
fi
2929

30-
# Merge Models, vae, lora, hypernetworks, etc.
30+
# Symlink shared models folders into the Easy Diffusion directory
3131
sl_folder ${SD01_DIR}/models stable-diffusion ${BASE_DIR}/models stable-diffusion
3232
sl_folder ${SD01_DIR}/models hypernetwork ${BASE_DIR}/models hypernetwork
3333
sl_folder ${SD01_DIR}/models lora ${BASE_DIR}/models lora
@@ -38,14 +38,15 @@ sl_folder ${SD01_DIR}/models codeformer ${BASE_DIR}/models codeformer
3838
sl_folder ${SD01_DIR}/models embeddings ${BASE_DIR}/models embeddings
3939
sl_folder ${SD01_DIR}/models gfpgan ${BASE_DIR}/models gfpgan
4040

41+
# Symlink the output folder
4142
sl_folder ${HOME} "Stable Diffusion UI" ${BASE_DIR}/outputs 01-Easy-Diffusion
4243

43-
#copy default parameters if they don't exists
44+
# Copy default parameters if they don't exist
4445
if [ ! -f "$SD01_DIR/config.yaml" ]; then
4546
cp -v "${SD_INSTALL_DIR}/parameters/01.txt" "$SD01_DIR/config.yaml"
4647
fi
4748

48-
#download installer if it isn't present
49+
# Download and set up the Easy Diffusion application if not present
4950
if [ ! -f "$SD01_DIR/start.sh" ]; then
5051
curl -L https://github.com/easydiffusion/easydiffusion/releases/download/v3.0.2/Easy-Diffusion-Linux.zip --output edui.zip
5152
unzip edui.zip
@@ -54,7 +55,7 @@ if [ ! -f "$SD01_DIR/start.sh" ]; then
5455
rm -f edui.zip
5556
fi
5657

57-
#run easy-diffusion
58+
# Launch Easy Diffusion
5859
cd $SD01_DIR
5960
bash start.sh
6061
sleep infinity

02.forge.sh

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,49 @@ source /functions.sh
55
export PATH="/home/abc/miniconda3/bin:$PATH"
66
export SD02_DIR=${BASE_DIR}/02-sd-webui
77

8-
# disable the use of a python venv
8+
# Disable the webui's built-in Python venv creation
99
export venv_dir="-"
1010

11-
# Install or update Stable-Diffusion-WebUI
11+
# Create the main directory for this UI
1212
mkdir -p ${SD02_DIR}
13-
14-
if [ ! -d ${SD02_DIR}/forge ]; then
15-
git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git ${SD02_DIR}/forge
13+
mkdir -p "${SD02_DIR}/forge"
14+
15+
# Install or update the Stable-Diffusion-WebUI-Forge repository
16+
if [ ! -d "${SD02_DIR}/forge/.git" ]; then
17+
echo "Cloning Stable-Diffusion-WebUI-Forge repository..."
18+
git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git "${SD02_DIR}/forge"
19+
cd "${SD02_DIR}/forge"
20+
else
21+
echo "Existing Stable-Diffusion-WebUI-Forge repository found. Synchronizing..."
22+
cd "${SD02_DIR}/forge"
23+
check_remote "GIT_REF"
1624
fi
1725

18-
# check if remote is ahead of local
19-
cd ${SD02_DIR}/forge
20-
check_remote
21-
22-
#clean conda env
26+
# Clean the Conda environment if required
2327
clean_env ${SD02_DIR}/conda-env
2428

25-
# Create Conda virtual env
29+
# Create the Conda environment if it doesn't exist
2630
if [ ! -d ${SD02_DIR}/conda-env ]; then
2731
conda create -p ${SD02_DIR}/conda-env -y
2832
fi
2933

30-
#activate conda env + install base tools
34+
# Activate the environment and install base packages
3135
source activate ${SD02_DIR}/conda-env
3236
conda install -n base conda-libmamba-solver -y
3337
conda install -c conda-forge python=3.11 pip gcc gxx libcurand --solver=libmamba -y
3438

39+
# Copy default launch parameters if they don't exist
3540
if [ ! -f "$SD02_DIR/parameters.forge.txt" ]; then
3641
cp -v "/opt/sd-install/parameters/02.forge.txt" "$SD02_DIR/parameters.forge.txt"
3742
fi
3843

39-
#install custom requirements
44+
# Install custom user requirements if specified
4045
pip install --upgrade pip
41-
4246
if [ -f ${SD02_DIR}/requirements.txt ]; then
4347
pip install -r ${SD02_DIR}/requirements_versions.txt
4448
fi
4549

46-
# Merge Models, vae, lora, and hypernetworks, and outputs
47-
# Ignore move errors if they occur
50+
# Symlink shared models folders into the Forge directory
4851
sl_folder ${SD02_DIR}/forge/models Stable-diffusion ${BASE_DIR}/models stable-diffusion
4952
sl_folder ${SD02_DIR}/forge/models hypernetworks ${BASE_DIR}/models hypernetwork
5053
sl_folder ${SD02_DIR}/forge/models Lora ${BASE_DIR}/models lora
@@ -57,12 +60,13 @@ sl_folder ${SD02_DIR}/forge/models GFPGAN ${BASE_DIR}/models gfpgan
5760
sl_folder ${SD02_DIR}/forge/models LDSR ${BASE_DIR}/models ldsr
5861
sl_folder ${SD02_DIR}/forge/models ControlNet ${BASE_DIR}/models controlnet
5962

63+
# Symlink the output folder
6064
sl_folder ${SD02_DIR}/forge outputs ${BASE_DIR}/outputs 02-sd-webui
6165

62-
#Force using correct version of Python
66+
# Force the use of the Conda environment's Python executable
6367
export python_cmd="$(which python)"
6468

65-
# Run webUI
69+
# Launch Stable-Diffusion-WebUI-Forge
6670
echo "Run Stable-Diffusion-WebUI-forge"
6771
cd ${SD02_DIR}/forge
6872
CMD="bash webui.sh"

02.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,48 @@ source /functions.sh
44
export PATH="/home/abc/miniconda3/bin:$PATH"
55
export SD02_DIR=${BASE_DIR}/02-sd-webui
66

7-
# disable the use of a python venv
7+
# Disable the webui's built-in Python venv creation
88
export venv_dir="-"
99

10-
# Install or update Stable-Diffusion-WebUI
10+
# Create the main directory for this UI
1111
mkdir -p ${SD02_DIR}
1212

13-
# clone repository
14-
if [ ! -d ${SD02_DIR}/webui ]; then
15-
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git ${SD02_DIR}/webui
13+
# Install or update the Stable-Diffusion-WebUI (AUTOMATIC1111) repository
14+
if [ ! -d "${SD02_DIR}/webui/.git" ]; then
15+
echo "Cloning Stable-Diffusion-WebUI repository..."
16+
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "${SD02_DIR}/webui"
17+
cd "${SD02_DIR}/webui"
18+
else
19+
echo "Existing Stable-Diffusion-WebUI repository found. Synchronizing..."
20+
cd "${SD02_DIR}/webui"
21+
check_remote "GIT_REF"
1622
fi
1723

18-
19-
# check if remote is ahead of local
20-
cd ${SD02_DIR}/webui
21-
check_remote
22-
23-
#clean conda env
24+
# Clean the Conda environment if required
2425
clean_env ${SD02_DIR}/conda-env
2526

26-
# create conda env if needed
27+
# Create the Conda environment if it doesn't exist
2728
if [ ! -d ${SD02_DIR}/conda-env ]; then
2829
conda create -p ${SD02_DIR}/conda-env -y
2930
fi
3031

31-
# activate conda env and install base tools
32+
# Activate the environment and install base packages
3233
source activate ${SD02_DIR}/conda-env
3334
conda install -n base conda-libmamba-solver -y
3435
conda install -c conda-forge python=3.11 pip gcc gxx libcurand --solver=libmamba -y
3536

36-
#copy default parameters if absent
37+
# Copy default launch parameters if they don't exist
3738
if [ ! -f "$SD02_DIR/parameters.txt" ]; then
3839
cp -v "/opt/sd-install/parameters/02.txt" "$SD02_DIR/parameters.txt"
3940
fi
4041

41-
# install custom requirements
42+
# Install custom user requirements if specified
4243
pip install --upgrade pip
43-
4444
if [ -f ${SD02_DIR}/requirements.txt ]; then
4545
pip install -r ${SD02_DIR}/requirements.txt
4646
fi
4747

48-
# Merge Models, vae, lora, and hypernetworks, and outputs
49-
# Ignore move errors if they occur
48+
# Symlink shared models folders into the webui directory
5049
sl_folder ${SD02_DIR}/webui/models Stable-diffusion ${BASE_DIR}/models stable-diffusion
5150
sl_folder ${SD02_DIR}/webui/models hypernetworks ${BASE_DIR}/models hypernetwork
5251
sl_folder ${SD02_DIR}/webui/models Lora ${BASE_DIR}/models lora
@@ -59,12 +58,13 @@ sl_folder ${SD02_DIR}/webui/models GFPGAN ${BASE_DIR}/models gfpgan
5958
sl_folder ${SD02_DIR}/webui/models LDSR ${BASE_DIR}/models ldsr
6059
sl_folder ${SD02_DIR}/webui/models ControlNet ${BASE_DIR}/models controlnet
6160

61+
# Symlink the output folder
6262
sl_folder ${SD02_DIR}/webui outputs ${BASE_DIR}/outputs 02-sd-webui
6363

64-
#Force using correct version of Python
64+
# Force the use of the Conda environment's Python executable
6565
export python_cmd="$(which python)"
6666

67-
# run webUI
67+
# Launch Stable-Diffusion-WebUI
6868
echo "Run Stable-Diffusion-WebUI"
6969
cd ${SD02_DIR}/webui
7070
CMD="bash webui.sh"

0 commit comments

Comments
 (0)