Skip to content

Create "Resolutions" Node #2610

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

Merged
merged 12 commits into from
Feb 29, 2024
Merged

Conversation

mrjschulte
Copy link
Contributor

This node provides chaiNNer with a selection of common, and at times industry specific, resolution presets to use as "Number" sources for further use in Chains to help drive other parameters and nodes.

Screenshot 2024-02-24 at 19 34 35

Screenshot 2024-02-24 at 19 34 48

This node provides chaiNNer with a selection of common, and at times industry specific, resolution presets to use as "Number" sources for further use in Chains to help drive other parameters and nodes.
Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this idea for a node! It's simple and gets rid of magic constants in our users' chains.

I kind of hate how this node gets type information due to our execution of starting nodes, but it works, so why change it :)

mrjschulte and others added 5 commits February 26, 2024 07:51
Co-authored-by: Michael Schmidt <msrd0000@gmail.com>
Co-authored-by: Michael Schmidt <msrd0000@gmail.com>
This node comes with a bunch of presets to help start the user set up their respective chains.
@joeyballentine joeyballentine changed the title Create "Formats" Node Create "Resolutions" Node Feb 27, 2024
Adds in assert as requested and adds in support for a custom/user defined resolution, to help keep all of the "magic" numbers pertaining to widht/height in one node.
Sync up all types to int
@RunDevelopment
Copy link
Member

I kind of hate how this node gets type information due to our execution of starting nodes, but it works, so why change it :)

Remember when I said that? Yeah, we need to change this now...

Since you added custom resolutions, the Resolutions node now has 2 number inputs which prevent it from being a starting node. So the node no longer shows the exact resolutions on its outputs. There are 2 ways around this:

  1. Set has_handle=False for both number inputs. The condition for being a starting node is "no possible input handles," so preventing the number inputs from having any connections makes the node execute like before.
  2. Add static type information to the outputs. Basically, we need one long match expression to encode all resolutions in the type system.

Which option you choose should depend on whether you want the "Width" and "Height" input to be connectable. If this isn't necessary, then go with option 1. If you think they should be connectable, then go with option 2 and I'll help you to get the output types right.

mrjschulte and others added 3 commits February 28, 2024 18:28
…ns.py

Co-authored-by: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com>
…ns.py

Co-authored-by: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com>
…ns.py

Co-authored-by: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com>
@mrjschulte
Copy link
Contributor Author

Option 1 it is!

Adds has_handle=False to remove the inputs into the Width/Height as this is a starter node.
@joeyballentine joeyballentine merged commit ecb522d into chaiNNer-org:main Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants