Skip to content

Commit

Permalink
CI/CD for testing workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoland68 committed Jun 12, 2024
1 parent c8b5e08 commit b6dfd22
Show file tree
Hide file tree
Showing 4 changed files with 304 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/json_examples/workflow_api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"3": {
"inputs": {
"seed": 156680208700286,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"4",
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": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
"clip": [
"4",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"7": {
"inputs": {
"text": "text, watermark",
"clip": [
"4",
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"
}
}
}
126 changes: 126 additions & 0 deletions .github/workflows/json_examples/workflow_lora_api.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
24 changes: 24 additions & 0 deletions .github/workflows/test-workflows-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test ComfyUI Windows with Default Workflow
on:
push:
branches:
- master
workflow_dispatch:


jobs:
test-action:
runs-on: win
steps:
- name: Use ComfyUI GitHub Action
uses: drip-art/comfy-action@main
with:
os: windows
cuda_version: 12.1
workflow_name: "default-workflow"
models-json: '{"v1-5-pruned-emaonly.ckpt": {"url": "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors?download=true", "directory": "checkpoints"}}'
workflow_json_path: '.github/workflows/json_examples/workflow_api.json'
gcs_bucket_name: 'comfy-ci-results'
google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
output_prefix: 'ComfyUI'
timeout: 50
47 changes: 47 additions & 0 deletions .github/workflows/test-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test ComfyUI Example Workflows
on:
push:
branches:
- master
workflow_dispatch:



jobs:
test-default-workflow:
strategy:
matrix:
os: [macos, linux]
include:
- os: macos
runner_label: [self-hosted, m2]
- os: linux
cuda_version: 12.1
runner_label: [self-hosted, Linux, t4]
runs-on: ${{ matrix.runner_label }}
steps:
- name: Test Default Workflow
uses: drip-art/comfy-action@main
with:
os: ${{ matrix.os }}
cuda_version: ${{ matrix.cuda_version }}
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'
gcs_bucket_name: 'comfy-ci-results'
google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
output_prefix: 'ComfyUI'
timeout: 50

- name: Test Lora Workflow
uses: drip-art/comfy-action@main
with:
os: ${{ matrix.os }}
cuda_version: ${{ matrix.cuda_version }}
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'
gcs_bucket_name: 'comfy-ci-results'
google_credentials: ${{ secrets.GCS_SERVICE_ACCOUNT_JSON }}
output_prefix: 'ComfyUI'
timeout: 50

0 comments on commit b6dfd22

Please sign in to comment.