LucianoCirino / efficiency-nodes-comfyui

A collection of ComfyUI custom nodes. ⚠️ WARNING: This repo is no longer maintained.
https://civitai.com/models/32342
GNU General Public License v3.0
605 stars 155 forks source link

XY plot requiring different input types limits usability #228

Open adalast opened 1 year ago

adalast commented 1 year ago

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.

procule commented 1 year ago

@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 = {