-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Convert widget to input (and back) #243
Convert widget to input (and back) #243
Conversation
This seems quite handy so far. It took a minute to figure out how to merge the widgets.js file with my copy. Not sure if that's cause mine is newer/older, or from other things I may have merged previously. But, once I got past that it seems fine now. The double click to add Primitives is very nice. Though I did notice that only works for inputs that were modified/converted. Seemingly, on any others it's not an option. If this could be extended to work for those as well it would be very nice. Also, when they're double clicked to spawn and auto-connected, it would be handy if their names changed some to reflect that connection better. Such as converting steps to an input on the Sampler, then double clicking to make the Primitive for it, and maybe it pops out with "Steps (Primitive)" or something like that. Just another minor thing to save increments of time, over time. Maybe more of a personal preference too though. Being able to dynamically shift these nodes from manual input to node inputs on everything is exceedingly more useful than the previous options. This should help reduce overlap on custom nodes being variations of what this achieves. For example, WAS and other, myself included. Have all made various versions of the KSampler already, to externalize various inputs. I have around 5-6 variations currently, mostly for testing. Lol, and with one quick ninja move, this makes those seem silly and less useful now :) Very handy. Thanks :) |
A tiny issue is that the width of the nodes gets resized when converting an input to a widget. |
Ya that does kind of bug me too a bit. Not a functional concern so much though. On mine, much of the code block below wasn't present with his, I think.
Seemingly this handles resizing the height but not the width. Perhaps the issue could be resolved there somehow? |
The add/remove input functions automatically resize the node, i've updated it to store the original value and restore it (unless the new size needs to be bigger) |
Yeah, it'll need to be manually implemented for each of the other types for what the default node would need to be
I've updated it so the new node is just the name of the original input, I don't think it needs primitive in the name |
I'll look into manually adding those as I can later then.
Ya that's even better actually. Thanks :) |
I didn't test the previous version for this but this new version is a bit click happy on this double click action. That's handy for spawning extras quickly but they should maybe disperse in an area around the first new Primitive, or in a vertical stack possibly. Currently, they stack neatly and you could get extra stacks going all over without noticing if you weren't careful. Not sure that's really an issue so much as an OCD thing though. Also, the Primitives seem to spawn in a crunched form, which is maybe another OCD thing. I think for clarity and quicker visual referencing the naming in the menus should be more along the lines of "Externalize CFG"/"Internalize CFG" or possibly Extract & Absorb? :) Something like would make it easier across more types too possibly. |
This could possibly use a little timer between spawning the Primitives so they'd be more likely intentional, than accidental. Something small like 50-100 milliseconds likely could work. The vertical stacking or whatever would still be handy for intentional extras. |
Throttle double click
Now that I've played with this some more, it seems like it would be useful to have the initial Convert to Input/Extract also actually spawn a primitive when you select it. Personally, it seems more likely I wouldn't have a node already setup to make use of the new input, so having one made available is likely useful more often than not. The double click function is still useful after, if you clone the newly extended node and want separate primitives for those connections. Then you could spawn the node, extend it with auto-spawn primitives, clone it, and connect all those primitives, or double click to spawn new ones as needed. Seems way more fluid possibly. |
Related to this, you need to make sure node inputs accept their type, and This is input for wildcard stuff, like a debug to console which will print anything to console (in my node Suite) and then allow you to use it as a pass-through as well. |
Add RUI-Nodes to custom node list
Adds convert options to the node menu
And once converted, convert back
New primitive node that can be connected to one of these inputs
When connected it will copy the current value, numbers will be given a random toggle so it can be used for seeds
Links are restricted by type + widget configuration (e.g. you cant connect the same Primitive to seed and width, as width is restricted to steps of 64)
Primitives can be linked to multiple nodes to allow sharing of values
Values are sync'd to the source node, meaning things like LoadImage display the correct value
For now it supports text, numbers and combos but can easily be updated to support anything else
To quickly add a primitive widget you can double click the input (the circle, not the label)
If anyone has any feedback / could give this some testing as it was quite fiddly to get working!