-
Notifications
You must be signed in to change notification settings - Fork 641
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
Add Local Development Scripts #127
base: master
Are you sure you want to change the base?
Changes from all commits
2daca33
0ddd45f
118641a
856e7a9
81ba60e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cd backends/stable_diffusion_torch/ | ||
|
||
echo ">> Installing pytorch" | ||
conda install pytorch torchvision torchaudio -c pytorch-nightly | ||
|
||
echo ">> Downloading custom python dependencies, might have to pass (i) to ignore existing packages" | ||
pip install -r requirements.txt | ||
|
||
cd ../.. | ||
|
||
echo ">> Setting up electron app" | ||
cd electron_app | ||
npm i | ||
|
||
echo ">> Starting electron app" | ||
npm run electron:serve | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||||||||||
#!/bin/bash | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
set -e | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
# Download stable diffusion info | ||||||||||||||||||||||||||||||||||||||
cd backends/stable_diffusion_torch | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
echo ">> Downloading stable diffusion code" | ||||||||||||||||||||||||||||||||||||||
# Download the m1-compatible Stable Diffusion sampling infrastructure | ||||||||||||||||||||||||||||||||||||||
git clone https://github.com/magnusviri/stable-diffusion.git | ||||||||||||||||||||||||||||||||||||||
cd stable-diffusion | ||||||||||||||||||||||||||||||||||||||
git checkout apple-mps-support | ||||||||||||||||||||||||||||||||||||||
cd .. | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+5
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
echo ">> Downloading text (CLIP) tokenizer" | ||||||||||||||||||||||||||||||||||||||
# Download the CLIP tokenizer from huggingface hub | ||||||||||||||||||||||||||||||||||||||
git clone https://huggingface.co/openai/clip-vit-base-patch32 | ||||||||||||||||||||||||||||||||||||||
mkdir -p HF_weights/ | ||||||||||||||||||||||||||||||||||||||
mv clip-vit-base-patch32 HF_weights/clip_tokenizer | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
echo ">> Downloading model weights (4gb, may take awhile)" | ||||||||||||||||||||||||||||||||||||||
# Download v1.4 model weights (so you can run `python txt2img.py` locally when testing) | ||||||||||||||||||||||||||||||||||||||
wget "https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt" -O sd-v1-4.ckpt | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||
mkdir -p models/ldm/stable-diffusion-v1/ | ||||||||||||||||||||||||||||||||||||||
ln -s sd-v1-4.ckpt models/ldm/stable-diffusion-v1/model.ckpt | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
echo ">> Creating environment diffusion bee" | ||||||||||||||||||||||||||||||||||||||
# Create fresh python environment | ||||||||||||||||||||||||||||||||||||||
conda create --name diffusionbee | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
echo ">> Now run 'conda activate diffusionbee'" | ||||||||||||||||||||||||||||||||||||||
echo ">> Followed by './install-local-dev-2.sh'" | ||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm does not ship with macOS. Consider checking for the existence of these commands upfront, and providing users with better context, with e.g.