From 2faa9f7f511a5d057b4ba08f76c2e4dfcbbbc234 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 2 Apr 2024 16:02:06 -0700 Subject: [PATCH 1/6] Add lora. --- .../json_examples/workflow_lora_api.json | 126 ++++++++++++++++++ .github/workflows/linux-os-test.yml | 26 +++- 2 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/json_examples/workflow_lora_api.json diff --git a/.github/workflows/json_examples/workflow_lora_api.json b/.github/workflows/json_examples/workflow_lora_api.json new file mode 100644 index 000000000..71ee48eb9 --- /dev/null +++ b/.github/workflows/json_examples/workflow_lora_api.json @@ -0,0 +1,126 @@ +{ + "3": { + "inputs": { + "seed": 851616030078638, + "steps": 20, + "cfg": 8, + "sampler_name": "euler", + "scheduler": "normal", + "denoise": 1, + "model": [ + "10", + 0 + ], + "positive": [ + "6", + 0 + ], + "negative": [ + "7", + 0 + ], + "latent_image": [ + "5", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "4": { + "inputs": { + "ckpt_name": "v1-5-pruned-emaonly.ckpt" + }, + "class_type": "CheckpointLoaderSimple", + "_meta": { + "title": "Load Checkpoint" + } + }, + "5": { + "inputs": { + "width": 512, + "height": 512, + "batch_size": 1 + }, + "class_type": "EmptyLatentImage", + "_meta": { + "title": "Empty Latent Image" + } + }, + "6": { + "inputs": { + "text": "masterpiece best quality girl", + "clip": [ + "10", + 1 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "7": { + "inputs": { + "text": "bad hands", + "clip": [ + "10", + 1 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "8": { + "inputs": { + "samples": [ + "3", + 0 + ], + "vae": [ + "4", + 2 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "9": { + "inputs": { + "filename_prefix": "ComfyUI", + "images": [ + "8", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "Save Image" + } + }, + "10": { + "inputs": { + "lora_name": "epiNoiseoffset_v2.safetensors", + "strength_model": 1, + "strength_clip": 1, + "model": [ + "4", + 0 + ], + "clip": [ + "4", + 1 + ] + }, + "class_type": "LoraLoader", + "_meta": { + "title": "Load LoRA" + } + } +} \ No newline at end of file diff --git a/.github/workflows/linux-os-test.yml b/.github/workflows/linux-os-test.yml index 083b617a3..550af22d0 100644 --- a/.github/workflows/linux-os-test.yml +++ b/.github/workflows/linux-os-test.yml @@ -2,7 +2,7 @@ name: Test ComfyUI Linux with Default Workflow on: pull_request: branches: - - main + - master paths-ignore: - 'tests/**' - 'tests-ui/**' @@ -13,11 +13,16 @@ on: - 'tests-ui/**' - '.github/workflows/mac-os-test.yml' workflow_dispatch: - + inputs: + runTests: + description: 'Specify which tests to run (e.g., "All", "Lora", "Default")' + required: true + default: 'All' # Default to running all tests jobs: - test-action: - runs-on: nvidia-tesla-t4 + test-default-workflow: + runs-on: [self-hosted, Linux, nvidia-tesla-t4] + if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Default' }} steps: - name: Use ComfyUI GitHub Action uses: drip-art/comfy-action@main @@ -28,3 +33,16 @@ jobs: models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}}' workflow_json_path: '.github/workflows/json_examples/workflow_api.json' timeout: 50 + test-lora-workflow: + runs-on: [self-hosted, Linux, nvidia-tesla-t4] + if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Lora' }} + steps: + - name: Use ComfyUI GitHub Action + uses: drip-art/comfy-action@main + with: + os: linux + cuda_version: 12.1 + torch_ver: 'stable' + models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}, "epiNoiseoffset_v2.safetensors": {"url": "https://huggingface.co/adhikjoshi/epi_noiseoffset/resolve/main/epiNoiseoffset_v2.safetensors", "directory": "loras"}}' + workflow_json_path: '.github/workflows/json_examples/workflow_lora_api.json' + timeout: 50 From 7a955acbf57aa562f8e59aebbacfb804b79865f5 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 2 Apr 2024 17:09:44 -0700 Subject: [PATCH 2/6] Add OS strategies. --- .github/workflows/linux-os-test.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux-os-test.yml b/.github/workflows/linux-os-test.yml index 550af22d0..c48be4d69 100644 --- a/.github/workflows/linux-os-test.yml +++ b/.github/workflows/linux-os-test.yml @@ -21,28 +21,39 @@ on: jobs: test-default-workflow: - runs-on: [self-hosted, Linux, nvidia-tesla-t4] + strategy: + matrix: + os: [macos, linux] + include: + - os: macos + torch_ver: 'nightly' + runner_label: [self-hosted, m2] + - os: linux + cuda_version: 12.1 + torch_ver: 'stable' + runner_label: [self-hosted, Linux, nvidia-tesla-t4] + runs-on: ${{ matrix.runner_label }} if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Default' }} steps: - name: Use ComfyUI GitHub Action uses: drip-art/comfy-action@main with: - os: linux - cuda_version: 12.1 - torch_ver: 'stable' + os: ${{ matrix.os }} + cuda_version: ${{ matrix.cuda_version }} + torch_ver: ${{ matrix.torch_ver }} models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}}' workflow_json_path: '.github/workflows/json_examples/workflow_api.json' timeout: 50 test-lora-workflow: - runs-on: [self-hosted, Linux, nvidia-tesla-t4] + runs-on: $${{ matrix.runner_label }} if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Lora' }} steps: - name: Use ComfyUI GitHub Action uses: drip-art/comfy-action@main with: - os: linux - cuda_version: 12.1 - torch_ver: 'stable' + os: ${{ matrix.os }} + cuda_version: ${{ matrix.cuda_version }} + torch_ver: ${{ matrix.torch_ver }} models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}, "epiNoiseoffset_v2.safetensors": {"url": "https://huggingface.co/adhikjoshi/epi_noiseoffset/resolve/main/epiNoiseoffset_v2.safetensors", "directory": "loras"}}' workflow_json_path: '.github/workflows/json_examples/workflow_lora_api.json' timeout: 50 From 7d2834f0b5d01042f267d254a23aae605c2382b6 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 2 Apr 2024 17:23:55 -0700 Subject: [PATCH 3/6] Fix runner label for lora. --- .github/workflows/linux-os-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-os-test.yml b/.github/workflows/linux-os-test.yml index c48be4d69..5eaa39a55 100644 --- a/.github/workflows/linux-os-test.yml +++ b/.github/workflows/linux-os-test.yml @@ -45,7 +45,7 @@ jobs: workflow_json_path: '.github/workflows/json_examples/workflow_api.json' timeout: 50 test-lora-workflow: - runs-on: $${{ matrix.runner_label }} + runs-on: ${{ matrix.runner_label }} if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Lora' }} steps: - name: Use ComfyUI GitHub Action From 6f7e4460aa8f22ebb0b8bf37e3f644f231658213 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 2 Apr 2024 17:25:46 -0700 Subject: [PATCH 4/6] Consolidate all workflows in one. --- .github/workflows/mac-os-test.yml | 30 ------------------- ...os-test.yml => test-example-workflows.yml} | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 .github/workflows/mac-os-test.yml rename .github/workflows/{linux-os-test.yml => test-example-workflows.yml} (98%) diff --git a/.github/workflows/mac-os-test.yml b/.github/workflows/mac-os-test.yml deleted file mode 100644 index b133a2b89..000000000 --- a/.github/workflows/mac-os-test.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Test ComfyUI Mac With Default Workflow - -on: - pull_request: - branches: - - main - paths-ignore: - - 'tests/**' - - 'tests-ui/**' - - '.github/workflows/linux-os-test.yml' - push: - paths-ignore: - - 'tests/**' - - 'tests-ui/**' - - '.github/workflows/linux-os-test.yml' - workflow_dispatch: - - -jobs: - test-action: - runs-on: m2 - steps: - - name: Use ComfyUI GitHub Action - uses: drip-art/comfy-action@main - with: - os: macos - torch_ver: 'nightly' - models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}}' - workflow_json_path: '.github/workflows/json_examples/workflow_api.json' - timeout: 50 diff --git a/.github/workflows/linux-os-test.yml b/.github/workflows/test-example-workflows.yml similarity index 98% rename from .github/workflows/linux-os-test.yml rename to .github/workflows/test-example-workflows.yml index 5eaa39a55..c8de4ed37 100644 --- a/.github/workflows/linux-os-test.yml +++ b/.github/workflows/test-example-workflows.yml @@ -1,4 +1,4 @@ -name: Test ComfyUI Linux with Default Workflow +name: Test ComfyUI Example Workflows on: pull_request: branches: From d1440b4a1742ced009c96e45e21c0a08f6796699 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 2 Apr 2024 17:45:03 -0700 Subject: [PATCH 5/6] Remove mac-os- github workflow. --- .github/workflows/test-example-workflows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-example-workflows.yml b/.github/workflows/test-example-workflows.yml index c8de4ed37..5c6213382 100644 --- a/.github/workflows/test-example-workflows.yml +++ b/.github/workflows/test-example-workflows.yml @@ -6,12 +6,10 @@ on: paths-ignore: - 'tests/**' - 'tests-ui/**' - - '.github/workflows/mac-os-test.yml' push: paths-ignore: - 'tests/**' - 'tests-ui/**' - - '.github/workflows/mac-os-test.yml' workflow_dispatch: inputs: runTests: From 7ff3e44693b5e422983a3e6406ffc21920bdfa19 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 2 Apr 2024 18:03:05 -0700 Subject: [PATCH 6/6] Make Lora a step. --- .github/workflows/test-example-workflows.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-example-workflows.yml b/.github/workflows/test-example-workflows.yml index 5c6213382..a2006c6b3 100644 --- a/.github/workflows/test-example-workflows.yml +++ b/.github/workflows/test-example-workflows.yml @@ -11,11 +11,6 @@ on: - 'tests/**' - 'tests-ui/**' workflow_dispatch: - inputs: - runTests: - description: 'Specify which tests to run (e.g., "All", "Lora", "Default")' - required: true - default: 'All' # Default to running all tests jobs: test-default-workflow: @@ -31,27 +26,24 @@ jobs: torch_ver: 'stable' runner_label: [self-hosted, Linux, nvidia-tesla-t4] runs-on: ${{ matrix.runner_label }} - if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Default' }} steps: - - name: Use ComfyUI GitHub Action + - name: Test Default Workflow uses: drip-art/comfy-action@main with: os: ${{ matrix.os }} cuda_version: ${{ matrix.cuda_version }} torch_ver: ${{ matrix.torch_ver }} models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}}' + workflow_name: "default-workflow" workflow_json_path: '.github/workflows/json_examples/workflow_api.json' timeout: 50 - test-lora-workflow: - runs-on: ${{ matrix.runner_label }} - if: ${{ github.event.inputs.runTests == 'All' }} || ${{ github.event.inputs.runTests == 'Lora' }} - steps: - - name: Use ComfyUI GitHub Action + - name: Test Lora Workflow uses: drip-art/comfy-action@main with: os: ${{ matrix.os }} cuda_version: ${{ matrix.cuda_version }} torch_ver: ${{ matrix.torch_ver }} models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt", "directory": "checkpoints"}, "epiNoiseoffset_v2.safetensors": {"url": "https://huggingface.co/adhikjoshi/epi_noiseoffset/resolve/main/epiNoiseoffset_v2.safetensors", "directory": "loras"}}' + workflow_name: "lora-workflow" workflow_json_path: '.github/workflows/json_examples/workflow_lora_api.json' timeout: 50