Skip to content
Open

Mryan #8751

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Created by mkuv.sh for uv environment
source ".venv/bin/activate"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,8 @@ installer/InvokeAI-Installer/
.aider*

.claude/

# data
invokeai_data
outputs
new-models
20 changes: 20 additions & 0 deletions .salias
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# InvokeAI-Meta Development Aliases
clear
set -gx ENV_NAME '.venv'
set -gx INVOKE_DIR (pwd)

alias rmenv='clear;clean;rm -rf $ENV_NAME uv.lock .envrc; exit'
alias mkenv='mkuv $ENV_NAME 3.12.10'
alias data='cd ./invokeai_data/databases'

source ./.salias_f

# install - install invoke ./setup_dev.sh
# run - Start InvokeAI server
# stop - Stop InvokeAI server
# dev - Start InvokeAI server with frontend in dev mode
# build-ui - Build frontend
# updateall- Update dependencies
# clean - Clean build artifacts
# data - Open data directory
# logs - View logs
97 changes: 97 additions & 0 deletions .salias_f
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

# Start InvokeAI server
function run
imd

# Kill any existing invokeai-web processes
set existing_pids (pgrep -f invokeai-web)
if test -n "$existing_pids"
echo "Found existing InvokeAI server (PIDs: $existing_pids)"
echo "Stopping existing server..."
pkill -f invokeai-web
sleep 2 # Give it time to shut down gracefully
end

echo "Starting InvokeAI server..."
# source .venv/bin/activate.fish - we are using direnv with .envrc file
invokeai-web --root $INVOKE_DIR/invokeai_data
end

# Stop InvokeAI server
function stop
set existing_pids (pgrep -f invokeai-web)
if test -n "$existing_pids"
echo "Found InvokeAI server (PIDs: $existing_pids)"
echo "Stopping server..."
pkill -f invokeai-web
sleep 2 # Give it time to shut down gracefully
echo "✅ Server stopped"
sleep 5
exit
else
echo "No InvokeAI server is currently running"
end
end

# Start InvokeAI server with frontend in dev mode
function dev
imd
echo "Starting InvokeAI in development mode..."
echo "Backend will run at http://127.0.0.1:9090"
echo "Frontend will run at http://127.0.0.1:5173"
echo ""

# Start backend in background
# source .venv/bin/activate.fish - we are using direnv with .envrc file
invokeai-web --root $INVOKE_DIR/invokeai_data &
set -l backend_pid $last_pid

# Start frontend dev server
cd invokeai/frontend/web
pnpm dev

# Kill backend when frontend exits
kill $backend_pid
end

# Build frontend
function build-ui
echo "Building frontend..."
imd
cd invokeai/frontend/web
pnpm build
echo "✅ Frontend built"
end

# Update dependencies
function updateall
echo "Updating dependencies..."
imd
uv pip install -e ".[dev,test,docs]" --python 3.12 --torch-backend=cu128 --upgrade
echo "✅ Dependencies updated"
end

# Clean build artifacts
function clean
echo "Cleaning build artifacts..."
imd
rm -rf invokeai/frontend/web/dist
rm -rf invokeai/frontend/web/node_modules/.vite
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
echo "✅ Clean complete"
end

# View logs
function logs
tail -f $INVOKE_DIR/invokeai_data/logs/invokeai.log
end

# install server
function install
echo "Installing ./setup_dev.sh"
cd $INVOKE_DIR
pnpm self-update

./setup_dev.sh
echo "Close and reopen konsole before running"
end
Loading