mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-12 18:22:53 +08:00
Merge branch 'master' into fix/api-nodes/detect-internet-fail
This commit is contained in:
commit
8f021600d7
@ -106,12 +106,12 @@ class LTXVImgToVideoInplace(io.ComfyNode):
|
|||||||
if bypass:
|
if bypass:
|
||||||
return (latent,)
|
return (latent,)
|
||||||
|
|
||||||
samples = latent["samples"]
|
samples = latent["samples"].clone()
|
||||||
_, height_scale_factor, width_scale_factor = (
|
_, height_scale_factor, width_scale_factor = (
|
||||||
vae.downscale_index_formula
|
vae.downscale_index_formula
|
||||||
)
|
)
|
||||||
|
|
||||||
batch, _, latent_frames, latent_height, latent_width = samples.shape
|
_, _, _, latent_height, latent_width = samples.shape
|
||||||
width = latent_width * width_scale_factor
|
width = latent_width * width_scale_factor
|
||||||
height = latent_height * height_scale_factor
|
height = latent_height * height_scale_factor
|
||||||
|
|
||||||
@ -124,11 +124,7 @@ class LTXVImgToVideoInplace(io.ComfyNode):
|
|||||||
|
|
||||||
samples[:, :, :t.shape[2]] = t
|
samples[:, :, :t.shape[2]] = t
|
||||||
|
|
||||||
conditioning_latent_frames_mask = torch.ones(
|
conditioning_latent_frames_mask = get_noise_mask(latent)
|
||||||
(batch, 1, latent_frames, 1, 1),
|
|
||||||
dtype=torch.float32,
|
|
||||||
device=samples.device,
|
|
||||||
)
|
|
||||||
conditioning_latent_frames_mask[:, :, :t.shape[2]] = 1.0 - strength
|
conditioning_latent_frames_mask[:, :, :t.shape[2]] = 1.0 - strength
|
||||||
|
|
||||||
return io.NodeOutput({"samples": samples, "noise_mask": conditioning_latent_frames_mask})
|
return io.NodeOutput({"samples": samples, "noise_mask": conditioning_latent_frames_mask})
|
||||||
@ -236,7 +232,7 @@ class LTXVAddGuide(io.ComfyNode):
|
|||||||
def encode(cls, vae, latent_width, latent_height, images, scale_factors):
|
def encode(cls, vae, latent_width, latent_height, images, scale_factors):
|
||||||
time_scale_factor, width_scale_factor, height_scale_factor = scale_factors
|
time_scale_factor, width_scale_factor, height_scale_factor = scale_factors
|
||||||
images = images[:(images.shape[0] - 1) // time_scale_factor * time_scale_factor + 1]
|
images = images[:(images.shape[0] - 1) // time_scale_factor * time_scale_factor + 1]
|
||||||
pixels = comfy.utils.common_upscale(images.movedim(-1, 1), latent_width * width_scale_factor, latent_height * height_scale_factor, "bilinear", crop="disabled").movedim(1, -1)
|
pixels = comfy.utils.common_upscale(images.movedim(-1, 1), latent_width * width_scale_factor, latent_height * height_scale_factor, "bilinear", crop="center").movedim(1, -1)
|
||||||
encode_pixels = pixels[:, :, :, :3]
|
encode_pixels = pixels[:, :, :, :3]
|
||||||
t = vae.encode(encode_pixels)
|
t = vae.encode(encode_pixels)
|
||||||
return encode_pixels, t
|
return encode_pixels, t
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user