forked from mlc-ai/web-stable-diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
95 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
PROJ_ROOT=`pwd` | ||
|
||
if [[ ! -f $1 ]]; then | ||
echo "cannot find config" $1 | ||
fi | ||
|
||
rm -rf site/dist | ||
mkdir -p site/dist site/_inlcudes | ||
|
||
echo "Copy local configurations.." | ||
cp web/local-config.json site/stable-diffusion-config.json | ||
|
||
cp $1 site/stable-diffusion-config.json | ||
echo "Copy files..." | ||
cp web/stable_diffusion.html site/_includes | ||
cp web/stable_diffusion.js site/dist | ||
|
||
|
||
cp dist/scheduler_consts.json site/dist | ||
cp dist/stable_diffusion_webgpu.wasm site/dist | ||
|
||
cp dist/tvmjs_runtime.wasi.js site/dist | ||
cp dist/tvmjs.bundle.js site/dist | ||
cp -r dist/tokenizers-wasm site/dist | ||
|
||
cd site && jekyll b | ||
|
||
echo "symlink parameter location to site.." | ||
ln -s ${PROJ_ROOT}/dist/params _site/dist/webgpu-sd-v1-5 | ||
|
||
jekyll serve --skip-initial-build --baseurl /web-stable-diffusion --port 8888 | ||
cd site && jekyll b && cd .. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
scripts/build_site.sh dist/gh-page-config.json | ||
|
||
git fetch | ||
git checkout -B gh-pages origin/gh-pages | ||
rm -rf docs .gitignore | ||
mkdir -p docs | ||
cp -rf site/_site/* docs | ||
touch docs/.nojekyll | ||
|
||
DATE=`date` | ||
git add docs && git commit -am "Build at ${DATE}" | ||
git push origin gh-pages | ||
git checkout main && git submodule update | ||
echo "Finish deployment at ${DATE}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
scripts/build_site.sh web/local-config.json | ||
|
||
echo "symlink parameter location to site.." | ||
|
||
ln -s `pwd`/dist/params site/_site/dist/webgpu-sd-v1-5 | ||
cd site && jekyll serve --skip-initial-build --host localhost --baseurl /web-stable-diffusion --port 8888 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# This file prepares all the necessary dependencies for the web build. | ||
set -euxo pipefail | ||
|
||
emcc --version | ||
npm --version | ||
cargo --version | ||
|
||
TVM_HOME_SET="${TVM_HOME:-}" | ||
|
||
if [[ -z ${TVM_HOME_SET} ]]; then | ||
if [[ ! -d "3rdparty/tvm" ]]; then | ||
echo "Do not find TVM_HOME env variable, cloning a version as source". | ||
git clone https://github.com/apache/tvm 3rdparty/tvm --branch unity --recursive | ||
fi | ||
export TVM_HOME="${TVM_HOME:-3rdparty/tvm}" | ||
fi | ||
|
||
export TOKENZIER_WASM_HOME="3rdparty/tokenizers-wasm" | ||
|
||
mkdir -p dist | ||
cd ${TVM_HOME}/web && make && npm install && npm run bundle && cd - | ||
git submodule update --init | ||
cd ${TOKENZIER_WASM_HOME} && wasm-pack build --target web && cd - | ||
rm -rf dist/tokenizers-wasm | ||
cp -r ${TOKENZIER_WASM_HOME}/pkg dist/tokenizers-wasm | ||
|
||
echo "Exporting tvmjs runtime dist files" | ||
python -c "from tvm.contrib import tvmjs; tvmjs.export_runtime(\"dist\")" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from distutils.core import setup | ||
from setuptools import find_packages | ||
|
||
# Note there is no need to setup when | ||
# running locally in this folder. | ||
|
||
setup( | ||
name = "web-stable-diffusion", | ||
version = "0.1.0", | ||
license="Apache-2.0", | ||
description = "Stable diffusion on browser", | ||
author = "Web stable diffusion contributors", | ||
url = "https://github.com/mlc-ai/web-stable-diffusion", | ||
keywords = [], | ||
packages = find_packages(), | ||
install_requires = [ | ||
"torch", | ||
"diffusers", | ||
"transformers" | ||
], | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Build Tools", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
], | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
name: "Web Stable Diffusion" | ||
short_name: "WiSe" | ||
short_name: "WebSD" | ||
|
||
url: https://mlc.ai/web-stable-diffusion | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,4 @@ notitle: true | |
|
||
# Web Stable Diffusion | ||
|
||
|
||
This is a page | ||
|
||
{% include stable_diffusion.html %} |
This file was deleted.
Oops, something went wrong.
This file contains 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