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

Add Local Development Scripts #127

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ngundotra
Copy link

This PR adds 2 install scripts that automate the process of getting started with contributing to DiffusionBee

This is an amazing project, and I'm sure more people would be interested in contributing if getting started was a no-brainer

@LePips
Copy link

LePips commented Sep 28, 2022

I would recommend changing the names of the installation scripts to be more descriptive instead of numbering to know how they differ, or at least add a documentation comment to the top of each one.


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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wget is not available on macOS by default, use curl instead for portability


echo ">> Creating environment diffusion bee"
# Create fresh python environment
conda create --name diffusionbee
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conda does not ship with macOS

Comment on lines +5 to +13
# 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 ..
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use pushd and popd instead of having to manually move around. (This script ends without returning the user to the root of the directory, by the by! With this, you can just popd at the end and leave the user at the beginning)

Suggested change
# 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 ..
# Download stable diffusion info
pushd 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
pushd stable-diffusion
git checkout apple-mps-support
popd


echo ">> Setting up electron app"
cd electron_app
npm i
Copy link

@Leland Leland Oct 2, 2022

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.

if ! [ -x "$(command -v npm)" ]; then
  echo 'Error: npm is not installed.' >&2
  exit 1
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants