From a285786a35734c7beac449bc4de2b197eb2994f6 Mon Sep 17 00:00:00 2001 From: Dominik Bargiel Date: Mon, 15 Jun 2026 19:37:45 +0200 Subject: [PATCH] Refresh README and registry publish workflow --- .github/workflows/publish_action.yml | 44 +++++++++- README.md | 118 +++++++++++++++------------ pyproject.toml | 2 +- 3 files changed, 108 insertions(+), 56 deletions(-) diff --git a/.github/workflows/publish_action.yml b/.github/workflows/publish_action.yml index e3c5c78..20d37e1 100644 --- a/.github/workflows/publish_action.yml +++ b/.github/workflows/publish_action.yml @@ -1,4 +1,5 @@ name: Publish to Comfy registry + on: workflow_dispatch: push: @@ -7,14 +8,49 @@ on: paths: - "pyproject.toml" +permissions: + contents: read + jobs: publish-node: name: Publish Custom Node to registry runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v4 - - name: Publish Custom Node - uses: Comfy-Org/publish-node-action@main + uses: actions/checkout@v5 with: - personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} ## Add your own personal access token to your Github Repository secrets and reference it here. + fetch-depth: 0 + + - name: Check whether this should publish + id: publish-check + shell: bash + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "publish=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if git diff "${{ github.event.before }}" "${{ github.sha }}" -- pyproject.toml | grep -E '^[+-]version = '; then + echo "publish=true" >> "$GITHUB_OUTPUT" + else + echo "pyproject.toml changed, but the version did not. Skipping registry publish." + echo "publish=false" >> "$GITHUB_OUTPUT" + fi + + - name: Set up Python + if: steps.publish-check.outputs.publish == 'true' + uses: actions/setup-python@v6 + with: + python-version: "3.10" + + - name: Install comfy-cli + if: steps.publish-check.outputs.publish == 'true' + run: python -m pip install --upgrade pip comfy-cli + + - name: Publish Custom Node + if: steps.publish-check.outputs.publish == 'true' + env: + REGISTRY_ACCESS_TOKEN: ${{ secrets.REGISTRY_ACCESS_TOKEN }} + run: | + comfy --skip-prompt --no-enable-telemetry env + comfy node publish --token "$REGISTRY_ACCESS_TOKEN" diff --git a/README.md b/README.md index a0106f0..24be238 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,47 @@ # ComfyUI Deadline Plugin -Submit ComfyUI workflows to Thinkbox Deadline. +Submit ComfyUI jobs to Thinkbox Deadline from inside ComfyUI. -## Features +Quick demo: -- Submit the current ComfyUI API prompt directly to Deadline -- Submit-only local execution: normal output nodes are not rendered on the submitter -- Deadline variation jobs using `batch_count` and `chunk_size` -- Deterministic seed variation through the `DeadlineSeed` node -- Stages referenced default ComfyUI input assets beside the output directory -- Stores the normal ComfyUI `workflow.json` with node placement in the Deadline job files -- Launches isolated portable Windows ComfyUI worker instances -- Preserves compatibility flags used by `ComfyUI-Deadline-Distributed` +

+ + ComfyUI x Deadline demo + +

-## Installation +This plugin adds two nodes: -### ComfyUI +- `Submit to Deadline` sends the current workflow to the farm. +- `DeadlineSeed` gives each Deadline variation a predictable seed. + +The submitter does not render the workflow locally. It only packages the job and sends it to Deadline. + +## Install + +Clone this into `ComfyUI/custom_nodes`: ```bash -cd ComfyUI/custom_nodes git clone https://github.com/doubletwisted/ComfyUI-Deadline-Plugin.git ``` -Restart ComfyUI after installing or updating. +Restart ComfyUI. -### Deadline - -Deploy `plugins/ComfyUI/` into your Deadline Repository `custom/plugins/` directory, then restart Deadline services or reload the repository plugin. - -For render-farm maintenance, this repo includes publishable templates in `scripts/maintenance`. Copy those scripts to a shared path reachable by Workers, update their default paths or pass overrides, then submit them as Deadline maintenance jobs: - -```powershell -python \\YOUR-SERVER\share\scripts\maintenance\submit_comfy_sync.py --type both -``` - -The maintenance submitter can submit the ComfyUI install sync, the model sync, or both: - -```powershell -python \\YOUR-SERVER\share\scripts\maintenance\submit_comfy_sync.py --type installation -python \\YOUR-SERVER\share\scripts\maintenance\submit_comfy_sync.py --type models -``` - -For Deadline repository plugin deploys, this repo includes a direct deploy helper: +Then deploy the Deadline plugin: ```powershell powershell.exe -ExecutionPolicy Bypass -File .\scripts\deploy_deadline_plugin.ps1 ``` -The deploy script discovers the repository with `deadlinecommand -GetRepositoryPath`. You can also pass either the repository root or the custom plugins folder explicitly: +The deploy script asks Deadline where the repository lives by running `deadlinecommand -GetRepositoryPath`, then copies `plugins/ComfyUI` into `custom/plugins/ComfyUI`. + +You can also point it at the repo yourself: ```powershell powershell.exe -ExecutionPolicy Bypass -File .\scripts\deploy_deadline_plugin.ps1 -RepositoryPath "\\YOUR-SERVER\Repository\custom\plugins" ``` -In Deadline Monitor, configure the ComfyUI plugin `ComfyUI Installation Paths` setting. Use one portable Windows ComfyUI root per line: +In Deadline Monitor, set the ComfyUI plugin's `ComfyUI Installation Paths`. Put one portable ComfyUI root per line: ```text C:\ComfyUI_windows_portable @@ -61,36 +49,64 @@ D:\Apps\ComfyUI \\YOUR-SERVER\software\ComfyUI ``` -Workers try each entry in order after Deadline path mapping and pick the first path containing both `ComfyUI\main.py` and `python_embeded\python.exe`. +Workers try those paths in order and use the first one that contains `ComfyUI\main.py` and `python_embeded\python.exe`. -## Usage +## Use It -1. Add `Submit to Deadline` to the workflow. -2. Set a farm-visible `output_directory`. -3. Use `DeadlineSeed` anywhere a seed value should vary between Deadline variations. -4. Run the workflow in ComfyUI. -5. Monitor the submitted job in Deadline Monitor. +Add `Submit to Deadline` to your workflow, set `output_directory` to a path the farm can see, and run the workflow in ComfyUI. -`batch_count` is the total number of Deadline variations. `chunk_size` is how many variations a single Deadline task should queue into its worker ComfyUI instance. These are not animation frame ranges; Deadline frames are used internally as variation indices. +Use `batch_count` for how many variations you want. Use `chunk_size` for how many variations a Deadline task should process before it finishes. These are variations, not animation frames. -For a `DeadlineSeed` base seed of `1000`, variation `0` uses `1000`, variation `1` uses `1001`, and so on. The worker rewrites the queued prompt before execution, so saved image metadata contains the actual seed used. Additional Deadline metadata is written under `extra_pnginfo.deadline`. +If you want seeds to change per variation, use `DeadlineSeed`. A base seed of `1000` becomes: -Deadline jobs include two workflow files when ComfyUI provides the UI workflow metadata: `prompt_to_execute.json` is the API prompt used by the worker, and `workflow.json` is the standard ComfyUI workflow with node positions. Patched workers embed the standard workflow metadata into outputs, so dropping a generated image back into ComfyUI opens the normal graph layout, not the API prompt format. +```text +variation 0 -> 1000 +variation 1 -> 1001 +variation 2 -> 1002 +``` -## Input Staging +## Input Files -Default ComfyUI upload nodes such as `Load Image`, `Load Audio`, and `Load Video` store files in the local `ComfyUI/input` folder. On submission, this plugin copies referenced input assets to a shared sibling input folder beside the output directory: +Normal ComfyUI loader nodes copy pasted or uploaded files into `ComfyUI/input`. That folder usually exists only on the machine where you submitted the job, so the plugin stages those referenced files next to your output folder: ```text \input\ ``` -Workers launch ComfyUI with `--input-directory` pointing at that staged folder. The embedded standard workflow metadata is rewritten to use absolute staged asset paths, so another ComfyUI session on a different machine can reopen the generated image as long as that shared input path is visible there. Missing or invalid referenced input files fail submission before the Deadline job is sent. +Workers start ComfyUI with that folder as `--input-directory`. -Only files referenced by the submitted prompt are copied. Existing identical files are reused; conflicting filenames get a submission suffix. Absolute path loader nodes are left unchanged and must already point to farm-visible storage. +Only files used by the submitted prompt are copied. If a file already exists and is identical, it is reused. If the name collides with a different file, the plugin gives the staged copy a unique suffix. + +Absolute path loader nodes are left alone. Those paths must already be valid on the farm. + +## Workflow Metadata + +Deadline gets both files: + +- `prompt_to_execute.json` is the API prompt the worker renders. +- `workflow.json` is the normal ComfyUI workflow with node positions. + +The worker writes the normal workflow metadata back into the output image when ComfyUI provides it. So dragging the finished image back into ComfyUI should reopen the readable graph, not the ugly API-format graph. + +## Maintenance Scripts + +There are sanitized Deadline maintenance-job templates in `scripts/maintenance`. + +Copy them somewhere your workers can reach, edit the default paths, then submit sync jobs with: + +```powershell +python \\YOUR-SERVER\share\scripts\maintenance\submit_comfy_sync.py --type both +``` + +You can also run only one side: + +```powershell +python \\YOUR-SERVER\share\scripts\maintenance\submit_comfy_sync.py --type installation +python \\YOUR-SERVER\share\scripts\maintenance\submit_comfy_sync.py --type models +``` ## Notes -- This V2 path targets portable Windows ComfyUI workers. -- Deadline owns render timeout policy; configure timeouts in Deadline Monitor. -- The base plugin no longer registers mock `/deadline/*` routes. Distributed-worker routes remain owned by `ComfyUI-Deadline-Distributed`. +- This targets portable Windows ComfyUI workers. +- Deadline handles render timeouts. Set those in Deadline Monitor. +- The old fake `/deadline/*` API routes are gone from this plugin. If you use `ComfyUI-Deadline-Distributed`, it owns its own routes. diff --git a/pyproject.toml b/pyproject.toml index 8625616..7b9893f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "comfyui-deadline-plugin" -version = "1.0.5" +version = "1.0.6" description = "ComfyUI plugin for submitting workflows to Thinkbox Deadline for distributed rendering" readme = "README.md" license = {text = "MIT"}