Skip to content

Commit

Permalink
feat: ✨ add the backend node for Constant
Browse files Browse the repository at this point in the history
This requires this PR to be merged:
comfyanonymous/ComfyUI#3329

There is a trick to make it work without that PR but it
feels very hacky, the code for it is kept for reference but unused
  • Loading branch information
melMass committed Apr 25, 2024
1 parent cbb5dd2 commit dff5b22
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions nodes/constant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import json

from ..log import log


class MTB_Constant:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {"Value": ("*",)},
}

RETURN_TYPES = ("*",)
RETURN_NAMES = ("output",)
CATEGORY = "mtb/utils"
FUNCTION = "execute"

def execute(
self,
**kwargs,
):
log.debug("Received kwargs")
log.debug(json.dumps(kwargs, check_circular=True))
return (kwargs.get("Value"),)


__nodes__ = [MTB_Constant]

0 comments on commit dff5b22

Please sign in to comment.