Files
TashaSkyUp-EternalKernelPyt…/components/sizes.py
T
Tasha Upchurch 9807e12198 initial commit
variety of nodes to support many things including a start on alpha channel support for comfyui
2023-05-25 12:55:40 -04:00

23 lines
606 B
Python

def get_latent_size(LATENT, ORIGINAL_VALUES=False):
lc = LATENT.copy()
size = lc["samples"].shape[3], lc["samples"].shape[2]
if ORIGINAL_VALUES == False:
size = size[0] * 8, size[1] * 8
return size
def get_image_size(IMAGE):
samples = IMAGE.movedim(-1, 1)
size = samples.shape[3], samples.shape[2]
# size = size.movedim(1, -1)
return size
def get_conditioning_size(CONDITIONING):
size = CONDITIONING["area"]
width = size[1]
height = size[0]
x_offs = size[3]
y_offs = size[2]
return ({"w": width, "h": height}, {"x": x_offs, "y": y_offs})