add sd-webui extension #349
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run examples | |
on: | |
pull_request: | |
paths-ignore: | |
- "*.md" | |
- "**/*.md" | |
- "LICENSE*" | |
env: | |
CONTAINER_NAME: onediff-test | |
REGION_ID: cn-beijing | |
ACR_ORG: registry.cn-beijing.aliyuncs.com/oneflow | |
COMFYUI_SRC_DIR: ComfyUI | |
SDXL_BASE: /share_nfs/hf_models/sd_xl_base_1.0.safetensors | |
UNET_INT8: /share_nfs/hf_models/unet_int8 | |
SELENIUM_CONTAINER_NAME: selenium-test | |
SELENIUM_IMAGE: standalone-chrome:119.0-chromedriver-119.0-grid-4.15.0-20231129 | |
concurrency: | |
group: sd-examples-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
run-examples: | |
name: " ${{ matrix.test-suite }} ${{ matrix.image }}" | |
runs-on: [self-hosted, gpu] | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
image: | |
- onediff:cu118 | |
- onediff-pro:cu121 | |
test-suite: | |
- diffusers_examples | |
- comfy | |
steps: | |
- name: Login to ACR with the AccessKey pair | |
uses: aliyun/acr-login@v1 | |
with: | |
login-server: https://registry.${{env.REGION_ID}}.aliyuncs.com | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Fix permissions | |
run: | | |
set -x | |
docker run --rm -v $PWD:$PWD -w $PWD busybox rm -rf * | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout ComfyUI | |
if: matrix.test-suite == 'comfy' | |
uses: actions/checkout@v2 | |
with: | |
repository: comfyanonymous/ComfyUI | |
path: ${{ env.COMFYUI_SRC_DIR }} | |
- run: | | |
docker rm -f ${{ env.CONTAINER_NAME }} || true | |
docker pull ${{ env.ACR_ORG }}/${{ matrix.image }} | |
- if: matrix.test-suite == 'comfy' | |
run: | | |
docker rm -f ${{ env.SELENIUM_CONTAINER_NAME }} || true | |
docker pull ${{ env.ACR_ORG }}/${{ env.SELENIUM_IMAGE }} | |
- name: Setup docker for ComfyUI Test | |
if: matrix.test-suite == 'comfy' | |
run: | | |
docker compose -f tests/comfy-docker-compose.yml up -d | |
env: | |
CONTAINER_NAME: ${{ env.CONTAINER_NAME }} | |
ACR_ORG: ${{ env.ACR_ORG }} | |
MATRIX_IMAGE: ${{ matrix.image }} | |
COMFYUI_SRC_DIR: ${{ env.COMFYUI_SRC_DIR }} | |
SDXL_BASE: ${{ env.SDXL_BASE }} | |
UNET_INT8: ${{ env.UNET_INT8 }} | |
SELENIUM_IMAGE: ${{ env.SELENIUM_IMAGE }} | |
SELENIUM_CONTAINER_NAME: ${{ env.SELENIUM_CONTAINER_NAME }} | |
- name: Setup docker for diffusers examples | |
if: matrix.test-suite == 'diffusers_examples' | |
run: | | |
docker compose -f tests/diffusers-docker-compose.yml up -d | |
env: | |
CONTAINER_NAME: ${{ env.CONTAINER_NAME }} | |
ACR_ORG: ${{ env.ACR_ORG }} | |
MATRIX_IMAGE: ${{ matrix.image }} | |
SDXL_BASE: ${{ env.SDXL_BASE }} | |
UNET_INT8: ${{ env.UNET_INT8 }} | |
- run: nvidia-smi | |
- run: nvidia-smi -L | |
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | |
- name: Pip Install Requirements for ComfyUI & Test | |
if: matrix.test-suite == 'comfy' | |
run: | | |
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r tests/comfyui/requirements.txt --user | |
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r ComfyUI/requirements.txt --user | |
- name: Start ComfyUI Web Service | |
if: matrix.test-suite == 'comfy' | |
run: | | |
docker exec -d ${{ env.CONTAINER_NAME }} python3 /app/ComfyUI/main.py | |
sleep 30 | |
- name: Test ComfyUI | |
if: matrix.test-suite == 'comfy' | |
run: | | |
docker exec -w /src/onediff/tests/comfyui ${{ env.CONTAINER_NAME }} python3 test_by_ui.py --comfy_port 8188 --workflow workflows/sdxl-unet-speedup-graph-saver.json | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} python3 examples/text_to_image.py --model_id=/share_nfs/hf_models/stable-diffusion-v1-5 | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} python3 examples/image_to_image.py --model_id=/share_nfs/hf_models/stable-diffusion-2-1 | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} python3 examples/text_to_image_sdxl.py --base /share_nfs/hf_models/stable-diffusion-xl-base-1.0 --compile_vae False --height 512 --width 512 | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} python3 examples/text_to_image_sdxl.py --base /share_nfs/hf_models/stable-diffusion-xl-base-1.0 --compile_unet False --height 512 --width 512 --use_multiple_resolutions True | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} python3 examples/text_to_image_controlnet.py --base=/share_nfs/hf_models/stable-diffusion-v1-5 --controlnet=/share_nfs/hf_models/sd-controlnet-canny --input_image=/share_nfs/hf_models/input_image_vermeer.png | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} python3 benchmarks/stable_diffusion_2_unet.py --model_id=/share_nfs/hf_models/stable-diffusion-2-1 | |
- if: matrix.test-suite == 'diffusers_examples' | |
run: docker exec ${{ env.CONTAINER_NAME }} bash examples/unet_save_and_load.sh --model_id=/share_nfs/hf_models/stable-diffusion-2-1 | |
- name: Shutdown docker for ComfyUI Test | |
if: matrix.test-suite == 'comfy' | |
run: | | |
docker compose -f tests/comfy-docker-compose.yml down | |
env: | |
CONTAINER_NAME: ${{ env.CONTAINER_NAME }} | |
ACR_ORG: ${{ env.ACR_ORG }} | |
MATRIX_IMAGE: ${{ matrix.image }} | |
COMFYUI_SRC_DIR: ${{ env.COMFYUI_SRC_DIR }} | |
SDXL_BASE: ${{ env.SDXL_BASE }} | |
UNET_INT8: ${{ env.UNET_INT8 }} | |
SELENIUM_IMAGE: ${{ env.SELENIUM_IMAGE }} | |
SELENIUM_CONTAINER_NAME: ${{ env.SELENIUM_CONTAINER_NAME }} | |
- name: Shutdown docker for diffusers examples | |
if: matrix.test-suite == 'diffusers_examples' | |
run: | | |
docker compose -f tests/diffusers-docker-compose.yml down | |
env: | |
CONTAINER_NAME: ${{ env.CONTAINER_NAME }} | |
ACR_ORG: ${{ env.ACR_ORG }} | |
MATRIX_IMAGE: ${{ matrix.image }} | |
SDXL_BASE: ${{ env.SDXL_BASE }} | |
UNET_INT8: ${{ env.UNET_INT8 }} |