LucianoCirino/efficiency-nodes-comfyui

XY plot requiring different input types limits usability

adalast opened this issue · 1 comments

So I am used to using S/R for my XY plots in A1111 to do things like comparing style prompt tokens on one axis with modifying adjectives on the other. That way I can see something like a "[Dark, Gloomy, Foreboding] graveyard with a [anime, gothic, classical] style" looks like. I can understand not allowing 2 nodes the vary the other parameters being allowed, but S/R really should be exempt as it should not normally interfere with itself, unless someone is a moron and tries to have it search the same word, but that should be trivial to capture and throw an error in that case.

@adalast That patch should work:

index 216f58f..c582ae8 100644
--- a/efficiency_nodes.py
+++ b/efficiency_nodes.py
@@ -2310,11 +2310,14 @@ class TSC_XYplot:
             Y_type = "Nothing"
             Y_value = [""]
 
-        # If types are the same exit. If one isn't "Nothing", print error
+        # If types are the same exit. If one isn't "Nothing", "Positive/Negative Prompt S/R", print error
         if X_type != "XY_Capsule" and (X_type == Y_type):
-            if X_type != "Nothing":
+            if X_type in ["Positive Prompt S/R", "Negative Prompt S/R"] and (X_value == Y_value):
+                print(f"{error('XY Plot Error:')} X and Y input values must be different.")
+                return (None,)
+            elif X_type != "Nothing":
                 print(f"{error('XY Plot Error:')} X and Y input types must be different.")
-            return (None,)
+                return (None,)
 
         # Check that dependencies are connected for specific plot types
         encode_types = {