mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-17 05:52:31 +08:00
Merge upstream/master, keep local README.md
This commit is contained in:
commit
36ebf787cf
@ -858,7 +858,7 @@ class OmniProFirstLastFrameNode(IO.ComfyNode):
|
|||||||
tooltip="A text prompt describing the video content. "
|
tooltip="A text prompt describing the video content. "
|
||||||
"This can include both positive and negative descriptions.",
|
"This can include both positive and negative descriptions.",
|
||||||
),
|
),
|
||||||
IO.Combo.Input("duration", options=["5", "10"]),
|
IO.Int.Input("duration", default=5, min=3, max=10, display_mode=IO.NumberDisplay.slider),
|
||||||
IO.Image.Input("first_frame"),
|
IO.Image.Input("first_frame"),
|
||||||
IO.Image.Input(
|
IO.Image.Input(
|
||||||
"end_frame",
|
"end_frame",
|
||||||
@ -897,6 +897,10 @@ class OmniProFirstLastFrameNode(IO.ComfyNode):
|
|||||||
validate_string(prompt, min_length=1, max_length=2500)
|
validate_string(prompt, min_length=1, max_length=2500)
|
||||||
if end_frame is not None and reference_images is not None:
|
if end_frame is not None and reference_images is not None:
|
||||||
raise ValueError("The 'end_frame' input cannot be used simultaneously with 'reference_images'.")
|
raise ValueError("The 'end_frame' input cannot be used simultaneously with 'reference_images'.")
|
||||||
|
if duration not in (5, 10) and end_frame is None and reference_images is None:
|
||||||
|
raise ValueError(
|
||||||
|
"Duration is only supported for 5 or 10 seconds if there is no end frame or reference images."
|
||||||
|
)
|
||||||
validate_image_dimensions(first_frame, min_width=300, min_height=300)
|
validate_image_dimensions(first_frame, min_width=300, min_height=300)
|
||||||
validate_image_aspect_ratio(first_frame, (1, 2.5), (2.5, 1))
|
validate_image_aspect_ratio(first_frame, (1, 2.5), (2.5, 1))
|
||||||
image_list: list[OmniParamImage] = [
|
image_list: list[OmniParamImage] = [
|
||||||
|
|||||||
@ -760,8 +760,12 @@ class SamplerCustom(io.ComfyNode):
|
|||||||
out = latent.copy()
|
out = latent.copy()
|
||||||
out["samples"] = samples
|
out["samples"] = samples
|
||||||
if "x0" in x0_output:
|
if "x0" in x0_output:
|
||||||
|
x0_out = model.model.process_latent_out(x0_output["x0"].cpu())
|
||||||
|
if samples.is_nested:
|
||||||
|
latent_shapes = [x.shape for x in samples.unbind()]
|
||||||
|
x0_out = comfy.nested_tensor.NestedTensor(comfy.utils.unpack_latents(x0_out, latent_shapes))
|
||||||
out_denoised = latent.copy()
|
out_denoised = latent.copy()
|
||||||
out_denoised["samples"] = model.model.process_latent_out(x0_output["x0"].cpu())
|
out_denoised["samples"] = x0_out
|
||||||
else:
|
else:
|
||||||
out_denoised = out
|
out_denoised = out
|
||||||
return io.NodeOutput(out, out_denoised)
|
return io.NodeOutput(out, out_denoised)
|
||||||
@ -948,8 +952,12 @@ class SamplerCustomAdvanced(io.ComfyNode):
|
|||||||
out = latent.copy()
|
out = latent.copy()
|
||||||
out["samples"] = samples
|
out["samples"] = samples
|
||||||
if "x0" in x0_output:
|
if "x0" in x0_output:
|
||||||
|
x0_out = guider.model_patcher.model.process_latent_out(x0_output["x0"].cpu())
|
||||||
|
if samples.is_nested:
|
||||||
|
latent_shapes = [x.shape for x in samples.unbind()]
|
||||||
|
x0_out = comfy.nested_tensor.NestedTensor(comfy.utils.unpack_latents(x0_out, latent_shapes))
|
||||||
out_denoised = latent.copy()
|
out_denoised = latent.copy()
|
||||||
out_denoised["samples"] = guider.model_patcher.model.process_latent_out(x0_output["x0"].cpu())
|
out_denoised["samples"] = x0_out
|
||||||
else:
|
else:
|
||||||
out_denoised = out
|
out_denoised = out
|
||||||
return io.NodeOutput(out, out_denoised)
|
return io.NodeOutput(out, out_denoised)
|
||||||
|
|||||||
@ -3,7 +3,9 @@ import comfy.utils
|
|||||||
import math
|
import math
|
||||||
from typing_extensions import override
|
from typing_extensions import override
|
||||||
from comfy_api.latest import ComfyExtension, io
|
from comfy_api.latest import ComfyExtension, io
|
||||||
|
import comfy.model_management
|
||||||
|
import torch
|
||||||
|
import nodes
|
||||||
|
|
||||||
class TextEncodeQwenImageEdit(io.ComfyNode):
|
class TextEncodeQwenImageEdit(io.ComfyNode):
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -104,12 +106,37 @@ class TextEncodeQwenImageEditPlus(io.ComfyNode):
|
|||||||
return io.NodeOutput(conditioning)
|
return io.NodeOutput(conditioning)
|
||||||
|
|
||||||
|
|
||||||
|
class EmptyQwenImageLayeredLatentImage(io.ComfyNode):
|
||||||
|
@classmethod
|
||||||
|
def define_schema(cls):
|
||||||
|
return io.Schema(
|
||||||
|
node_id="EmptyQwenImageLayeredLatentImage",
|
||||||
|
display_name="Empty Qwen Image Layered Latent",
|
||||||
|
category="latent/qwen",
|
||||||
|
inputs=[
|
||||||
|
io.Int.Input("width", default=640, min=16, max=nodes.MAX_RESOLUTION, step=16),
|
||||||
|
io.Int.Input("height", default=640, min=16, max=nodes.MAX_RESOLUTION, step=16),
|
||||||
|
io.Int.Input("layers", default=3, min=0, max=nodes.MAX_RESOLUTION, step=1),
|
||||||
|
io.Int.Input("batch_size", default=1, min=1, max=4096),
|
||||||
|
],
|
||||||
|
outputs=[
|
||||||
|
io.Latent.Output(),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def execute(cls, width, height, layers, batch_size=1) -> io.NodeOutput:
|
||||||
|
latent = torch.zeros([batch_size, 16, layers + 1, height // 8, width // 8], device=comfy.model_management.intermediate_device())
|
||||||
|
return io.NodeOutput({"samples": latent})
|
||||||
|
|
||||||
|
|
||||||
class QwenExtension(ComfyExtension):
|
class QwenExtension(ComfyExtension):
|
||||||
@override
|
@override
|
||||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||||
return [
|
return [
|
||||||
TextEncodeQwenImageEdit,
|
TextEncodeQwenImageEdit,
|
||||||
TextEncodeQwenImageEditPlus,
|
TextEncodeQwenImageEditPlus,
|
||||||
|
EmptyQwenImageLayeredLatentImage,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
comfyui-frontend-package==1.34.9
|
comfyui-frontend-package==1.34.9
|
||||||
comfyui-workflow-templates==0.7.60
|
comfyui-workflow-templates==0.7.62
|
||||||
comfyui-embedded-docs==0.3.1
|
comfyui-embedded-docs==0.3.1
|
||||||
torch
|
torch
|
||||||
torchsde
|
torchsde
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user