Add context setter nodes for image and latent
- Add TT_ContextSetImage node with documentation - Add TT_ContextSetLatent node with documentation
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from .nodes.context.base_context import TT_BaseContext
|
||||
from .nodes.context.context import TT_Context
|
||||
from .nodes.context.context_passthrough import TT_ContextPassthrough
|
||||
from .nodes.context.context_set_image import TT_ContextSetImage
|
||||
from .nodes.context.context_set_latent import TT_ContextSetLatent
|
||||
from .nodes.context.even_larger_context import TT_EvenLargerContext
|
||||
from .nodes.context.large_context_flux import TT_LargeContextFlux
|
||||
from .nodes.context.large_context_sdxl import TT_LargeContextSdxl
|
||||
@@ -40,6 +42,8 @@ NODE_CLASS_MAPPINGS = {
|
||||
"TT_LargeContextFlux": TT_LargeContextFlux,
|
||||
"TT_LargeContextSdxl": TT_LargeContextSdxl,
|
||||
"TT_EvenLargerContext": TT_EvenLargerContext,
|
||||
"TT_ContextSetImage": TT_ContextSetImage,
|
||||
"TT_ContextSetLatent": TT_ContextSetLatent,
|
||||
# Context Passthrough
|
||||
"TT_ContextPassthrough": TT_ContextPassthrough,
|
||||
# Image
|
||||
@@ -87,8 +91,11 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"TT_LargeContextFlux": "TT FLUX Large Context",
|
||||
"TT_LargeContextSdxl": "TT SDXL Large Context",
|
||||
"TT_EvenLargerContext": "TT Even Larger Context",
|
||||
"TT_ContextSetImage": "TT Context Set Image",
|
||||
"TT_ContextSetLatent": "TT Context Set Latent",
|
||||
# Context Passthrough
|
||||
"TT_ContextPassthrough": "TT Context Passthrough",
|
||||
# Image
|
||||
"TT_ImagePreviewSave": "TT Image Preview / Save",
|
||||
# Latent
|
||||
"TT_LatentFactory": "TT Latent Factory",
|
||||
|
||||
@@ -128,6 +128,24 @@ CONTEXTS = {
|
||||
"context",
|
||||
)
|
||||
},
|
||||
"set_image":{
|
||||
"required": (
|
||||
"context",
|
||||
"image",
|
||||
),
|
||||
"return": (
|
||||
"context",
|
||||
)
|
||||
},
|
||||
"set_latent":{
|
||||
"required": (
|
||||
"context",
|
||||
"latent",
|
||||
),
|
||||
"return": (
|
||||
"context",
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
FORCE_INPUT_TYPES = {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
from .context_helpers import create_context_schema
|
||||
|
||||
|
||||
class TT_ContextSetImage:
|
||||
INPUT_TYPES_DICT, RETURN_TYPES, RETURN_NAMES = create_context_schema("set_image")
|
||||
FUNCTION = "process_context"
|
||||
CATEGORY = "TenserTensor/Context"
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return cls.INPUT_TYPES_DICT
|
||||
|
||||
def process_context(self, context, image):
|
||||
context["image"] = image
|
||||
|
||||
return (context,)
|
||||
@@ -0,0 +1,16 @@
|
||||
from .context_helpers import create_context_schema
|
||||
|
||||
|
||||
class TT_ContextSetLatent:
|
||||
INPUT_TYPES_DICT, RETURN_TYPES, RETURN_NAMES = create_context_schema("set_latent")
|
||||
FUNCTION = "process_context"
|
||||
CATEGORY = "TenserTensor/Context"
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return cls.INPUT_TYPES_DICT
|
||||
|
||||
def process_context(self, context, latent):
|
||||
context["latent"] = latent
|
||||
|
||||
return (context,)
|
||||
@@ -0,0 +1,26 @@
|
||||
## TT Context Set Image *TT_ContextSetImage*
|
||||
|
||||
*This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.*
|
||||
|
||||
Adds or updates image in context object.
|
||||
|
||||
### Inputs
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------------|----------|--------------------------------|
|
||||
| `context` | TT_CONTEXT | Yes | Context to update |
|
||||
| `image` | IMAGE | Yes | Image to store in context |
|
||||
|
||||
### Outputs
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------------|-------------------------|
|
||||
| `CONTEXT` | TT_CONTEXT | Updated context object |
|
||||
|
||||
### Usage
|
||||
|
||||
Stores pixel-space image in context for use by downstream nodes. Overwrites existing image if present.
|
||||
|
||||
---
|
||||
|
||||
[View on GitHub](https://github.com/tenser-tensor/ComfyUI-TenserTensor)
|
||||
@@ -0,0 +1,26 @@
|
||||
## TT Context Set Image *TT_ContextSetImage*
|
||||
|
||||
*This description was generated with AI assistance. If you spot any errors, please create an issue on GitHub.*
|
||||
|
||||
Adds or updates latent image in context object.
|
||||
|
||||
### Inputs
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------------|----------|----------------------------------|
|
||||
| `context` | TT_CONTEXT | Yes | Context to update |
|
||||
| `latent` | LATENT | Yes | Latent image to store in context |
|
||||
|
||||
### Outputs
|
||||
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------------|------------------------|
|
||||
| `CONTEXT` | TT_CONTEXT | Updated context object |
|
||||
|
||||
### Usage
|
||||
|
||||
Stores latent representation in context for use by downstream nodes. Overwrites existing latent if present.
|
||||
|
||||
---
|
||||
|
||||
[View on GitHub](https://github.com/tenser-tensor/ComfyUI-TenserTensor)
|
||||
Reference in New Issue
Block a user