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

Feature/simplified build #1

Closed
wants to merge 10 commits into from
Closed
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
70 changes: 66 additions & 4 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
name: build installer

run-name: installer-build-${{ inputs.platform }}-${{ github.sha }}

on:
workflow_dispatch:

inputs:
platform:
type: choice
description: installer(s) to build
required: true
options:
- arc
- ultra
- ultra2
- all
jobs:
build:
runs-on: windows-latest
Expand All @@ -11,8 +22,59 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: pwd
- name: setup miniforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: "3.11"
activate-environment: 'cp311_libuv'

- name: Install libuv dependency
run: |
conda install -y libuv
conda env list | findstr libuv
echo "LIBUV_DLLS_PATH=$($(conda env list | findstr libuv) -split ' ' | Select-Object -Last 1)\Library\bin"
echo "LIBUV_DLLS_PATH=$($(conda env list | findstr libuv) -split ' ' | Select-Object -Last 1)\Library\bin" >> $env:GITHUB_ENV

- name: copy libuv dlls to workspace
run: |
New-Item -ItemType Directory -Path "python_package_res\conda\Library\bin" -Force
copy "${{ env.LIBUV_DLLS_PATH }}\*.dll" "python_package_res\conda\Library\bin"

- name: Install Node.js and npm
uses: actions/setup-node@v3
with:
node-version: '20'

- name: setup npm project
working-directory: "WebUI"
run: npm install

- name: build installer
working-directory: "WebUI"
run: |
pwd
ls
npm install
npm run fetch-build-resources
npm run pack-python
npm run prebuild
npm run build:${{ inputs.platform }}

- name: set release path
working-directory: "release"
run: |
echo "RELEASE_DIR=$((pwd).Path)"
echo "RELEASE_DIR=$((pwd).Path)" >> $env:GITHUB_ENV

- name: upload single release
uses: actions/upload-artifact@v4
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
name: "${{ inputs.platform }}_installers"
# A file, directory or wildcard pattern that describes what to upload
# Required.
path: ${{ env.RELEASE_DIR }}\*.exe
if-no-files-found: error
retention-days: 1
overwrite: true

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vscode/
env/
package_res/
python_package_res/
release/
WebUI/external/service/

Expand Down
34 changes: 13 additions & 21 deletions WebUI/build/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
## Prepare a base python 3.11 environment

1. Download embedded python for windows from https://github.com/adang1345/PythonWindows
2. Download get-pip.py from https://bootstrap.pypa.io/get-pip.py
3. Install miniforge: https://github.com/conda-forge/miniforge
4. Create a reference conda environment with libuv installed
5. Download 7zr executable from https://www.7-zip.org/a/7zr.exe, put it under `WebUI\package_res` folder.

```
conda create -n cp311_libuv python=3.11 libuv -y

# copy the path to this conda env
conda env list | findstr cp311_libuv
```

5. Run prepack script with 3 additional arguments, this will generate `env.7z` under `WebUI\package_res` folder.

```
cd WebUI
npm run prepack <python_embed_zip> <get_pip_py> <ref_conda_env>
```

`package_res/env.7z` could be reused for all platforms.
1. fetch resources via web by calling ```npm run fetch-build-resources```
2. provide windows libuv dlls:
- Install miniforge: https://github.com/conda-forge/miniforge
- Create a reference conda environment with libuv installed
```
conda create -n cp311_libuv python=3.11 libuv -y
# copy the path to this conda env
conda env list | findstr cp311_libuv
```
- symlink or copy the conda env path into /python_package_resources
3. run ```npm run pack-python```

The resulting `WebUI/npm_package_res/env.7z` could be reused for all platforms.

## Package

Expand Down
4 changes: 3 additions & 1 deletion WebUI/build/installer.nsh.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
Abort ; Abort the installation if Cancel is clicked

continue:
nsExec::ExecToLog '"$INSTDIR\resources\env\python.exe" "-m" "pip" "install" "-r" "$INSTDIR\resources\service\requirements-${PLATFORM}.txt"'
nsExec::ExecToLog '"$INSTDIR\resources\env\python.exe" "$INSTDIR\resources\env\get-pip.py" "--no-warn-script-location"'
nsExec::ExecToLog '"$INSTDIR\resources\env\python.exe" "-m" "pip" "install" "-r" "$INSTDIR\resources\service\requirements-${PLATFORM}.txt" "--no-warn-script-location"'
nsExec::ExecToLog '"$INSTDIR\resources\env\python.exe" "-m" "pip" "install" "-r" "$INSTDIR\resources\service\requirements.txt" "--no-warn-script-location"'
end:
DetailPrint "Installation completed."
!macroend
Expand Down
38 changes: 19 additions & 19 deletions WebUI/build/license.rtf
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Important AI Playground Notices and Disclaimers

Intel technologies may require enabled hardware, software or service activation. No product or component can be absolutely secure. Your costs and results may vary. Intel does not control or audit third-party data. You should consult other sources to evaluate accuracy. Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel’s Global Human Rights Principles (https://www.intel.com/content/www/us/en/policy/policy-human-rights.html). Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights. The software may include third party components with separate legal notices or governed by other agreements, as may be described in the Third-Party Notices file accompanying the software.
Intel technologies may require enabled hardware, software or service activation. No product or component can be absolutely secure. Your costs and results may vary. Intel does not control or audit third-party data. You should consult other sources to evaluate accuracy. Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel’s Global Human Rights Principles (https://www.intel.com/content/www/us/en/policy/policy-human-rights.html). Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights. The software may include third party components with separate legal notices or governed by other agreements, as may be described in the Third-Party Notices file accompanying the software.

Data Privacy. Prompts and images being used in the application will not be collected or stored by Intel. The user of AI Playground is responsible for storing and processing any personal information using the app. For general information regarding the handling of personal data collected by Intel, refer to Intel’s Global Privacy Notice (https://www.intel.com/content/www/us/en/privacy/intelprivacy-notice.html).
Data Privacy. Prompts and images being used in the application will not be collected or stored by Intel. The user of AI Playground is responsible for storing and processing any personal information using the app. For general information regarding the handling of personal data collected by Intel, refer to Intel’s Global Privacy Notice (https://www.intel.com/content/www/us/en/privacy/intelprivacy-notice.html).

Generative AI Large-Language Model (LLM)/Chatbot Disclaimers

AI Playground utilizes GenAI technology and interactions with a chatbot. Best practices in such cases recommend that users at least:

Review outputs before distributing or taking action.
Take caution around incorrect attribution/explanation.
Be skeptical of tone.
Be cognizant of automation bias.
Assume responsibility for action taken.
Review outputs before distributing or taking action.
Take caution around incorrect attribution/explanation.
Be skeptical of tone.
Be cognizant of automation bias.
Assume responsibility for action taken.

You are solely responsible for your use of output from your operation of the AI Playground.

Expand All @@ -32,7 +32,7 @@ Sharing content that is an alteration of copyrighted or licensed material in vio
Limitations.
The model does not achieve perfect photorealism
The model cannot render legible text
The model does not perform well on more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
The model does not perform well on more difficult tasks which involve compositionality, such as rendering an image corresponding to “A red cube on top of a blue sphere”
Faces and people in general may not be generated properly.
The model was trained mainly with English captions and will not work as well in other languages.
The autoencoding part of the model is lossy
Expand All @@ -43,25 +43,25 @@ Bias: While the capabilities of image generation models are impressive, they can

Third-Party Models

In the course of using AI Playground, users may choose to download models created and distributed by third parties after reviewing background information about the models and agreeing to the license governing those models.
In the course of using AI Playground, users may choose to download models created and distributed by third parties after reviewing background information about the models and agreeing to the license governing those models.

Notice: Intel does not create the content and does not warrant its accuracy or quality. By accessing the third-party content, or using materials trained on or with such content, you are indicating your acceptance of the terms associated with that content and warranting that your use complies with the applicable license.

Intel expressly disclaims the accuracy, adequacy, or completeness of any such third-party content, and is not liable for any errors, omissions, or defects in the content, or for any reliance on the content. You agree Intel is not liable for any liability or damages relating to your use of third-party content.

Intel’s identification of these resources does not expand or otherwise alter Intel’s applicable published warranties or warranty disclaimers for Intel products or solutions, and you agree that no additional obligations, indemnifications, or liabilities arise from Intel identifying such resources. Intel reserves the right, without notice, to make corrections, enhancements, improvements, and other changes to its materials.
Intel’s identification of these resources does not expand or otherwise alter Intel’s applicable published warranties or warranty disclaimers for Intel products or solutions, and you agree that no additional obligations, indemnifications, or liabilities arise from Intel identifying such resources. Intel reserves the right, without notice, to make corrections, enhancements, improvements, and other changes to its materials.

The table below contains links to the licenses for certain third-party models and detailed information about the capabilities, limitations, and best practices for those models.

Model License Background Information/Model Card
Dreamshaper 8 Model https://huggingface.co/spaces/CompVis/stable-diffusion-license https://huggingface.co/Lykon/dreamshaper-8
Dreamshaper 8 Inpainting Model https://huggingface.co/spaces/CompVis/stable-diffusion-license https://huggingface.co/Lykon/dreamshaper-8-inpainting
Dreamshaper 8 Model https://huggingface.co/spaces/CompVis/stable-diffusion-license https://huggingface.co/Lykon/dreamshaper-8
Dreamshaper 8 Inpainting Model https://huggingface.co/spaces/CompVis/stable-diffusion-license https://huggingface.co/Lykon/dreamshaper-8-inpainting
JuggernautXL v9 Model
https://huggingface.co/spaces/CompVis/stable-diffusion-license https://huggingface.co/RunDiffusion/Juggernaut-XL-v9
Phi3-mini-4k-instruct https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/LICENSE https://huggingface.co/microsoft/Phi-3-mini-4k-instruct
bge-large-en-v1.5 https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md https://huggingface.co/BAAI/bge-large-en-v1.5
Latent Consistency Model (LCM) LoRA: SD1.5 https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md https://huggingface.co/latent-consistency/lcm-lora-sdv1-5
Latent Consistency Model (LCM) LoRA:SDXL https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md https://huggingface.co/latent-consistency/lcm-lora-sdxl
https://huggingface.co/spaces/CompVis/stable-diffusion-license https://huggingface.co/RunDiffusion/Juggernaut-XL-v9
Phi3-mini-4k-instruct https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/LICENSE https://huggingface.co/microsoft/Phi-3-mini-4k-instruct
bge-large-en-v1.5 https://huggingface.co/datasets/choosealicense/licenses/blob/main/markdown/mit.md https://huggingface.co/BAAI/bge-large-en-v1.5
Latent Consistency Model (LCM) LoRA: SD1.5 https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md https://huggingface.co/latent-consistency/lcm-lora-sdv1-5
Latent Consistency Model (LCM) LoRA:SDXL https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/LICENSE.md https://huggingface.co/latent-consistency/lcm-lora-sdxl

© Intel Corporation.  Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries.  Other names and brands may be claimed as the property of others.
© Intel Corporation.  Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries.  Other names and brands may be claimed as the property of others.

83 changes: 0 additions & 83 deletions WebUI/build/pack-offline.js

This file was deleted.

100 changes: 0 additions & 100 deletions WebUI/build/pack-python.js

This file was deleted.

Loading
Loading