From dd67dd75183a02bc205c95a44006d64dbb4359e2 Mon Sep 17 00:00:00 2001 From: HowToSD Date: Thu, 13 Feb 2025 12:19:14 -0800 Subject: [PATCH] Fixed the csv file path in workflows to make them work with installation by ComfyUI Manager --- README.md | 21 ++++++++++++++++++--- examples/workflows/load_csv.json | 2 +- examples/workflows/select_subset.json | 2 +- examples/workflows/sort.json | 2 +- requirements.txt | 4 ++-- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ab3e769..1537692 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,15 @@ You can also use other Comfy custom nodes to fit your needs (e.g., combining ima These custom nodes aim to make data exploration and analysis more efficient and enjoyable. ## Installation +### Installation via ComfyUI Manager +1. Press Manager button on the top menu bar to display ComfyUI Manager Menu. +2. Click Custom Node Manager. +3. In the search field, enter Data analysis. +4. "ComfyUI-Data-Analysis" should be displayed. Select Install. +5. Restart ComfyUI. +6. Reload browser page. -Installation via ComfyUI Manager is not supported yet, so please follow these steps: - +### Installation via git 1. Navigate to the `custom_nodes` directory within your ComfyUI installation. 2. Run the following command: @@ -32,8 +38,17 @@ Installation via ComfyUI Manager is not supported yet, so please follow these st git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git ``` This will create a new subdirectory ComfyUI-Data-Analysis. +3. Rename the folder name from ComfyUI-Data-Analysis to data-analysis. + If you skip this, example workflows will not work as those flows use this folder name. +4. Check if your ComfyUI environment already has pandas and matplotlib. If not, install them using pip. + ``` + pip install -r requirements.txt + ``` + Refer to requirements.txt for the right versions. +5. Start ComfyUI. -3. Restart ComfyUI. +### Troubleshooting for installation +This package requires pandas and matplotlib that are not ## How to Use diff --git a/examples/workflows/load_csv.json b/examples/workflows/load_csv.json index 6cc7c09..b1493d9 100644 --- a/examples/workflows/load_csv.json +++ b/examples/workflows/load_csv.json @@ -1 +1 @@ -{"last_node_id":2,"last_link_id":1,"nodes":[{"id":1,"type":"PandasLoadCSV","pos":[490.4385070800781,2068.794921875],"size":[410.5992736816406,95.68482208251953],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"STRING","type":"STRING","links":[1],"slot_index":0}],"properties":{"Node name for S&R":"PandasLoadCSV"},"widgets_values":["./custom_nodes/ComfyUI-Data-Analysis/examples/datasets/fruit.csv"]},{"id":2,"type":"PandasShowDataFrame","pos":[1063.93798828125,2068.40283203125],"size":[323.9862976074219,238.33462524414062],"flags":{},"order":1,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":1,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n0 fig 4.11 1.0 1\n1 safou 1.24 1.0 0\n2 papaya 5.11 1.0 1\n3 plum 2.53 1.0 1\n4 guava 0.66 1.0 1\n.. ... ... ... ...\n95 black currant 8.15 0.0 1\n96 red currant 7.71 0.0 1\n97 black currant 4.41 1.0 0\n98 red currant 2.18 0.0 0\n99 black currant 0.80 1.0 1\n\n[100 rows x 4 columns]"]}],"links":[[1,1,0,2,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":1.1498879805425606,"offset":[-454.3122480950786,-1970.7113583389635]},"node_versions":{"ComfyUI-Data-Analysis":"235c84b7b8aafc3c4b904ba8f03c89aade96b640"},"ue_links":[]},"version":0.4} \ No newline at end of file +{"last_node_id":2,"last_link_id":1,"nodes":[{"id":1,"type":"PandasLoadCSV","pos":[490.4385070800781,2068.794921875],"size":[410.5992736816406,95.68482208251953],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"STRING","type":"STRING","links":[1],"slot_index":0}],"properties":{"Node name for S&R":"PandasLoadCSV"},"widgets_values":["./custom_nodes/data-analysis/examples/datasets/fruit.csv"]},{"id":2,"type":"PandasShowDataFrame","pos":[1063.93798828125,2068.40283203125],"size":[323.9862976074219,238.33462524414062],"flags":{},"order":1,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":1,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n0 fig 4.11 1.0 1\n1 safou 1.24 1.0 0\n2 papaya 5.11 1.0 1\n3 plum 2.53 1.0 1\n4 guava 0.66 1.0 1\n.. ... ... ... ...\n95 black currant 8.15 0.0 1\n96 red currant 7.71 0.0 1\n97 black currant 4.41 1.0 0\n98 red currant 2.18 0.0 0\n99 black currant 0.80 1.0 1\n\n[100 rows x 4 columns]"]}],"links":[[1,1,0,2,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":1.1498879805425606,"offset":[-454.3122480950786,-1970.7113583389635]},"node_versions":{"ComfyUI-Data-Analysis":"235c84b7b8aafc3c4b904ba8f03c89aade96b640"},"ue_links":[]},"version":0.4} \ No newline at end of file diff --git a/examples/workflows/select_subset.json b/examples/workflows/select_subset.json index 5eeeba7..5e025ab 100644 --- a/examples/workflows/select_subset.json +++ b/examples/workflows/select_subset.json @@ -1 +1 @@ -{"last_node_id":5,"last_link_id":5,"nodes":[{"id":1,"type":"PandasLoadCSV","pos":[353.8526611328125,2105.062255859375],"size":[410.5992736816406,95.68482208251953],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"STRING","type":"STRING","links":[2,4],"slot_index":0}],"properties":{"Node name for S&R":"PandasLoadCSV"},"widgets_values":["./custom_nodes/ComfyUI-Data-Analysis/examples/datasets/fruit.csv"]},{"id":3,"type":"PandasSelectColumns","pos":[792.3731079101562,1956.5699462890625],"size":[349.8414306640625,115.1163558959961],"flags":{},"order":1,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":2,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[3],"slot_index":0}],"properties":{"Node name for S&R":"PandasSelectColumns"},"widgets_values":["","Name, Price"]},{"id":2,"type":"PandasShowDataFrame","pos":[1223.672119140625,1952.651123046875],"size":[323.9862976074219,238.33462524414062],"flags":{},"order":3,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":3,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price\n0 fig 4.11\n1 safou 1.24\n2 papaya 5.11\n3 plum 2.53\n4 guava 0.66\n.. ... ...\n95 black currant 8.15\n96 red currant 7.71\n97 black currant 4.41\n98 red currant 2.18\n99 black currant 0.80\n\n[100 rows x 2 columns]"]},{"id":4,"type":"PandasSelectRows","pos":[780.7979125976562,2289.15966796875],"size":[390.7399597167969,111.2580337524414],"flags":{},"order":2,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":4,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[5],"slot_index":0}],"properties":{"Node name for S&R":"PandasSelectRows"},"widgets_values":["","Price < 1"]},{"id":5,"type":"PandasShowDataFrame","pos":[1231.45263671875,2293.01708984375],"size":[301.1099548339844,161.65524291992188],"flags":{},"order":4,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":5,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n4 guava 0.66 1 1\n8 pawpaw 0.66 1 1\n17 orange 0.54 0 1\n78 santol 0.79 1 1\n91 black currant 0.51 1 0\n99 black currant 0.80 1 1"]}],"links":[[2,1,0,3,0,"STRING"],[3,3,0,2,0,"STRING"],[4,1,0,4,0,"STRING"],[5,4,0,5,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8639278591604511,"offset":[-331.6863902845917,-1872.4571513539743]},"node_versions":{"ComfyUI-Data-Analysis":"235c84b7b8aafc3c4b904ba8f03c89aade96b640"},"ue_links":[]},"version":0.4} \ No newline at end of file +{"last_node_id":5,"last_link_id":5,"nodes":[{"id":1,"type":"PandasLoadCSV","pos":[353.8526611328125,2105.062255859375],"size":[410.5992736816406,95.68482208251953],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"STRING","type":"STRING","links":[2,4],"slot_index":0}],"properties":{"Node name for S&R":"PandasLoadCSV"},"widgets_values":["./custom_nodes/data-analysis/examples/datasets/fruit.csv"]},{"id":3,"type":"PandasSelectColumns","pos":[792.3731079101562,1956.5699462890625],"size":[349.8414306640625,115.1163558959961],"flags":{},"order":1,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":2,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[3],"slot_index":0}],"properties":{"Node name for S&R":"PandasSelectColumns"},"widgets_values":["","Name, Price"]},{"id":2,"type":"PandasShowDataFrame","pos":[1223.672119140625,1952.651123046875],"size":[323.9862976074219,238.33462524414062],"flags":{},"order":3,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":3,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price\n0 fig 4.11\n1 safou 1.24\n2 papaya 5.11\n3 plum 2.53\n4 guava 0.66\n.. ... ...\n95 black currant 8.15\n96 red currant 7.71\n97 black currant 4.41\n98 red currant 2.18\n99 black currant 0.80\n\n[100 rows x 2 columns]"]},{"id":4,"type":"PandasSelectRows","pos":[780.7979125976562,2289.15966796875],"size":[390.7399597167969,111.2580337524414],"flags":{},"order":2,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":4,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[5],"slot_index":0}],"properties":{"Node name for S&R":"PandasSelectRows"},"widgets_values":["","Price < 1"]},{"id":5,"type":"PandasShowDataFrame","pos":[1231.45263671875,2293.01708984375],"size":[301.1099548339844,161.65524291992188],"flags":{},"order":4,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":5,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n4 guava 0.66 1 1\n8 pawpaw 0.66 1 1\n17 orange 0.54 0 1\n78 santol 0.79 1 1\n91 black currant 0.51 1 0\n99 black currant 0.80 1 1"]}],"links":[[2,1,0,3,0,"STRING"],[3,3,0,2,0,"STRING"],[4,1,0,4,0,"STRING"],[5,4,0,5,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8639278591604511,"offset":[-331.6863902845917,-1872.4571513539743]},"node_versions":{"ComfyUI-Data-Analysis":"235c84b7b8aafc3c4b904ba8f03c89aade96b640"},"ue_links":[]},"version":0.4} \ No newline at end of file diff --git a/examples/workflows/sort.json b/examples/workflows/sort.json index 59f3312..a605975 100644 --- a/examples/workflows/sort.json +++ b/examples/workflows/sort.json @@ -1 +1 @@ -{"last_node_id":8,"last_link_id":11,"nodes":[{"id":1,"type":"PandasLoadCSV","pos":[341.50604248046875,1996.256103515625],"size":[410.5992736816406,95.68482208251953],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"STRING","type":"STRING","links":[6],"slot_index":0}],"properties":{"Node name for S&R":"PandasLoadCSV"},"widgets_values":["./custom_nodes/ComfyUI-Data-Analysis/examples/datasets/fruit.csv"]},{"id":6,"type":"PandasSort","pos":[797.7749633789062,1987.430908203125],"size":[210,132.86476135253906],"flags":{},"order":2,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":6,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[8,10],"slot_index":0}],"properties":{"Node name for S&R":"PandasSort"},"widgets_values":["","Price",false]},{"id":7,"type":"PandasHead","pos":[794.6879272460938,2368.64111328125],"size":[210,91.96627807617188],"flags":{},"order":4,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":10,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[11],"slot_index":0}],"properties":{"Node name for S&R":"PandasHead"},"widgets_values":["",3]},{"id":8,"type":"MarkdownNote","pos":[786.199462890625,2250.57421875],"size":[227.97030639648438,68.48837280273438],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["# Show top 3"],"color":"#432","bgcolor":"#653"},{"id":2,"type":"PandasShowDataFrame","pos":[1094.8031005859375,1988.14794921875],"size":[323.9862976074219,238.33462524414062],"flags":{},"order":3,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":8,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n34 mulberry 12.91 0 1\n77 apple 12.85 0 0\n49 grumichama 12.64 1 0\n47 rambutan 12.39 1 1\n15 kiwi 12.25 0 0\n.. ... ... ... ...\n78 santol 0.79 1 1\n8 pawpaw 0.66 1 1\n4 guava 0.66 1 1\n17 orange 0.54 0 1\n91 black currant 0.51 1 0\n\n[100 rows x 4 columns]"]},{"id":5,"type":"PandasShowDataFrame","pos":[1105.6707763671875,2374.0419921875],"size":[288.7632141113281,130.78851318359375],"flags":{},"order":5,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":11,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n34 mulberry 12.91 0 1\n77 apple 12.85 0 0\n49 grumichama 12.64 1 0"]}],"links":[[6,1,0,6,0,"STRING"],[8,6,0,2,0,"STRING"],[10,6,0,7,0,"STRING"],[11,7,0,5,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8639278591604511,"offset":[-331.6863902845917,-1872.4571513539743]},"node_versions":{"ComfyUI-Data-Analysis":"235c84b7b8aafc3c4b904ba8f03c89aade96b640"},"ue_links":[]},"version":0.4} \ No newline at end of file +{"last_node_id":8,"last_link_id":11,"nodes":[{"id":1,"type":"PandasLoadCSV","pos":[341.50604248046875,1996.256103515625],"size":[410.5992736816406,95.68482208251953],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"STRING","type":"STRING","links":[6],"slot_index":0}],"properties":{"Node name for S&R":"PandasLoadCSV"},"widgets_values":["./custom_nodes/data-analysis/examples/datasets/fruit.csv"]},{"id":6,"type":"PandasSort","pos":[797.7749633789062,1987.430908203125],"size":[210,132.86476135253906],"flags":{},"order":2,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":6,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[8,10],"slot_index":0}],"properties":{"Node name for S&R":"PandasSort"},"widgets_values":["","Price",false]},{"id":7,"type":"PandasHead","pos":[794.6879272460938,2368.64111328125],"size":[210,91.96627807617188],"flags":{},"order":4,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":10,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":[11],"slot_index":0}],"properties":{"Node name for S&R":"PandasHead"},"widgets_values":["",3]},{"id":8,"type":"MarkdownNote","pos":[786.199462890625,2250.57421875],"size":[227.97030639648438,68.48837280273438],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["# Show top 3"],"color":"#432","bgcolor":"#653"},{"id":2,"type":"PandasShowDataFrame","pos":[1094.8031005859375,1988.14794921875],"size":[323.9862976074219,238.33462524414062],"flags":{},"order":3,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":8,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n34 mulberry 12.91 0 1\n77 apple 12.85 0 0\n49 grumichama 12.64 1 0\n47 rambutan 12.39 1 1\n15 kiwi 12.25 0 0\n.. ... ... ... ...\n78 santol 0.79 1 1\n8 pawpaw 0.66 1 1\n4 guava 0.66 1 1\n17 orange 0.54 0 1\n91 black currant 0.51 1 0\n\n[100 rows x 4 columns]"]},{"id":5,"type":"PandasShowDataFrame","pos":[1105.6707763671875,2374.0419921875],"size":[288.7632141113281,130.78851318359375],"flags":{},"order":5,"mode":0,"inputs":[{"name":"dataframe_json","type":"STRING","link":11,"widget":{"name":"dataframe_json"}}],"outputs":[{"name":"STRING","type":"STRING","links":null,"shape":6}],"properties":{"Node name for S&R":"PandasShowDataFrame"},"widgets_values":[""," Name Price InStock OnSale\n34 mulberry 12.91 0 1\n77 apple 12.85 0 0\n49 grumichama 12.64 1 0"]}],"links":[[6,1,0,6,0,"STRING"],[8,6,0,2,0,"STRING"],[10,6,0,7,0,"STRING"],[11,7,0,5,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8639278591604511,"offset":[-331.6863902845917,-1872.4571513539743]},"node_versions":{"ComfyUI-Data-Analysis":"235c84b7b8aafc3c4b904ba8f03c89aade96b640"},"ue_links":[]},"version":0.4} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 4e0d9f1..6382173 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -matplotlib==3.10.0 -pandas==2.2.3 +matplotlib>=3.10.0 +pandas>=2.2.3