mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-18 13:37:06 +08:00
Merge branch 'comfyanonymous:master' into chroma-support
This commit is contained in:
commit
cb3e388e8f
@ -1001,7 +1001,6 @@ class WAN21(BaseModel):
|
|||||||
device = kwargs["device"]
|
device = kwargs["device"]
|
||||||
|
|
||||||
if image is None:
|
if image is None:
|
||||||
image = torch.zeros_like(noise)
|
|
||||||
shape_image = list(noise.shape)
|
shape_image = list(noise.shape)
|
||||||
shape_image[1] = extra_channels
|
shape_image[1] = extra_channels
|
||||||
image = torch.zeros(shape_image, dtype=noise.dtype, layout=noise.layout, device=noise.device)
|
image = torch.zeros(shape_image, dtype=noise.dtype, layout=noise.layout, device=noise.device)
|
||||||
@ -1014,6 +1013,9 @@ class WAN21(BaseModel):
|
|||||||
if not self.image_to_video or extra_channels == image.shape[1]:
|
if not self.image_to_video or extra_channels == image.shape[1]:
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
if image.shape[1] > (extra_channels - 4):
|
||||||
|
image = image[:, :(extra_channels - 4)]
|
||||||
|
|
||||||
mask = kwargs.get("concat_mask", kwargs.get("denoise_mask", None))
|
mask = kwargs.get("concat_mask", kwargs.get("denoise_mask", None))
|
||||||
if mask is None:
|
if mask is None:
|
||||||
mask = torch.zeros_like(noise)[:, :4]
|
mask = torch.zeros_like(noise)[:, :4]
|
||||||
|
@ -446,7 +446,6 @@ class LTXVPreprocess:
|
|||||||
CATEGORY = "image"
|
CATEGORY = "image"
|
||||||
|
|
||||||
def preprocess(self, image, img_compression):
|
def preprocess(self, image, img_compression):
|
||||||
if img_compression > 0:
|
|
||||||
output_images = []
|
output_images = []
|
||||||
for i in range(image.shape[0]):
|
for i in range(image.shape[0]):
|
||||||
output_images.append(preprocess(image[i], img_compression))
|
output_images.append(preprocess(image[i], img_compression))
|
||||||
|
@ -87,6 +87,11 @@ class ImageCompositeMasked:
|
|||||||
CATEGORY = "image"
|
CATEGORY = "image"
|
||||||
|
|
||||||
def composite(self, destination, source, x, y, resize_source, mask = None):
|
def composite(self, destination, source, x, y, resize_source, mask = None):
|
||||||
|
if destination.shape[-1] < source.shape[-1]:
|
||||||
|
source = source[...,:destination.shape[-1]]
|
||||||
|
elif destination.shape[-1] > source.shape[-1]:
|
||||||
|
destination = torch.nn.functional.pad(destination, (0, 1))
|
||||||
|
destination[..., -1] = source[..., -1]
|
||||||
destination = destination.clone().movedim(-1, 1)
|
destination = destination.clone().movedim(-1, 1)
|
||||||
output = composite(destination, source.movedim(-1, 1), x, y, mask, 1, resize_source).movedim(1, -1)
|
output = composite(destination, source.movedim(-1, 1), x, y, mask, 1, resize_source).movedim(1, -1)
|
||||||
return (output,)
|
return (output,)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
comfyui-frontend-package==1.14.5
|
comfyui-frontend-package==1.14.6
|
||||||
torch
|
torch
|
||||||
torchsde
|
torchsde
|
||||||
torchvision
|
torchvision
|
||||||
|
Loading…
x
Reference in New Issue
Block a user