mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-18 22:42:35 +08:00
Merge upstream/master, keep local README.md
This commit is contained in:
commit
9886d3ff63
@ -188,6 +188,12 @@ class IndexListContextHandler(ContextHandlerABC):
|
|||||||
audio_cond = cond_value.cond
|
audio_cond = cond_value.cond
|
||||||
if audio_cond.ndim > 1 and audio_cond.size(1) == x_in.size(self.dim):
|
if audio_cond.ndim > 1 and audio_cond.size(1) == x_in.size(self.dim):
|
||||||
new_cond_item[cond_key] = cond_value._copy_with(window.get_tensor(audio_cond, device, dim=1))
|
new_cond_item[cond_key] = cond_value._copy_with(window.get_tensor(audio_cond, device, dim=1))
|
||||||
|
# Handle vace_context (temporal dim is 3)
|
||||||
|
elif cond_key == "vace_context" and hasattr(cond_value, "cond") and isinstance(cond_value.cond, torch.Tensor):
|
||||||
|
vace_cond = cond_value.cond
|
||||||
|
if vace_cond.ndim >= 4 and vace_cond.size(3) == x_in.size(self.dim):
|
||||||
|
sliced_vace = window.get_tensor(vace_cond, device, dim=3, retain_index_list=self.cond_retain_index_list)
|
||||||
|
new_cond_item[cond_key] = cond_value._copy_with(sliced_vace)
|
||||||
# if has cond that is a Tensor, check if needs to be subset
|
# if has cond that is a Tensor, check if needs to be subset
|
||||||
elif hasattr(cond_value, "cond") and isinstance(cond_value.cond, torch.Tensor):
|
elif hasattr(cond_value, "cond") and isinstance(cond_value.cond, torch.Tensor):
|
||||||
if (self.dim < cond_value.cond.ndim and cond_value.cond.size(self.dim) == x_in.size(self.dim)) or \
|
if (self.dim < cond_value.cond.ndim and cond_value.cond.size(self.dim) == x_in.size(self.dim)) or \
|
||||||
|
|||||||
@ -229,6 +229,7 @@ class ByteDanceImageEditNode(IO.ComfyNode):
|
|||||||
IO.Hidden.unique_id,
|
IO.Hidden.unique_id,
|
||||||
],
|
],
|
||||||
is_api_node=True,
|
is_api_node=True,
|
||||||
|
is_deprecated=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -269,7 +270,7 @@ class ByteDanceSeedreamNode(IO.ComfyNode):
|
|||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
return IO.Schema(
|
return IO.Schema(
|
||||||
node_id="ByteDanceSeedreamNode",
|
node_id="ByteDanceSeedreamNode",
|
||||||
display_name="ByteDance Seedream 4",
|
display_name="ByteDance Seedream 4.5",
|
||||||
category="api node/image/ByteDance",
|
category="api node/image/ByteDance",
|
||||||
description="Unified text-to-image generation and precise single-sentence editing at up to 4K resolution.",
|
description="Unified text-to-image generation and precise single-sentence editing at up to 4K resolution.",
|
||||||
inputs=[
|
inputs=[
|
||||||
|
|||||||
@ -667,16 +667,19 @@ class ResizeImagesByLongerEdgeNode(ImageProcessingNode):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _process(cls, image, longer_edge):
|
def _process(cls, image, longer_edge):
|
||||||
img = tensor_to_pil(image)
|
resized_images = []
|
||||||
w, h = img.size
|
for image_i in image:
|
||||||
if w > h:
|
img = tensor_to_pil(image_i)
|
||||||
new_w = longer_edge
|
w, h = img.size
|
||||||
new_h = int(h * (longer_edge / w))
|
if w > h:
|
||||||
else:
|
new_w = longer_edge
|
||||||
new_h = longer_edge
|
new_h = int(h * (longer_edge / w))
|
||||||
new_w = int(w * (longer_edge / h))
|
else:
|
||||||
img = img.resize((new_w, new_h), Image.Resampling.LANCZOS)
|
new_h = longer_edge
|
||||||
return pil_to_tensor(img)
|
new_w = int(w * (longer_edge / h))
|
||||||
|
img = img.resize((new_w, new_h), Image.Resampling.LANCZOS)
|
||||||
|
resized_images.append(pil_to_tensor(img))
|
||||||
|
return torch.cat(resized_images, dim=0)
|
||||||
|
|
||||||
|
|
||||||
class CenterCropImagesNode(ImageProcessingNode):
|
class CenterCropImagesNode(ImageProcessingNode):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user