1 line
5.9 KiB
JSON
1 line
5.9 KiB
JSON
{"id":"4b7013ea-0520-4cb9-8c91-da2aaf35bb5a","revision":0,"last_node_id":29,"last_link_id":14,"nodes":[{"id":25,"type":"ModelDataExtractor","pos":[-1195.51171875,389.5708923339844],"size":[365.4000244140625,58],"flags":{},"order":0,"mode":0,"inputs":[{"localized_name":"model_path","name":"model_path","type":"STRING","widget":{"name":"model_path"},"link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":[]}],"properties":{"Node name for S&R":"ModelDataExtractor"},"widgets_values":["D:\\ai\\ComfyUI_windows_portable\\ComfyUI\\models\\inswapper_128.onnx"]},{"id":24,"type":"ModelMetadataReader","pos":[-1188.88818359375,151.13705444335938],"size":[358.05047607421875,58],"flags":{},"order":1,"mode":0,"inputs":[{"localized_name":"model_path","name":"model_path","type":"STRING","widget":{"name":"model_path"},"link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":[]}],"properties":{"Node name for S&R":"ModelMetadataReader"},"widgets_values":["D:\\ai\\ComfyUI_windows_portable\\ComfyUI\\models\\inswapper_128.onnx"]},{"id":7,"type":"LF_DisplayString","pos":[-738.5134887695312,180.94131469726562],"size":[662.815185546875,1074.5087890625],"flags":{},"order":4,"mode":0,"inputs":[{"localized_name":"string","name":"string","type":"STRING","link":14},{"localized_name":"ui_widget","name":"ui_widget","shape":7,"type":"LF_CODE","widget":{"name":"ui_widget"},"link":null}],"outputs":[{"localized_name":"string","name":"string","type":"STRING","links":null}],"title":"Extracted Model Info (Display string).","properties":{"cnr_id":"lf-nodes","ver":"561a9953186548321e6d13ed23fd642d4c734f01","Node name for S&R":"LF_DisplayString"},"widgets_values":["📌 Starting Metadata Extraction: 2025-05-08 19:34:06\n🔎 Checking model path: D:\\ai\\ComfyUI_windows_portable\\ComfyUI\\models\\inswapper_128.onnx\n⚠ Unsupported model format detected.\n✅ Extraction Complete: 2025-05-08 19:34:06\n\n{\n \"error\": \"Unsupported model format\"\n}"]},{"id":27,"type":"Note","pos":[-1341.2215576171875,486.7104797363281],"size":[588.1671752929688,770.885986328125],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[],"title":"Read Me","properties":{},"widgets_values":["Workflow Guide: Extracting Model Metadata\n\nThis workflow begins with running Model_Lister_with_paths.ps1, which lists all available model files along with their paths. Use this output to copy-paste the file paths into each node above for metadata extraction.\n\nYou can preload requirements if you like.\n.\\ComfyUI_windows_portable\\python_embeded\\python.exe -m pip install -r requirements.txt\n(For Windows ComfyUI Portable as an example)\n\nSimply copy from the mocel_list.txt file and paste it into one or all nodes above. Connect the String Outputs from anyone of the three nodes to the string input connector of the Display String Node.\n\n1️⃣ Model Metadata Reader\nPurpose:\n\nExtract basic metadata from models in various formats, including Safetensors, Checkpoints (.ckpt, .pth, .pt, .bin).\n\nProvides a structured metadata report for supported model formats.\n\nDetects the model format automatically and applies the correct extraction method.\n\nHow It Works: ✔ Reads metadata from Safetensors models using safetensors.safe_open(). ✔ Extracts available keys from Torch-based models (ckpt, .bin, .pth). ✔ Returns structured metadata when available, otherwise reports unsupported formats. ✔ Logs errors in case extraction fails.\n\nUse this node for a quick overview of model metadata without deep metadata parsing.\n\n2️⃣ Enhanced Model Metadata Reader\nPurpose:\n\nExtract deep metadata from models, including structured attributes and raw text parsing.\n\nFocuses heavily on ONNX models, using direct binary parsing to retrieve metadata without relying on the ONNX Python package.\n\nHow It Works: ✔ Reads ONNX files as raw binary, searching for readable metadata like author, description, version, etc. ✔ Extracts ASCII-readable strings directly from the binary file if structured metadata isn't available. ✔ Provides warnings when metadata is missing but still displays raw extracted text. ✔ Enhanced logging for debugging failed extractions and unsupported formats.\n\nThis node is ideal for ONNX models, offering both metadata and raw text extraction for deeper insights.\n\n3️⃣ Advanced Model Data Extractor\nPurpose:\n\nExtract structured metadata and raw text together from various model formats.\n\nSupports Safetensors, Checkpoints (.ckpt, .pth, .bin, .gguf, .onnx).\n\nHow It Works: ✔ Extracts metadata for Safetensors using direct access to model properties. ✔ Retrieves Torch model metadata such as available keys. ✔ Attempts raw text extraction from the binary file using character encoding detection (chardet). ✔ Limits raw text output for readability while keeping detailed extraction logs.\n\nThis node provides both metadata and raw text from models, making it the most comprehensive extraction tool in the workflow.\n\n🚀 Final Notes\nRun Model_Lister_with_paths.ps1 first, then copy a model path into each node.\n\nUse ModelMetadataReader for quick metadata lookup.\n\nUse EnhancedModelMetadataReader for deep metadata parsing, especially for ONNX models.\n\nUse AdvancedModelDataExtractor for full metadata + raw text extraction."],"color":"#432","bgcolor":"#653"},{"id":26,"type":"EnhancedModelMetadataReader","pos":[-1189.9920654296875,268.146240234375],"size":[352.6112365722656,58],"flags":{},"order":3,"mode":0,"inputs":[{"localized_name":"model_path","name":"model_path","type":"STRING","widget":{"name":"model_path"},"link":null}],"outputs":[{"localized_name":"STRING","name":"STRING","type":"STRING","links":[14]}],"properties":{"Node name for S&R":"EnhancedModelMetadataReader"},"widgets_values":["D:\\ai\\ComfyUI_windows_portable\\ComfyUI\\models\\inswapper_128.onnx"]}],"links":[[14,26,0,7,0,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.7972024500000047,"offset":[1561.714277530711,-92.26897791416417]},"frontendVersion":"1.17.11"},"version":0.4} |