Skip to content

Commit

Permalink
add curses-based interface for textual inversion
Browse files Browse the repository at this point in the history
  • Loading branch information
lstein committed Jan 4, 2023
1 parent c9811b5 commit 1ff402f
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 156 deletions.
1 change: 1 addition & 0 deletions environments-and-requirements/requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test-tube>=0.7.5
torch-fidelity
torchmetrics
transformers~=4.25
windows-curses; sys_platform == 'win32'
https://github.com/Birch-san/k-diffusion/archive/refs/heads/mps.zip#egg=k-diffusion
https://github.com/invoke-ai/PyPatchMatch/archive/refs/tags/0.1.5.zip#egg=pypatchmatch
https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip#egg=clip
Expand Down
9 changes: 7 additions & 2 deletions installer/templates/invoke.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ set INVOKEAI_ROOT=.
echo Do you want to generate images using the
echo 1. command-line
echo 2. browser-based UI
echo 3. open the developer console
set /P restore="Please enter 1, 2 or 3: "
echo 3. textual inversion training
echo 4. open the developer console
set /P restore="Please enter 1, 2, 3 or 4: [1] "
if not defined restore set restore=1
IF /I "%restore%" == "1" (
echo Starting the InvokeAI command-line..
python .venv\Scripts\invoke.py %*
) ELSE IF /I "%restore%" == "2" (
echo Starting the InvokeAI browser-based UI..
python .venv\Scripts\invoke.py --web %*
) ELSE IF /I "%restore%" == "3" (
echo Starting textual inversion training..
python .venv\Scripts\textual_inversion_fe.py --web %*
) ELSE IF /I "%restore%" == "4" (
echo Developer Console
echo Python command is:
where python
Expand Down
11 changes: 7 additions & 4 deletions installer/templates/invoke.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ if [ "$0" != "bash" ]; then
echo "Do you want to generate images using the"
echo "1. command-line"
echo "2. browser-based UI"
echo "3. open the developer console"
read -p "Please enter 1, 2, or 3: " yn
case $yn in
echo "3. textual inversion training"
echo "4. open the developer console"
read -p "Please enter 1, 2, 3 or 4: [1] " yn
choice=${yn:='1'}
case $choice in
1 ) printf "\nStarting the InvokeAI command-line..\n"; .venv/bin/python .venv/bin/invoke.py $*;;
2 ) printf "\nStarting the InvokeAI browser-based UI..\n"; .venv/bin/python .venv/bin/invoke.py --web $*;;
3 ) printf "\nDeveloper Console:\n"; file_name=$(basename "${BASH_SOURCE[0]}"); bash --init-file "$file_name";;
3 ) printf "\nStarting Textual Inversion:\n"; .venv/bin/python .venv/bin/textual_inversion_fe.py $*;;
4 ) printf "\nDeveloper Console:\n"; file_name=$(basename "${BASH_SOURCE[0]}"); bash --init-file "$file_name";;
* ) echo "Invalid selection"; exit;;
esac
else # in developer console
Expand Down
Loading

0 comments on commit 1ff402f

Please sign in to comment.