Build Musubi Tuner #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Musubi Tuner | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/build_musubi_tuner.yml" | |
# delete: | |
# create: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# UTC 17:00 -> CST (China) 1:00, see https://datetime360.com/cn/utc-cst-china-time/ | |
# https://docs.github.com/zh/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule | |
- cron: '0 17 * * 0' | |
workflow_dispatch: | |
jobs: | |
Build-Musubi-Tuner: | |
name: Build Musubi Tuner | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: List files in the repository | |
shell: pwsh | |
run: | | |
Get-ChildItem -Path "${{ github.workspace }}" -Recurse | |
- name: Launch SD-Trainer-Script Installer | |
shell: pwsh | |
env: | |
UV_NO_PROGRESS: 1 | |
run: | | |
& "${{ github.workspace }}/sd_trainer_script_installer.ps1" ` | |
-InstallPath "${{ github.workspace }}/musubi_tuner" ` | |
-BuildMode ` | |
-BuildWithUpdate ` | |
-BuildWithLaunch ` | |
-BuildWitchBranch 7 ` | |
-InstallBranch "musubi_tuner" ` | |
-DisablePyPIMirror ` | |
-DisableGithubMirror ` | |
-DisableHuggingFaceMirror ` | |
-PyTorchPackage "torch==2.7.0+cu128 torchvision==0.22.0+cu128 torchaudio==2.7.0+cu128" ` | |
-xFormersPackage "xformers==0.0.30" | |
- name: Make docs | |
shell: pwsh | |
run: | | |
python "${{ github.workspace }}/.github/make_docs.py" "${{ github.workspace }}/musubi_tuner" | |
- name: Archive | |
shell: pwsh | |
run: | | |
$build_time = (Get-Date).ToUniversalTime().AddHours(8).ToString("yyyyMMdd") | |
$package_name = "musubi_tuner_licyk_${build_time}" | |
$protable_name = "${package_name}_nightly.7z" | |
New-Item -ItemType Directory -Path "${{ github.workspace }}/sdnote/portable/nightly" -Force | |
Move-Item -Path "${{ github.workspace }}/musubi_tuner" -Destination "${{ github.workspace }}/${package_name}" -Force | |
7z a -t7z -bsp1 "${{ github.workspace }}/sdnote/portable/nightly/musubi_tuner/${protable_name}" "${{ github.workspace }}/${package_name}" | |
- name: Install HuggingFace and ModelScope library | |
shell: pwsh | |
env: | |
PIP_DISABLE_PIP_VERSION_CHECK: 1 | |
run: | | |
pip install huggingface_hub modelscope | |
- name: Upload to HuggingFace repo | |
shell: pwsh | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
python "${{ github.workspace }}/.github/huggingface_release.py" | |
- name: Upload to ModelScope repo | |
shell: pwsh | |
env: | |
MODELSCOPE_API_TOKEN: ${{ secrets.MODELSCOPE_API_TOKEN }} | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
python "${{ github.workspace }}/.github/modelscope_release.py" |