From 3a4d9980027b66171c38e3cadb2810951b991484 Mon Sep 17 00:00:00 2001 From: snomiao Date: Mon, 20 Jan 2025 21:27:13 +0000 Subject: [PATCH 1/2] chore(publish): update GitHub Actions workflow for node publishing - Add permissions for issue writing - Update action version to v1 for publish-node-action - Add condition to run job only for 'Kosinkadink' repository owner --- .github/workflows/publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 122a1ae..27bcdb1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,14 +7,18 @@ on: paths: - "pyproject.toml" +permissions: + issues: write + jobs: publish-node: name: Publish Custom Node to registry runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'Kosinkadink' }} steps: - name: Check out code uses: actions/checkout@v4 - name: Publish Custom Node - uses: Comfy-Org/publish-node-action@main + uses: Comfy-Org/publish-node-action@v1 with: - personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} ## Add your own personal access token to your Github Repository secrets and reference it here. \ No newline at end of file + personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} ## Add your own personal access token to your Github Repository secrets and reference it here. From 7fbcf03843d12ba26c0603ca80f62575a8700ecf Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Wed, 29 Jan 2025 09:16:39 -0600 Subject: [PATCH 2/2] Values related to ad_params now obtained through transformer_options in get_control_inject, no longer requiring ADE to manually set them --- adv_control/control_reference.py | 2 +- adv_control/sampling.py | 4 +--- adv_control/utils.py | 9 +++++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/adv_control/control_reference.py b/adv_control/control_reference.py index f5fe8f1..cba8340 100644 --- a/adv_control/control_reference.py +++ b/adv_control/control_reference.py @@ -162,7 +162,7 @@ class ReferenceAdvanced(ControlBase, AdvancedControlBase): self.extra_hooks = extra_hooks.clone() if extra_hooks else self.import_and_create_wrapper_hooks() # ContextRef stuff self.is_context_ref = False - self.contextref_cond_idx = -1 + self.contextref_cond_idx = -1 # NOTE: does nothing ever since conds got uuids associated with them; can remove self.contextref_version = RETURNED_CONTEXTREF_VERSION @property diff --git a/adv_control/sampling.py b/adv_control/sampling.py index 7f2e9ec..104fa5d 100644 --- a/adv_control/sampling.py +++ b/adv_control/sampling.py @@ -18,9 +18,7 @@ from .control_reference import (ReferenceAdvanced, ReferenceInjections, handle_context_ref_setup, handle_reference_injection, REF_CONTROL_LIST_ALL, CONTEXTREF_CLEAN_FUNC) from .dinklink import get_dinklink -from .utils import torch_dfs, WrapperConsts - -CURRENT_WRAPPER_VERSION = 10001 +from .utils import torch_dfs, WrapperConsts, CURRENT_WRAPPER_VERSION def prepare_dinklink_acn_wrapper(): # expose acn_sampler_sample_wrapper diff --git a/adv_control/utils.py b/adv_control/utils.py index 4dc7363..d4221d0 100644 --- a/adv_control/utils.py +++ b/adv_control/utils.py @@ -35,6 +35,8 @@ def load_torch_file_with_dict_factory(controlnet_data: dict[str, Tensor], orig_l return load_torch_file_with_dict +CURRENT_WRAPPER_VERSION = 10002 + class WrapperConsts: ACN = "ACN" VERSION = "version" @@ -480,6 +482,8 @@ class WeightTypeException(TypeError): class AdvancedControlBase: + ACN_VERSION = CURRENT_WRAPPER_VERSION + def __init__(self, base: ControlBase, timestep_keyframes: TimestepKeyframeGroup, weights_default: ControlWeights, require_vae=False, allow_condhint_latents=False): self.base = base self.compatible_weights = [ControlWeightType.UNIVERSAL, ControlWeightType.DEFAULT] @@ -679,6 +683,11 @@ class AdvancedControlBase: self.batched_number = batched_number self.batch_size = len(t) self.cond_or_uncond = transformer_options.get("cond_or_uncond", None) + # fill out ad_param-related fields, if present + if "ad_params" in transformer_options: + self.sub_idxs = transformer_options["ad_params"]["sub_idxs"] + self.full_latent_length = transformer_options["ad_params"]["full_length"] + self.context_length = transformer_options["ad_params"]["context_length"] # prepare timestep and everything related self.prepare_current_timestep(t=t, transformer_options=transformer_options) # if should not perform any actions for the controlnet, exit without doing any work