From 9501b9e4593b20d50dbe3486ac09e25a6b4e8487 Mon Sep 17 00:00:00 2001 From: Mel Massadian Date: Sat, 2 Aug 2025 02:29:02 +0200 Subject: [PATCH] =?UTF-8?q?chore(TEMP):=20=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodes/generate.py | 7 +++++++ nodes/graph_utils.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/nodes/generate.py b/nodes/generate.py index ff65ce4..5a50f06 100644 --- a/nodes/generate.py +++ b/nodes/generate.py @@ -7,6 +7,13 @@ from PIL import Image, ImageDraw, ImageFont from ..log import log from ..utils import comfy_dir, font_path, pil2tensor +# try: +# from cairosvg import svg2png +# HAS_CAIRO = True +# except ImportError: +# HAS_CAIRO = False + + # class MtbExamples: # """MTB Example Images""" diff --git a/nodes/graph_utils.py b/nodes/graph_utils.py index bc98497..20a0971 100644 --- a/nodes/graph_utils.py +++ b/nodes/graph_utils.py @@ -146,6 +146,11 @@ class MTB_ApplyTextTemplate: if has_list: first_list = next(x for x in values if isinstance(x, list)) + # all_list = all(isinstance(x, list) for x in kwargs.values()) + # if not all_list: + # raise ValueError( + # "Text template supports either str or list[str] but not a mix of the two (yet?)" + # ) target_length = len(first_list) same_length = all( len(v) == target_length for v in values if isinstance(v, list) @@ -158,6 +163,8 @@ class MTB_ApplyTextTemplate: if has_list: results = [] + # do a padded loop, not the most efficient but easy + # to handle for now for it in range(target_length): res = f"{template}" for k, v in kwargs.items():