-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'constant' data value input nodes #3899
base: master
Are you sure you want to change the base?
Conversation
Are you aware of the |
Yes, however usage for it is Unclear and is not as useful for new users without such documentation (hint: there is none). Unless there's more clear documentation on this node, it's not clear to other users of how to provide such static inputs/values to other components of nodes. Which is why I sort of "take" the primitive node and expand it to the core datatypes for ease of use for other users. |
Primitive nodes force additional widgets ( Personally, I'd prefer to just be able to hide these widgets in group nodes or have a second version of |
Primitive nodes are annoying: They don't exist in API-serialized graphs and they can't be rerouted. They're kind of special snowflakes that have weird behaviour that differs from other nodes. Having constants serialized in the API format would make it easy to create "input nodes" in workflows that are decoupled from other parameters any specific node might need. In addition to the nodes here, constant string nodes with dynamicPrompts set to false would also be useful. |
Typos in original branch
The comments on the original PR suggested it'd be nice to have nodes with dynamicInputs set to False for both of the String nodes. As such, I've created a dedicated node, and set the other string constants to dynamicInputs = True.
I think the last commit I made addresses this request, adding two additional String nodes that are non-dynamicInput(s). |
@comfyanonymous and others this PR has sat for a few months, any updates on acceptance? |
It would be better to add |
Primitive is a weird node that doesnt conform. Even if this were doable the core 'constant' nodes dont exist and need included anyways. So until theres a node for every base type its not really feasible to do that. This PR is a step in the direction of inclusion but inclusion is VERY slow here. |
I mean the |
There are numerous times in workflows where it is useful or advantageous to have individual data input nodes for primitive datatypes (INT, STRING (both multiline and not), FLOAT).
However, these nodes are NOT provided as part of ComfyUI. There are numerous external node packs which include primitive datatype nodes.
This pull request is designed to make these part of ComfyUI in its 'extras' group of nodes.
Note that my coding style for nodes is to design a "base" node so that the bare minimum of changes are necessary for the actual nodes themselves to function. In this case, the
_CONSTANT_BASE
node acts as a structure defining the various data types for components of the node that are accepted later. And make sure that things're implemented before running. As such, however, because we only have to override a few small bits (RETURN_TYPES
,RETURN_NAMES
, andINPUT_TYPES
definitions), the rest of the node base makes sure everything else "just works" without having to duplicate code. That's the only reason it was used here, because of how I code nodes.Revisions / changes are welcome if necessary, but I think adding these primitive "constant" nodes would be a positive improvement and inclusion (it's also not a major set of changes).