From d08eedabd3a8097251676144a5de19bb8d838b2b Mon Sep 17 00:00:00 2001 From: Mark Cockram Date: Wed, 8 Apr 2026 06:51:51 +0200 Subject: [PATCH] fix(xyplot): fix crashes in Seeds++ Batch and tuple X/Y inputs (#984) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three bugs in pipeXYPlotAdvanced.plot(): 1. X/Y inputs can arrive as tuples in certain ComfyUI configurations, causing `AttributeError: 'tuple' object has no attribute 'get'`. Added isinstance check to unwrap single-element tuples. 2. Seeds++ Batch used `if new_pipe['seed']:` which: - Raises KeyError when 'seed' key is absent - Silently skips seed generation when seed is 0 (a valid seed) Changed to `new_pipe.get('seed') or 0` for safe fallback. 3. `!= None` → `is not None` per PEP 8. --- py/nodes/pipe.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/py/nodes/pipe.py b/py/nodes/pipe.py index 1d938db..65225eb 100644 --- a/py/nodes/pipe.py +++ b/py/nodes/pipe.py @@ -554,13 +554,17 @@ class pipeXYPlotAdvanced: if font_path and not os.path.exists(font_path): font_path = os.path.join(self.user_font_dir, font) - if X != None: + if X is not None: + if isinstance(X, tuple): + X = X[0] x_axis = X.get('axis') x_values = X.get('values') else: x_axis = "Nothing" x_values = [""] - if Y != None: + if Y is not None: + if isinstance(Y, tuple): + Y = Y[0] y_axis = Y.get('axis') y_values = Y.get('values') else: @@ -626,19 +630,19 @@ class pipeXYPlotAdvanced: } if x_axis == 'advanced: Seeds++ Batch': - if new_pipe['seed']: - value = x_values - x_values = [] - for index in range(value): - x_values.append(str(new_pipe['seed'] + index)) - x_values = "; ".join(x_values) + seed = new_pipe.get('seed') or 0 + value = x_values + x_values = [] + for index in range(value): + x_values.append(str(seed + index)) + x_values = "; ".join(x_values) if y_axis == 'advanced: Seeds++ Batch': - if new_pipe['seed']: - value = y_values - y_values = [] - for index in range(value): - y_values.append(str(new_pipe['seed'] + index)) - y_values = "; ".join(y_values) + seed = new_pipe.get('seed') or 0 + value = y_values + y_values = [] + for index in range(value): + y_values.append(str(seed + index)) + y_values = "; ".join(y_values) if x_axis == 'advanced: Positive Prompt S/R': if positive: