diff --git a/deployments/ai-stack/comfyui-init-models.sh b/deployments/ai-stack/comfyui-init-models.sh index 5b982f2..c4696d3 100644 --- a/deployments/ai-stack/comfyui-init-models.sh +++ b/deployments/ai-stack/comfyui-init-models.sh @@ -14,7 +14,8 @@ set -e apk add --no-cache curl >/dev/null mkdir -p /models/checkpoints /models/vae /models/loras /models/controlnet \ - /models/clip /models/clip_vision /models/upscale_models /models/embeddings + /models/clip /models/clip_vision /models/upscale_models /models/embeddings \ + /models/sams /models/grounding-dino fetch() { dest="$1"; name="$2"; url="$3" @@ -65,4 +66,19 @@ fetch() { # fetch upscale_models 4x-UltraSharp.pth \ # https://huggingface.co/lokCX/4x-Ultrasharp/resolve/main/4x-UltraSharp.pth +# ─── Inpainting models (SAM-HQ + GroundingDINO) ───────────────────────────── +# Required by the smart_image_gen Tool's edit_image with mask_text. ComfyUI +# would auto-download these on first use, but that takes minutes and tends +# to time out in-flight tool calls — preseeding here makes the first inpaint +# instant. + +fetch sams sam_hq_vit_h.pth \ + https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_h.pth + +fetch grounding-dino groundingdino_swint_ogc.pth \ + https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth + +fetch grounding-dino GroundingDINO_SwinT_OGC.cfg.py \ + https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/GroundingDINO_SwinT_OGC.cfg.py + echo "Done." diff --git a/deployments/ai-stack/openwebui-tools/smart_image_gen.py b/deployments/ai-stack/openwebui-tools/smart_image_gen.py index 1fee85a..681edf8 100644 --- a/deployments/ai-stack/openwebui-tools/smart_image_gen.py +++ b/deployments/ai-stack/openwebui-tools/smart_image_gen.py @@ -1,7 +1,7 @@ """ title: Smart Image Generator & Editor (ComfyUI) author: ai-stack -version: 0.7.3 +version: 0.7.4 description: Generate or edit images via ComfyUI with automatic SDXL checkpoint routing. Two methods — generate_image (txt2img) and edit_image (img2img on the user's most recently attached image). The @@ -684,8 +684,15 @@ class Tools: description="ComfyUI server URL reachable from the open-webui container.", ) TIMEOUT_SECONDS: int = Field( - default=240, - description="Maximum wait for a single generation to complete.", + default=600, + description=( + "Maximum wait for a single generation to complete. " + "Default 10 minutes — long enough to absorb a first-time " + "inpaint where SAM-HQ + GroundingDINO + BERT auto-download " + "(~3 GB). Steady-state runs finish in well under a minute; " + "if your KSampler routinely takes longer than that, lower " + "the per-style steps in STYLES." + ), ) def __init__(self):