mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-11 03:33:37 +08:00
Update curve_nodes.py
This commit is contained in:
parent
6842699f9e
commit
bbb28a0fc9
@ -92,7 +92,9 @@ Plots coordinates to sequence of images using Matplotlib.
|
|||||||
coordinates = json.loads(coordinates.replace("'", '"'))
|
coordinates = json.loads(coordinates.replace("'", '"'))
|
||||||
coordinates = [(coord['x'], coord['y']) for coord in coordinates]
|
coordinates = [(coord['x'], coord['y']) for coord in coordinates]
|
||||||
batch_size = len(coordinates)
|
batch_size = len(coordinates)
|
||||||
if len(size_multiplier) != batch_size:
|
if not size_multiplier or len(size_multiplier) != batch_size:
|
||||||
|
size_multiplier = [0] * batch_size
|
||||||
|
else:
|
||||||
size_multiplier = size_multiplier * (batch_size // len(size_multiplier)) + size_multiplier[:batch_size % len(size_multiplier)]
|
size_multiplier = size_multiplier * (batch_size // len(size_multiplier)) + size_multiplier[:batch_size % len(size_multiplier)]
|
||||||
|
|
||||||
plot_image_tensor = plot_coordinates_to_tensor(coordinates, height, width, bbox_height, bbox_width, size_multiplier, text)
|
plot_image_tensor = plot_coordinates_to_tensor(coordinates, height, width, bbox_height, bbox_width, size_multiplier, text)
|
||||||
@ -268,7 +270,9 @@ Locations are center locations.
|
|||||||
batch_size = len(coordinates)
|
batch_size = len(coordinates)
|
||||||
out = []
|
out = []
|
||||||
color = "white"
|
color = "white"
|
||||||
if len(size_multiplier) != batch_size:
|
if not size_multiplier or len(size_multiplier) != batch_size:
|
||||||
|
size_multiplier = [0] * batch_size
|
||||||
|
else:
|
||||||
size_multiplier = size_multiplier * (batch_size // len(size_multiplier)) + size_multiplier[:batch_size % len(size_multiplier)]
|
size_multiplier = size_multiplier * (batch_size // len(size_multiplier)) + size_multiplier[:batch_size % len(size_multiplier)]
|
||||||
for i, coord in enumerate(coordinates):
|
for i, coord in enumerate(coordinates):
|
||||||
image = Image.new("RGB", (frame_width, frame_height), "black")
|
image = Image.new("RGB", (frame_width, frame_height), "black")
|
||||||
@ -1021,8 +1025,10 @@ for example:
|
|||||||
batch_size = len(coordinates)
|
batch_size = len(coordinates)
|
||||||
# Initialize a list to hold the coordinates for the current ID
|
# Initialize a list to hold the coordinates for the current ID
|
||||||
id_coordinates = []
|
id_coordinates = []
|
||||||
if len(size_multiplier) != batch_size:
|
if not size_multiplier or len(size_multiplier) != batch_size:
|
||||||
size_multiplier = size_multiplier * (batch_size // len(size_multiplier)) + size_multiplier[:batch_size % len(size_multiplier)]
|
size_multiplier = [0] * batch_size
|
||||||
|
else:
|
||||||
|
size_multiplier = size_multiplier * (batch_size // len(size_multiplier)) + size_multiplier[:batch_size % len(size_multiplier)]
|
||||||
for i, coord in enumerate(coordinates):
|
for i, coord in enumerate(coordinates):
|
||||||
x = coord['x']
|
x = coord['x']
|
||||||
y = coord['y']
|
y = coord['y']
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user