From d2ed468e80237ea5060cb280af64a51d7e4d265c Mon Sep 17 00:00:00 2001 From: warby Date: Fri, 12 Dec 2025 23:41:59 -0600 Subject: [PATCH] [ENV-4] Add Nano Banana installation support and fix entrypoint venv check - Fix venv creation check to look for bin/activate instead of directory - Add INSTALL_NANO_BANANA env var to entrypoint for automatic installation - Add COMFYUI_ARGS support to pass arguments to ComfyUI (e.g., --cpu) - Configure CPU mode for testing without GPU - Update comfy-node-install to disable git terminal prompts Note: Nano Banana repository URL needs verification (current URL returns 404) --- docker-compose.yml | 4 +++- scripts/comfy-node-install.sh | 4 ++-- scripts/docker-entrypoint.sh | 13 ++++++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ee13ade2d..b952f1c07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: dockerfile: Dockerfile container_name: comfyui ports: - - "8188:8188" + - "8189:8188" # Temporarily disabled for testing without GPU # deploy: # resources: @@ -30,6 +30,8 @@ services: - TZ=America/Chicago - PUID=1000 - PGID=1000 + - COMFYUI_ARGS=--cpu + - INSTALL_NANO_BANANA=true # OpenTelemetry environment variables (optional - set if you want OTEL) # - OTEL_EXPORTER_OTLP_ENDPOINT=http://your-otel-collector:4317 # - OTEL_SERVICE_NAME=comfyui diff --git a/scripts/comfy-node-install.sh b/scripts/comfy-node-install.sh index 4026888d6..d9370689b 100644 --- a/scripts/comfy-node-install.sh +++ b/scripts/comfy-node-install.sh @@ -37,9 +37,9 @@ install_node() { # Clone the repository if [ -n "${GIT_LFS_SKIP_SMUDGE}" ]; then - GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 "${repo_url}" "${target_dir}" + GIT_TERMINAL_PROMPT=0 GIT_LFS_SKIP_SMUDGE=1 git clone --depth 1 "${repo_url}" "${target_dir}" else - git clone --depth 1 "${repo_url}" "${target_dir}" + GIT_TERMINAL_PROMPT=0 git clone --depth 1 "${repo_url}" "${target_dir}" fi echo " Successfully installed ${repo_name}" diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index dbe810365..d291445aa 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -11,7 +11,7 @@ WORKDIR="${COMFYUI_DIR}" cd "${WORKDIR}" # Create virtual environment if it doesn't exist -if [ ! -d "${VENV_DIR}" ]; then +if [ ! -f "${VENV_DIR}/bin/activate" ]; then echo "Creating virtual environment..." python -m venv "${VENV_DIR}" fi @@ -57,6 +57,13 @@ if [ "${INSTALL_CURATED_NODES:-false}" = "true" ]; then https://github.com/giriss/comfy-image-saver || echo "Warning: Some custom nodes failed to install" fi +# Optional: Install Nano Banana node (can be enabled via environment variable) +if [ "${INSTALL_NANO_BANANA:-false}" = "true" ]; then + echo "Installing Nano Banana custom node..." + export COMFYUI_DIR="${COMFYUI_DIR}" + comfy-node-install https://github.com/jeffy5/ComfyUI-Nano-Banana || echo "Warning: Nano Banana installation failed" +fi + # Check if OpenTelemetry endpoint is configured if [ -n "${OTEL_EXPORTER_OTLP_ENDPOINT}" ]; then echo "OpenTelemetry endpoint detected, enabling instrumentation..." @@ -64,9 +71,9 @@ if [ -n "${OTEL_EXPORTER_OTLP_ENDPOINT}" ]; then --traces_exporter otlp \ --metrics_exporter otlp \ --logs_exporter otlp \ - python main.py --listen 0.0.0.0 --port 8188 "$@" + python main.py --listen 0.0.0.0 --port 8188 ${COMFYUI_ARGS:-} "$@" else echo "Starting ComfyUI without OpenTelemetry instrumentation..." - exec python main.py --listen 0.0.0.0 --port 8188 "$@" + exec python main.py --listen 0.0.0.0 --port 8188 ${COMFYUI_ARGS:-} "$@" fi