diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 8f647c5c..e5f64fe0 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -53,25 +53,45 @@ if [ "$1" = "--build-engines" ]; then cd /workspace/comfystream conda activate comfystream - # Build Static Engine for Dreamshaper - Square (512x512) - python src/comfystream/scripts/build_trt.py --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors --out-engine /workspace/ComfyUI/output/tensorrt/static-dreamshaper8_SD15_\$stat-b-1-h-512-w-512_00001_.engine --width 512 --height 512 - - # Build Static Engine for Dreamshaper - Portrait (384x704) - python src/comfystream/scripts/build_trt.py --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors --out-engine /workspace/ComfyUI/output/tensorrt/static-dreamshaper8_SD15_\$stat-b-1-h-384-w-704_00001_.engine --width 384 --height 704 - - # Build Static Engine for Dreamshaper - Landscape (704x384) - python src/comfystream/scripts/build_trt.py --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors --out-engine /workspace/ComfyUI/output/tensorrt/static-dreamshaper8_SD15_\$stat-b-1-h-704-w-384_00001_.engine --width 704 --height 384 - - # Build Dynamic Engine for Dreamshaper - python src/comfystream/scripts/build_trt.py \ - --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors \ - --out-engine /workspace/ComfyUI/output/tensorrt/dynamic-dreamshaper8_SD15_\$dyn-b-1-4-2-h-512-704-w-320-384-448_00001_.engine \ - --width 384 \ - --height 704 \ - --min-width 320 \ - --min-height 512 \ - --max-width 448 \ - --max-height 704 + # Build Static Engines for Dreamshaper - Square (512x512) + BATCH_SIZES="1 2" + for batch_size in $BATCH_SIZES; do + echo "=== Building engines with batch size: $batch_size ===" + + # Build Static Engine for Dreamshaper - Square (512x512) + python src/comfystream/scripts/build_trt.py \ + --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors \ + --out-engine /workspace/ComfyUI/output/tensorrt/static-dreamshaper8_SD15_stat-b-${batch_size}-h-512-w-512_00001_.engine \ + --width 512 --height 512 \ + --batch-size $batch_size + + # Build Static Engine for Dreamshaper - Square (512x512) -- FP8 + python src/comfystream/scripts/build_trt.py \ + --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors \ + --out-engine /workspace/ComfyUI/output/tensorrt/static-dreamshaper8_SD15_stat-b-${batch_size}-h-512-w-512_00001_.engine \ + --width 512 --height 512 \ + --batch-size $batch_size \ + --FP8 + + # Build Static Engine for Dreamshaper - Landscape (704x384) + python src/comfystream/scripts/build_trt.py \ + --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors \ + --out-engine /workspace/ComfyUI/output/tensorrt/static-dreamshaper8_SD15_stat-b-${batch_size}-h-704-w-384_00001_.engine \ + --width 704 --height 384 \ + --batch-size $batch_size + + # Build Dynamic Engine for Dreamshaper + python src/comfystream/scripts/build_trt.py \ + --model /workspace/ComfyUI/models/unet/dreamshaper-8-dmd-1kstep.safetensors \ + --out-engine /workspace/ComfyUI/output/tensorrt/dynamic-dreamshaper8_SD15_dyn-b-${batch_size}-h-512-704-w-320-384-448_00001_.engine \ + --width 384 \ + --height 704 \ + --min-width 320 \ + --min-height 512 \ + --max-width 448 \ + --max-height 704 \ + --batch-size $batch_size + done # Build Engine for Depth Anything V2 if [ ! -f "$DEPTH_ANYTHING_DIR/$DEPTH_ANYTHING_ENGINE" ]; then