mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-05 03:00:33 +08:00
Compare commits
8 Commits
31d30305f8
...
a0ec2bb749
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0ec2bb749 | ||
|
|
09725967cf | ||
|
|
5f62440fbb | ||
|
|
ac91c340f4 | ||
|
|
2db3b0ff90 | ||
|
|
6516ab335d | ||
|
|
ad53e78f11 | ||
|
|
2cb22c9afd |
6
.github/workflows/release-stable-all.yml
vendored
6
.github/workflows/release-stable-all.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
git_tag: ${{ inputs.git_tag }}
|
||||
cache_tag: "cu130"
|
||||
python_minor: "13"
|
||||
python_patch: "9"
|
||||
python_patch: "11"
|
||||
rel_name: "nvidia"
|
||||
rel_extra_name: ""
|
||||
test_release: true
|
||||
@ -65,11 +65,11 @@ jobs:
|
||||
contents: "write"
|
||||
packages: "write"
|
||||
pull-requests: "read"
|
||||
name: "Release AMD ROCm 7.1.1"
|
||||
name: "Release AMD ROCm 7.2"
|
||||
uses: ./.github/workflows/stable-release.yml
|
||||
with:
|
||||
git_tag: ${{ inputs.git_tag }}
|
||||
cache_tag: "rocm711"
|
||||
cache_tag: "rocm72"
|
||||
python_minor: "12"
|
||||
python_patch: "10"
|
||||
rel_name: "amd"
|
||||
|
||||
@ -479,10 +479,12 @@ class WanVAE(nn.Module):
|
||||
|
||||
def encode(self, x):
|
||||
conv_idx = [0]
|
||||
feat_map = [None] * count_conv3d(self.decoder)
|
||||
## cache
|
||||
t = x.shape[2]
|
||||
iter_ = 1 + (t - 1) // 4
|
||||
feat_map = None
|
||||
if iter_ > 1:
|
||||
feat_map = [None] * count_conv3d(self.decoder)
|
||||
## 对encode输入的x,按时间拆分为1、4、4、4....
|
||||
for i in range(iter_):
|
||||
conv_idx = [0]
|
||||
@ -502,10 +504,11 @@ class WanVAE(nn.Module):
|
||||
|
||||
def decode(self, z):
|
||||
conv_idx = [0]
|
||||
feat_map = [None] * count_conv3d(self.decoder)
|
||||
# z: [b,c,t,h,w]
|
||||
|
||||
iter_ = z.shape[2]
|
||||
feat_map = None
|
||||
if iter_ > 1:
|
||||
feat_map = [None] * count_conv3d(self.decoder)
|
||||
x = self.conv2(z)
|
||||
for i in range(iter_):
|
||||
conv_idx = [0]
|
||||
|
||||
@ -701,7 +701,14 @@ class Noise_EmptyNoise:
|
||||
|
||||
def generate_noise(self, input_latent):
|
||||
latent_image = input_latent["samples"]
|
||||
return torch.zeros(latent_image.shape, dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
|
||||
if latent_image.is_nested:
|
||||
tensors = latent_image.unbind()
|
||||
zeros = []
|
||||
for t in tensors:
|
||||
zeros.append(torch.zeros(t.shape, dtype=t.dtype, layout=t.layout, device="cpu"))
|
||||
return comfy.nested_tensor.NestedTensor(zeros)
|
||||
else:
|
||||
return torch.zeros(latent_image.shape, dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
|
||||
|
||||
|
||||
class Noise_RandomNoise:
|
||||
|
||||
@ -3,6 +3,7 @@ from typing import TypedDict
|
||||
from typing_extensions import override
|
||||
from comfy_api.latest import ComfyExtension, io
|
||||
from comfy_api.latest import _io
|
||||
from typing import Any
|
||||
|
||||
# sentinel for missing inputs
|
||||
MISSING = object()
|
||||
@ -255,6 +256,100 @@ class InvertBooleanNode(io.ComfyNode):
|
||||
def execute(cls, boolean: bool) -> io.NodeOutput:
|
||||
return io.NodeOutput(not boolean)
|
||||
|
||||
class BooleanLogicGate(io.ComfyNode):
|
||||
_MODES = ("NOT", "AND", "OR", "NAND", "NOR", "XOR", "XNOR")
|
||||
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
A = lambda: io.Boolean.Input("a")
|
||||
B = lambda: io.Boolean.Input("b")
|
||||
|
||||
return io.Schema(
|
||||
node_id="BooleanLogicGate",
|
||||
search_aliases=["not", "logic", "toggle"],
|
||||
display_name="Boolean Logic Gate",
|
||||
category="logic",
|
||||
inputs=[
|
||||
io.DynamicCombo.Input(
|
||||
"mode",
|
||||
options=[
|
||||
io.DynamicCombo.Option("NOT", [A()]),
|
||||
io.DynamicCombo.Option("AND", [A(), B()]),
|
||||
io.DynamicCombo.Option("OR", [A(), B()]),
|
||||
io.DynamicCombo.Option("NAND", [A(), B()]),
|
||||
io.DynamicCombo.Option("NOR", [A(), B()]),
|
||||
io.DynamicCombo.Option("XOR", [A(), B()]),
|
||||
io.DynamicCombo.Option("XNOR", [A(), B()]),
|
||||
],
|
||||
),
|
||||
],
|
||||
outputs=[io.Boolean.Output()],
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _deep_find_mode(x: Any) -> str | None:
|
||||
ops = set(BooleanLogicGate._MODES)
|
||||
|
||||
if isinstance(x, str):
|
||||
return x if x in ops else None
|
||||
|
||||
# bool is a subclass of int, so exclude bool here
|
||||
if isinstance(x, int) and not isinstance(x, bool):
|
||||
if 0 <= x < len(BooleanLogicGate._MODES):
|
||||
return BooleanLogicGate._MODES[x]
|
||||
return None
|
||||
|
||||
if isinstance(x, dict):
|
||||
# option name may appear as a key
|
||||
for k, v in x.items():
|
||||
if isinstance(k, str) and k in ops:
|
||||
return k
|
||||
m = BooleanLogicGate._deep_find_mode(v)
|
||||
if m:
|
||||
return m
|
||||
|
||||
if isinstance(x, (list, tuple)):
|
||||
for v in x:
|
||||
m = BooleanLogicGate._deep_find_mode(v)
|
||||
if m:
|
||||
return m
|
||||
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def _deep_get(x: Any, key: str, default: Any = None) -> Any:
|
||||
if isinstance(x, dict):
|
||||
if key in x:
|
||||
return x[key]
|
||||
for v in x.values():
|
||||
found = BooleanLogicGate._deep_get(v, key, default=default)
|
||||
if found is not default:
|
||||
return found
|
||||
elif isinstance(x, (list, tuple)):
|
||||
for v in x:
|
||||
found = BooleanLogicGate._deep_get(v, key, default=default)
|
||||
if found is not default:
|
||||
return found
|
||||
return default
|
||||
|
||||
@classmethod
|
||||
def execute(cls, mode: Any) -> io.NodeOutput:
|
||||
mode_str = cls._deep_find_mode(mode) or "NOT"
|
||||
a = bool(cls._deep_get(mode, "a"))
|
||||
b = bool(cls._deep_get(mode, "b", False)) # absent for NOT => False
|
||||
|
||||
_OPS = {
|
||||
"NOT": lambda a, b: not a,
|
||||
"AND": lambda a, b: a and b,
|
||||
"OR": lambda a, b: a or b,
|
||||
"NAND": lambda a, b: not (a and b),
|
||||
"NOR": lambda a, b: not (a or b),
|
||||
"XOR": lambda a, b: a ^ b,
|
||||
"XNOR": lambda a, b: not (a ^ b),
|
||||
}
|
||||
|
||||
return io.NodeOutput((_OPS[mode_str](a, b),))
|
||||
|
||||
class LogicExtension(ComfyExtension):
|
||||
@override
|
||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||
@ -268,6 +363,7 @@ class LogicExtension(ComfyExtension):
|
||||
# AutogrowPrefixTestNode,
|
||||
# ComboOutputTestNode,
|
||||
# InvertBooleanNode,
|
||||
BooleanLogicGate,
|
||||
]
|
||||
|
||||
async def comfy_entrypoint() -> LogicExtension:
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
# This file is automatically generated by the build process when version is
|
||||
# updated in pyproject.toml.
|
||||
__version__ = "0.10.0"
|
||||
__version__ = "0.11.0"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "ComfyUI"
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
readme = "README.md"
|
||||
license = { file = "LICENSE" }
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
comfyui-frontend-package==1.37.11
|
||||
comfyui-workflow-templates==0.8.15
|
||||
comfyui-workflow-templates==0.8.24
|
||||
comfyui-embedded-docs==0.4.0
|
||||
torch
|
||||
torchsde
|
||||
|
||||
Loading…
Reference in New Issue
Block a user