diff --git a/example_workflows/comfyui-sharp-example.json b/example_workflows/comfyui-sharp-example.json new file mode 100644 index 0000000..52900a8 --- /dev/null +++ b/example_workflows/comfyui-sharp-example.json @@ -0,0 +1,378 @@ +{ + "id": "4fbf6f31-0f7b-4465-8ec8-25df4862e076", + "revision": 0, + "last_node_id": 35, + "last_link_id": 44, + "nodes": [ + { + "id": 31, + "type": "PrimitiveNode", + "pos": [ + 4672, + -928 + ], + "size": [ + 210, + 82 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "connect to widget input", + "type": "*", + "links": [] + } + ], + "properties": { + "Run widget replace on values": false, + "ue_properties": { + "widget_ue_connectable": {}, + "version": "7.5.2", + "input_ue_unconnectable": {} + } + } + }, + { + "id": 1, + "type": "SharpFrameSelector", + "pos": [ + 4992, + -704 + ], + "size": [ + 288, + 174 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": null + }, + { + "name": "scores", + "type": "SHARPNESS_SCORES", + "link": 3 + } + ], + "outputs": [ + { + "name": "selected_images", + "type": "IMAGE", + "links": [ + 32 + ] + }, + { + "name": "count", + "type": "INT", + "links": null + } + ], + "properties": { + "aux_id": "ComfyUI-Sharp-Selector.git", + "ver": "f30f948c9fa8acf9b7fe09559f172d8a63468c8d", + "Node name for S&R": "SharpFrameSelector", + "ue_properties": { + "widget_ue_connectable": {}, + "input_ue_unconnectable": {}, + "version": "7.5.2" + } + }, + "widgets_values": [ + "best_n", + 144, + 24, + 3, + 0 + ] + }, + { + "id": 32, + "type": "easy showAnything", + "pos": [ + 5344, + -1024 + ], + "size": [ + 448, + 96 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "anything", + "shape": 7, + "type": "*", + "link": 39 + } + ], + "outputs": [ + { + "name": "output", + "type": "*", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-easy-use", + "ver": "5dfcbcf51d8a6efed947bc7bdd6797827fecab55", + "Node name for S&R": "easy showAnything", + "ue_properties": { + "widget_ue_connectable": {}, + "input_ue_unconnectable": {}, + "version": "7.5.2" + } + }, + "widgets_values": [ + "Batch 1: Skipped 3440 frames. Scanning range 3440 -> 4880." + ] + }, + { + "id": 5, + "type": "SharpnessAnalyzer", + "pos": [ + 4672, + -672 + ], + "size": [ + 185.9771484375, + 26 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": null + } + ], + "outputs": [ + { + "name": "scores", + "type": "SHARPNESS_SCORES", + "links": [ + 3, + 21 + ] + } + ], + "properties": { + "aux_id": "ComfyUI-Sharp-Selector.git", + "ver": "0df11447abb7f41bf7f12a2906aa868a5d2027b4", + "Node name for S&R": "SharpnessAnalyzer", + "ue_properties": { + "widget_ue_connectable": {}, + "input_ue_unconnectable": {}, + "version": "7.5.2" + } + }, + "widgets_values": [] + }, + { + "id": 35, + "type": "FastAbsoluteSaver", + "pos": [ + 5856, + -1024 + ], + "size": [ + 306.3776153564453, + 270 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 43 + }, + { + "name": "scores_info", + "shape": 7, + "type": "STRING", + "link": 44 + } + ], + "outputs": [], + "properties": { + "aux_id": "ComfyUI-Sharp-Selector.git", + "ver": "162699a4a23219ac5ac75f398a17e67c3767da46", + "ue_properties": { + "widget_ue_connectable": {}, + "input_ue_unconnectable": {} + }, + "Node name for S&R": "FastAbsoluteSaver" + }, + "widgets_values": [ + "D:\\Datasets\\Sharp_Output", + "frame", + "png", + 0, + false, + "sharpness_score", + true, + 100, + 4 + ] + }, + { + "id": 29, + "type": "ParallelSharpnessLoader", + "pos": [ + 4992, + -1024 + ], + "size": [ + 320, + 262 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "images", + "type": "IMAGE", + "links": [ + 43 + ] + }, + { + "name": "scores_info", + "type": "STRING", + "links": [ + 44 + ] + }, + { + "name": "batch_int", + "type": "INT", + "links": null + }, + { + "name": "batch_status", + "type": "STRING", + "links": [ + 39 + ] + } + ], + "properties": { + "aux_id": "ComfyUI-Sharp-Selector.git", + "ver": "dab38a1fbf0077655fe568d500866fce6ecc857d", + "Node name for S&R": "ParallelSharpnessLoader", + "ue_properties": { + "widget_ue_connectable": {}, + "input_ue_unconnectable": {}, + "version": "7.5.2" + } + }, + "widgets_values": [ + "C:\\path\\to\\video.mp4", + 0, + 1440, + 1, + 30, + 24, + 2000 + ] + }, + { + "id": 34, + "type": "Note", + "pos": [ + 4224, + -1120 + ], + "size": [ + 416, + 736 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": { + "ue_properties": { + "widget_ue_connectable": {}, + "version": "7.5.2", + "input_ue_unconnectable": {} + } + }, + "widgets_values": [ + "📝 Smart Dataset Extraction Workflow\n\n1. Parallel Video Loader (The Source)\n\n What it does: Scans your video file directly from the hard drive using multi-threading. It does not load the whole video into RAM.\n\n Batching: Uses the batch_index (Primitive Node) to \"page\" through the movie.\n\n Example: If scan_limit is 1440, Batch 0 scans frames 0-1440, Batch 1 scans 1440-2880, etc.\n\n Selection: It calculates sharpness (Laplacian Variance) and only decodes the \"Best N\" frames to send downstream.\n\n2. Fast Absolute Saver (The Destination)\n\n What it does: Saves images instantly to your SSD using parallel workers, bypassing the slow ComfyUI preview window.\n\n Smart Naming: Connect scores_info from the Loader to the Saver! This allows files to be named using the original video frame number (e.g., movie_frame_00450.png) rather than a random batch counter.\n\n Metadata: Embeds the sharpness score into the PNG/WebP metadata for future filtering.\n\n⚠️ Usage Tips:\n\n Automation: Set batch_index to \"Increment\" (on the Primitive Node) and enable \"Auto Queue\" in ComfyUI options to process the entire movie automatically.\n\n Monitoring: Watch the Console Window (black command prompt) for progress logs. The saver does not preview images in the UI to prevent lag.\n\n Safety: The saver uses absolute paths and overwrites files with the same name. Use a unique filename_prefix for each new video source." + ], + "color": "#432", + "bgcolor": "#653" + } + ], + "links": [ + [ + 3, + 5, + 0, + 1, + 1, + "SHARPNESS_SCORES" + ], + [ + 39, + 29, + 3, + 32, + 0, + "STRING" + ], + [ + 43, + 29, + 0, + 35, + 0, + "IMAGE" + ], + [ + 44, + 29, + 1, + 35, + 1, + "STRING" + ] + ], + "groups": [], + "config": {}, + "extra": { + "workflowRendererVersion": "LG", + "ue_links": [], + "links_added_by_ue": [], + "ds": { + "scale": 1.1, + "offset": [ + -3048.698587382934, + 1363.985488079904 + ] + }, + "frontendVersion": "1.36.14", + "VHS_latentpreview": true, + "VHS_latentpreviewrate": 0, + "VHS_MetadataImage": true, + "VHS_KeepIntermediate": true + }, + "version": 0.4 +} \ No newline at end of file