logical flow control / image size output
Fennecai opened this issue · comments
Motivation
it would be nice to be able to have switch nodes automatically switch for complicated tasks based on logic. the other day i was upscaling a large number of images with no way to know the original resolution of every single one, but some were already decent resolution and didnt need an upscale, just a sharpening. It would be beneficial to have this so i could set up a thing where if the image size is already bigger than a certain amount, it would not upscale it but route it to a sharpening part of the graph instead.
Description
this suggestion is kindof 3 different but related things:
- the choice of which output on a switch node should have an input that works based on an int number (1 = A, 2 = B etc)
- there should be a math comparison node that works like an IF statement depending on the comparison (if input A == input B then C else D, and perhaps the comparison could be configured by the user to be ==, >= , <=, etc.)
- load image node / load images node should have an output of width / height size in pixels
Alternatives
I haven't thought of any alternative suggestions that would be beneficial on a broader scale; however one alternative for my specific use case would be to just detect in upscaling nodes if the resulting image would be a ludicrous size like 8192 pixels wide and skip the upscale in that case.
However, i think having numerical logic / automatic flow control would be more applicable for more uses.
+1, I think this would be a super useful feature.
load image node / load images node should have an output of width / height size in pixels
Totally missed this before, but FYI there's the get dimensions node for this purpose
hi @joeyballentine , you are right. However does not seem possible to perform logic operation on that information. For example, move ahead with a rescale if the width is less than 1024, or skip otherwise, etc.
Correct, that is not possible. I was just letting you know you can already get the dimensions of an image is all