Skip to content

Commit 144f9c2

Browse files
authored
Update install_env.sh of Comfy (#1170)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced installation script for improved package management. - Updated GitHub Actions workflow to include specific versions for Docker images. - Added new dependency `opencv-python-headless` to the requirements. - **Bug Fixes** - Adjusted installation commands to ensure compatibility with Python 3 and user-specific installations. - Removed volume mappings in the test configuration, which may impact service functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 73eaeb7 commit 144f9c2

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

.github/workflows/examples.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ jobs:
173173
should-run-pro:
174174
- ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' }}
175175
image:
176-
- onediff:cu118
177-
- onediff-pro:cu122
176+
- onediff:torch2.3-cuda11.8
177+
- onediff-pro:torch2.3-cuda12.1
178178
test-suite:
179179
- diffusers_examples
180180
- comfy
181181
exclude:
182182
- should-run-pro: false
183-
image: onediff-pro:cu122
183+
image: onediff-pro:torch2.3-cuda12.1
184184
steps:
185185
- name: Login to ACR with the AccessKey pair
186186
if: github.event.pull_request.head.repo.full_name == github.repository
@@ -283,25 +283,31 @@ jobs:
283283
- run: nvidia-smi
284284
- run: nvidia-smi -L
285285
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip list
286+
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip cache dir
286287
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m oneflow --doctor
287288
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
288289
- name: Install onediff-quant if needed
289290
if: startsWith(matrix.image, 'onediff-pro')
290291
run: |
291292
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install --pre onediff-quant "numpy<2" -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/onediff-quant/
292-
- name: Pip Install Requirements for ComfyUI & Test
293+
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install --user "huggingface_hub==0.25.0"
294+
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r /src/onediff/onediff_diffusers_extensions/examples/requirements.txt
295+
if: matrix.test-suite == 'diffusers_examples'
296+
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r tests/comfyui/requirements.txt --user
297+
if: matrix.test-suite == 'comfy'
298+
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r ComfyUI/requirements.txt --user
299+
if: matrix.test-suite == 'comfy'
300+
- run: docker exec ${{ env.CONTAINER_NAME }} python3 -m pip uninstall -y transformer-engine
293301
if: matrix.test-suite == 'comfy'
294-
run: |
295-
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r tests/comfyui/requirements.txt --user
296-
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install -r ComfyUI/requirements.txt --user
297-
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip uninstall -y transformer-engine
298302
- name: Start ComfyUI Web Service
299303
if: matrix.test-suite == 'comfy'
300304
run: |
301305
docker exec -w /app/ComfyUI -d ${{ env.CONTAINER_NAME }} sh -c "python3 /app/ComfyUI/main.py --gpu-only --disable-cuda-malloc --port 8188 --extra-model-paths-config /src/onediff/tests/comfyui/extra_model_paths.yaml > /app/ComfyUI/onediff_comfyui.log 2>&1"
302306
sleep 30
303307
# print to check if comfy is launched successfully
304308
- run: docker exec ${{ env.CONTAINER_NAME }} ps aux
309+
- run: docker exec -w /src/onediff/onediff_comfy_nodes/benchmarks ${{ env.CONTAINER_NAME }} bash scripts/install_env.sh /app/ComfyUI
310+
if: matrix.test-suite == 'comfy'
305311
- name: Test ComfyUI
306312
if: matrix.test-suite == 'comfy'
307313
run: |
@@ -317,7 +323,6 @@ jobs:
317323
# run_comfy_test "/share_nfs/hf_models/comfyui_resources/workflows/deep-cache.json" 600
318324
# run_comfy_test "/share_nfs/hf_models/comfyui_resources/workflows/deep-cache-with-lora.json" 800
319325
# run_comfy_test "workflows/text-to-video-speedup.json" 5000
320-
docker exec -w /src/onediff/onediff_comfy_nodes/benchmarks ${{ env.CONTAINER_NAME }} bash scripts/install_env.sh /app/ComfyUI
321326
docker exec -w /src/onediff/onediff_comfy_nodes/benchmarks ${{ env.CONTAINER_NAME }} bash scripts/run_all_tests.sh || {
322327
echo "Test fails! print the ComfyUI logs..."
323328
docker exec onediff-test cat /app/ComfyUI/onediff_comfyui.log
@@ -355,15 +360,15 @@ jobs:
355360
run: docker exec -w /src/onediff/onediff_diffusers_extensions ${{ env.CONTAINER_NAME }} bash examples/unet_save_and_load.sh --model_id=/share_nfs/hf_models/stable-diffusion-xl-base-1.0
356361
- if: matrix.test-suite == 'diffusers_examples'
357362
run: |
358-
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install --user scikit-image "numpy<2"
363+
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install --user scikit-image "numpy<2" "diffusers==0.23" peft "huggingface_hub==0.25.0" "transformers>=4.28.1"
359364
docker exec -e ONEFLOW_MLIR_ENABLE_INFERENCE_OPTIMIZATION=0 ${{ env.CONTAINER_NAME }} python3 -m pytest -v onediff_diffusers_extensions/tests/test_lora.py --disable-warnings
360365
361366
- name: Install Requirements for WebUI
362367
if: matrix.test-suite == 'webui'
363368
run: |
364369
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
365370
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip config set global.extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple
366-
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install --user pytorch-lightning gradio==3.41.2 diskcache gitpython pytorch_lightning==1.9.4 scikit-image jsonmerge pillow-avif-plugin torchdiffeq torchsde clean-fid resize-right lark tomesd blendmodes facexlib opencv-python==4.8.0.74 piexif inflection ftfy regex tqdm pydantic==1.10.13
371+
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip install --user pytorch-lightning gradio==3.41.2 diskcache gitpython pytorch_lightning==1.9.4 scikit-image jsonmerge pillow-avif-plugin torchdiffeq torchsde clean-fid resize-right lark tomesd blendmodes facexlib opencv-python==4.8.0.74 opencv-python-headless piexif inflection ftfy regex tqdm pydantic==1.10.13
367372
docker exec ${{ env.CONTAINER_NAME }} python3 -m pip uninstall -y transformer-engine
368373
369374
- name: Prepare environment for WebUI

onediff_comfy_nodes/benchmarks/scripts/install_env.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ if [ "$CI" = "1" ]; then
2222
echo "Detected CI environment. Skipping local environment-specific dependencies."
2323
else
2424
echo "Detected local environment. Installing local environment-specific dependencies."
25-
pip install -r $CUSTOM_NODES/ComfyUI_InstantID/requirements.txt
26-
pip install -r $CUSTOM_NODES/PuLID_ComfyUI/requirements.txt
25+
python3 -m pip install --user -r $CUSTOM_NODES/ComfyUI_InstantID/requirements.txt
26+
python3 -m pip install --user -r $CUSTOM_NODES/PuLID_ComfyUI/requirements.txt
2727
fi
2828

2929
echo "Installing common dependencies..."
30-
pip install websocket-client==1.8.0 numpy==1.26.4 scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simple
31-
pip install nexfort
30+
python3 -m pip install --user nexfort websocket-client==1.8.0 numpy==1.26.4 scikit-image

onediff_diffusers_extensions/examples/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ diffusers[torch]==0.19.3
44
onediff
55
chardet
66
opencv-python==4.8.0.74
7+
opencv-python-headless

tests/diffusers-docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ services:
2222
volumes:
2323
- $HOME/test-container-cache-${CONTAINER_NAME}/dot-cache:/root/.cache
2424
- /share_nfs:/share_nfs:ro
25-
- ${SDXL_BASE}:/app/ComfyUI/models/checkpoints/sd_xl_base_1.0.safetensors:ro
26-
- ${UNET_INT8}:/app/ComfyUI/models/unet_int8/unet_int8:ro
2725
- $PWD:/src/onediff
2826
working_dir: /src/onediff
2927
restart: "no"

0 commit comments

Comments
 (0)