Skip to content

Commit

Permalink
Add support for quiet output for linux setup
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Nov 7, 2024
1 parent 7266e97 commit a35d0cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion kohya_gui/class_source_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def list_dataset_config_dirs(path: str) -> list:
interactive=True,
)
self.v_parameterization = gr.Checkbox(
label="v_parameterization",
label="v_param",
value=False,
visible=False,
min_width=130,
Expand Down
2 changes: 1 addition & 1 deletion sd-scripts
15 changes: 9 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Options:
-i, --interactive Interactively configure accelerate instead of using default config file.
-n, --no-git-update Do not update kohya_ss repo. No git pull or clone operations.
-p, --public Expose public URL in runpod mode. Won't have an effect in other modes.
-q, --quiet Suppress all output except errors.
-r, --runpod Forces a runpod installation. Useful if detection fails for any reason.
-s, --skip-space-check Skip the 10Gb minimum storage space check.
-u, --no-gui Skips launching the GUI.
Expand Down Expand Up @@ -91,6 +92,7 @@ PARENT_DIR=""
VENV_DIR=""
USE_IPEX=false
USE_ROCM=false
QUIET="--show_stdout"

# Function to get the distro name
get_distro_name() {
Expand Down Expand Up @@ -206,20 +208,20 @@ install_python_dependencies() {
case "$OSTYPE" in
"lin"*)
if [ "$RUNPOD" = true ]; then
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_runpod.txt
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_runpod.txt "$QUIET"
elif [ "$USE_IPEX" = true ]; then
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_linux_ipex.txt
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_linux_ipex.txt "$QUIET"
elif [ "$USE_ROCM" = true ] || [ -x "$(command -v rocminfo)" ] || [ -f "/opt/rocm/bin/rocminfo" ]; then
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_linux_rocm.txt
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_linux_rocm.txt "$QUIET"
else
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_linux.txt
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_linux.txt "$QUIET"
fi
;;
"darwin"*)
if [[ "$(uname -m)" == "arm64" ]]; then
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_macos_arm64.txt
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_macos_arm64.txt "$QUIET"
else
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_macos_amd64.txt
python "$SCRIPT_DIR/setup/setup_linux.py" --platform-requirements-file=requirements_macos_amd64.txt "$QUIET"
fi
;;
esac
Expand Down Expand Up @@ -322,6 +324,7 @@ while getopts ":vb:d:g:inprus-:" opt; do
i | interactive) INTERACTIVE=true ;;
n | no-git-update) SKIP_GIT_UPDATE=true ;;
p | public) PUBLIC=true ;;
q | quiet) QUIET="" ;;
r | runpod) RUNPOD=true ;;
s | skip-space-check) SKIP_SPACE_CHECK=true ;;
u | no-gui) SKIP_GUI=true ;;
Expand Down
2 changes: 1 addition & 1 deletion setup/setup_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main_menu(platform_requirements_file, show_stdout: bool = False, no_run_acce
# Upgrade pip if needed
setup_common.install('pip')
setup_common.install_requirements_inbulk(
platform_requirements_file, show_stdout=True,
platform_requirements_file, show_stdout=show_stdout,
)
# setup_common.install_requirements(platform_requirements_file, check_no_verify_flag=False, show_stdout=show_stdout)
if not no_run_accelerate:
Expand Down

0 comments on commit a35d0cd

Please sign in to comment.