Eliminate first-inpaint timeout: preseed SAM/GroundingDINO + 600s default
Two changes to address the timeout-and-retry loop the user hit on the
first edit_image call:
1. comfyui-init-models.sh now fetches the three weights inpaint
needs into /models/sams and /models/grounding-dino:
- sam_hq_vit_h.pth (~2.5 GB)
- groundingdino_swint_ogc.pth (~700 MB)
- GroundingDINO_SwinT_OGC.cfg.py (~1 KB)
Without preseeding these auto-download on first inpaint, which
takes minutes and times out the tool call. The mkdir line gets
the new subdirs added too.
2. Tool TIMEOUT_SECONDS valve default bumped 240s → 600s as
defense-in-depth — even with weights preseeded, BERT-base
auto-downloads via transformers on first GroundingDINO load
(~30s) and a slow KSampler on a contended GPU can push past
4 minutes occasionally. Steady-state runs still finish in under
a minute; the valve only matters for first-call latency.
After comfyui-model-init re-runs (`docker compose up -d
comfyui-model-init`), first inpaint should be near-instant.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e77666ea0f
commit
0fa8040251
2 files changed
+27
-4
No files matched your search
@@ -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."
|
||||
Reference in new issue
Block a user