mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-28 10:21:27 +00:00
converted to V3 schema
This commit is contained in:
34
comfy_extras/v3/nodes_edit_model.py
Normal file
34
comfy_extras/v3/nodes_edit_model.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import node_helpers
|
||||
from comfy_api.v3 import io
|
||||
|
||||
|
||||
class ReferenceLatent(io.ComfyNodeV3):
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return io.SchemaV3(
|
||||
node_id="ReferenceLatent_V3",
|
||||
category="advanced/conditioning/edit_models",
|
||||
description="This node sets the guiding latent for an edit model. If the model supports it you can chain multiple to set multiple reference images.",
|
||||
inputs=[
|
||||
io.Conditioning.Input("conditioning"),
|
||||
io.Latent.Input("latent", optional=True),
|
||||
],
|
||||
outputs=[
|
||||
io.Conditioning.Output(),
|
||||
]
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, conditioning, latent=None):
|
||||
if latent is not None:
|
||||
conditioning = node_helpers.conditioning_set_values(
|
||||
conditioning, {"reference_latents": [latent["samples"]]}, append=True
|
||||
)
|
||||
return io.NodeOutput(conditioning)
|
||||
|
||||
|
||||
NODES_LIST = [
|
||||
ReferenceLatent,
|
||||
]
|
||||
Reference in New Issue
Block a user