mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 04:40:15 +08:00
Move nodes_lt into expected spot for this fork
This commit is contained in:
parent
f39b8dfebc
commit
63a00aedb5
@ -1,17 +1,22 @@
|
|||||||
import nodes
|
import math
|
||||||
import node_helpers
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
import comfy.model_management
|
import comfy.model_management
|
||||||
import comfy.model_sampling
|
import comfy.model_sampling
|
||||||
import math
|
import comfy.utils
|
||||||
|
from comfy import node_helpers
|
||||||
|
from comfy.nodes import base_nodes as nodes
|
||||||
|
|
||||||
|
|
||||||
class EmptyLTXVLatentVideo:
|
class EmptyLTXVLatentVideo:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": { "width": ("INT", {"default": 768, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 32}),
|
return {"required": {"width": ("INT", {"default": 768, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 32}),
|
||||||
"height": ("INT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 32}),
|
"height": ("INT", {"default": 512, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 32}),
|
||||||
"length": ("INT", {"default": 97, "min": 9, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
"length": ("INT", {"default": 97, "min": 9, "max": nodes.MAX_RESOLUTION, "step": 8}),
|
||||||
"batch_size": ("INT", {"default": 1, "min": 1, "max": 4096})}}
|
"batch_size": ("INT", {"default": 1, "min": 1, "max": 4096})}}
|
||||||
|
|
||||||
RETURN_TYPES = ("LATENT",)
|
RETURN_TYPES = ("LATENT",)
|
||||||
FUNCTION = "generate"
|
FUNCTION = "generate"
|
||||||
|
|
||||||
@ -19,14 +24,14 @@ class EmptyLTXVLatentVideo:
|
|||||||
|
|
||||||
def generate(self, width, height, length, batch_size=1):
|
def generate(self, width, height, length, batch_size=1):
|
||||||
latent = torch.zeros([batch_size, 128, ((length - 1) // 8) + 1, height // 32, width // 32], device=comfy.model_management.intermediate_device())
|
latent = torch.zeros([batch_size, 128, ((length - 1) // 8) + 1, height // 32, width // 32], device=comfy.model_management.intermediate_device())
|
||||||
return ({"samples": latent}, )
|
return ({"samples": latent},)
|
||||||
|
|
||||||
|
|
||||||
class LTXVImgToVideo:
|
class LTXVImgToVideo:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": {"positive": ("CONDITIONING", ),
|
return {"required": {"positive": ("CONDITIONING",),
|
||||||
"negative": ("CONDITIONING", ),
|
"negative": ("CONDITIONING",),
|
||||||
"vae": ("VAE",),
|
"vae": ("VAE",),
|
||||||
"image": ("IMAGE",),
|
"image": ("IMAGE",),
|
||||||
"width": ("INT", {"default": 768, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 32}),
|
"width": ("INT", {"default": 768, "min": 64, "max": nodes.MAX_RESOLUTION, "step": 32}),
|
||||||
@ -49,16 +54,17 @@ class LTXVImgToVideo:
|
|||||||
|
|
||||||
latent = torch.zeros([batch_size, 128, ((length - 1) // 8) + 1, height // 32, width // 32], device=comfy.model_management.intermediate_device())
|
latent = torch.zeros([batch_size, 128, ((length - 1) // 8) + 1, height // 32, width // 32], device=comfy.model_management.intermediate_device())
|
||||||
latent[:, :, :t.shape[2]] = t
|
latent[:, :, :t.shape[2]] = t
|
||||||
return (positive, negative, {"samples": latent}, )
|
return (positive, negative, {"samples": latent},)
|
||||||
|
|
||||||
|
|
||||||
class LTXVConditioning:
|
class LTXVConditioning:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": {"positive": ("CONDITIONING", ),
|
return {"required": {"positive": ("CONDITIONING",),
|
||||||
"negative": ("CONDITIONING", ),
|
"negative": ("CONDITIONING",),
|
||||||
"frame_rate": ("FLOAT", {"default": 25.0, "min": 0.0, "max": 1000.0, "step": 0.01}),
|
"frame_rate": ("FLOAT", {"default": 25.0, "min": 0.0, "max": 1000.0, "step": 0.01}),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
RETURN_TYPES = ("CONDITIONING", "CONDITIONING")
|
RETURN_TYPES = ("CONDITIONING", "CONDITIONING")
|
||||||
RETURN_NAMES = ("positive", "negative")
|
RETURN_NAMES = ("positive", "negative")
|
||||||
FUNCTION = "append"
|
FUNCTION = "append"
|
||||||
@ -74,10 +80,10 @@ class LTXVConditioning:
|
|||||||
class ModelSamplingLTXV:
|
class ModelSamplingLTXV:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": { "model": ("MODEL",),
|
return {"required": {"model": ("MODEL",),
|
||||||
"max_shift": ("FLOAT", {"default": 2.05, "min": 0.0, "max": 100.0, "step":0.01}),
|
"max_shift": ("FLOAT", {"default": 2.05, "min": 0.0, "max": 100.0, "step": 0.01}),
|
||||||
"base_shift": ("FLOAT", {"default": 0.95, "min": 0.0, "max": 100.0, "step":0.01}),
|
"base_shift": ("FLOAT", {"default": 0.95, "min": 0.0, "max": 100.0, "step": 0.01}),
|
||||||
},
|
},
|
||||||
"optional": {"latent": ("LATENT",), }
|
"optional": {"latent": ("LATENT",), }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +115,7 @@ class ModelSamplingLTXV:
|
|||||||
model_sampling = ModelSamplingAdvanced(model.model.model_config)
|
model_sampling = ModelSamplingAdvanced(model.model.model_config)
|
||||||
model_sampling.set_parameters(shift=shift)
|
model_sampling.set_parameters(shift=shift)
|
||||||
m.add_object_patch("model_sampling", model_sampling)
|
m.add_object_patch("model_sampling", model_sampling)
|
||||||
return (m, )
|
return (m,)
|
||||||
|
|
||||||
|
|
||||||
class LTXVScheduler:
|
class LTXVScheduler:
|
||||||
@ -117,22 +123,22 @@ class LTXVScheduler:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required":
|
return {"required":
|
||||||
{"steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
|
{"steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
|
||||||
"max_shift": ("FLOAT", {"default": 2.05, "min": 0.0, "max": 100.0, "step":0.01}),
|
"max_shift": ("FLOAT", {"default": 2.05, "min": 0.0, "max": 100.0, "step": 0.01}),
|
||||||
"base_shift": ("FLOAT", {"default": 0.95, "min": 0.0, "max": 100.0, "step":0.01}),
|
"base_shift": ("FLOAT", {"default": 0.95, "min": 0.0, "max": 100.0, "step": 0.01}),
|
||||||
"stretch": ("BOOLEAN", {
|
"stretch": ("BOOLEAN", {
|
||||||
"default": True,
|
"default": True,
|
||||||
"tooltip": "Stretch the sigmas to be in the range [terminal, 1]."
|
"tooltip": "Stretch the sigmas to be in the range [terminal, 1]."
|
||||||
}),
|
}),
|
||||||
"terminal": (
|
"terminal": (
|
||||||
"FLOAT",
|
"FLOAT",
|
||||||
{
|
{
|
||||||
"default": 0.1, "min": 0.0, "max": 0.99, "step": 0.01,
|
"default": 0.1, "min": 0.0, "max": 0.99, "step": 0.01,
|
||||||
"tooltip": "The terminal value of the sigmas after stretching."
|
"tooltip": "The terminal value of the sigmas after stretching."
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
"optional": {"latent": ("LATENT",), }
|
"optional": {"latent": ("LATENT",), }
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("SIGMAS",)
|
RETURN_TYPES = ("SIGMAS",)
|
||||||
CATEGORY = "sampling/custom_sampling/schedulers"
|
CATEGORY = "sampling/custom_sampling/schedulers"
|
||||||
Loading…
Reference in New Issue
Block a user