Skip to content

Commit

Permalink
Fix some loop node bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yolain committed Aug 22, 2024
1 parent 12002ac commit 093c3c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
17 changes: 12 additions & 5 deletions py/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .libs.utils import AlwaysEqualProxy, ByPassTypeTuple, cleanGPUUsedForce, compare_revision
from .libs.cache import remove_cache
import numpy as np
import re
import json
import torch
import comfy.utils
Expand Down Expand Up @@ -569,8 +570,8 @@ def INPUT_TYPES(cls):
inputs["optional"]["initial_value%d" % i] = ("*",)
return inputs

RETURN_TYPES = ByPassTypeTuple(tuple(["FLOW_CONTROL"] + ["*"] * MAX_FLOW_NUM))
RETURN_NAMES = ByPassTypeTuple(tuple(["flow"] + ["value%d" % i for i in range(MAX_FLOW_NUM)]))
RETURN_TYPES = tuple(["FLOW_CONTROL"] + ["*"] * MAX_FLOW_NUM)
RETURN_NAMES = tuple(["flow"] + ["value%d" % i for i in range(MAX_FLOW_NUM)])
FUNCTION = "while_loop_open"

CATEGORY = "EasyUse/Logic/While Loop"
Expand Down Expand Up @@ -603,8 +604,8 @@ def INPUT_TYPES(cls):
inputs["optional"]["initial_value%d" % i] = (AlwaysEqualProxy('*'),)
return inputs

RETURN_TYPES = ByPassTypeTuple(tuple([AlwaysEqualProxy('*')] * MAX_FLOW_NUM))
RETURN_NAMES = ByPassTypeTuple(tuple(["value%d" % i for i in range(MAX_FLOW_NUM)]))
RETURN_TYPES = tuple([AlwaysEqualProxy('*')] * MAX_FLOW_NUM)
RETURN_NAMES = tuple(["value%d" % i for i in range(MAX_FLOW_NUM)])
FUNCTION = "while_loop_close"

CATEGORY = "EasyUse/Logic/While Loop"
Expand Down Expand Up @@ -923,7 +924,13 @@ def batch(self, a, b):
if a.shape[1:] != b.shape[1:]:
b = comfy.utils.common_upscale(b.movedim(-1, 1), a.shape[2], a.shape[1], "bilinear", "center").movedim(1, -1)
return (torch.cat((a, b), 0),)
elif isinstance(a, (str, float, int, list, dict, tuple)):
elif isinstance(a, (str, float, int)):
if isinstance(b, tuple):
return (b + (a,),)
return ((a, b),)
elif isinstance(b, (str, float, int)):
if isinstance(a, tuple):
return (a + (b,),)
return ((a, b),)
else:
return (a + b,)
Expand Down
1 change: 0 additions & 1 deletion web_version/v2/assets/extensions-B7lGDrcJ.js

This file was deleted.

1 change: 1 addition & 0 deletions web_version/v2/assets/extensions-qfnDFtfW.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web_version/v2/easyuse.js

Large diffs are not rendered by default.

0 comments on commit 093c3c5

Please sign in to comment.