- Reject use_original_name=False + use_counter=False (all files collapsed to one output name) - Add preview_limit to cap in-memory preview tensors (was holding entire batch as float32) - Recover from per-file failures instead of aborting the whole batch - Fix _calc_new_size overshoot past longest_side and off-by-one truncation - Add upscale_if_smaller to SmartBatchResize to match SmartResize - Clip pixel values before uint8 cast (was wrapping on overflow) - Support CUDA tensors and RGBA/grayscale images in SmartResize - Handle empty batches; derive width/height from the actual output tensor - Require POST + loopback/origin check on the browse_folder endpoint (CSRF) - Add subprocess timeout to the folder picker dialog - Isolate the browse_folder route registration so import failures don't take down all nodes - Validate folder_custom against path traversal and self-overwrite - Replace IS_CHANGED=NaN with a folder-listing hash so unrelated graph runs can still cache
103 lines
3.9 KiB
JSON
103 lines
3.9 KiB
JSON
{
|
|
"last_node_id": 4,
|
|
"last_link_id": 3,
|
|
"nodes": [
|
|
{
|
|
"id": 1,
|
|
"type": "SmartBatchResize",
|
|
"pos": [60, 80],
|
|
"size": [340, 366],
|
|
"flags": {},
|
|
"order": 0,
|
|
"mode": 0,
|
|
"inputs": [],
|
|
"outputs": [
|
|
{
|
|
"name": "images",
|
|
"type": "IMAGE",
|
|
"links": [1],
|
|
"slot_index": 0
|
|
},
|
|
{
|
|
"name": "count",
|
|
"type": "INT",
|
|
"links": [],
|
|
"slot_index": 1
|
|
}
|
|
],
|
|
"properties": {
|
|
"Node name for S&R": "SmartBatchResize"
|
|
},
|
|
"widgets_values": [
|
|
"",
|
|
1024,
|
|
8,
|
|
"lanczos",
|
|
true,
|
|
"",
|
|
true,
|
|
false,
|
|
1,
|
|
true,
|
|
false,
|
|
"resized",
|
|
true,
|
|
"_",
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"id": 2,
|
|
"type": "PreviewImage",
|
|
"pos": [460, 80],
|
|
"size": [320, 280],
|
|
"flags": {},
|
|
"order": 1,
|
|
"mode": 0,
|
|
"inputs": [
|
|
{
|
|
"name": "images",
|
|
"type": "IMAGE",
|
|
"link": 1
|
|
}
|
|
],
|
|
"outputs": [],
|
|
"properties": {
|
|
"Node name for S&R": "PreviewImage"
|
|
},
|
|
"widgets_values": []
|
|
},
|
|
{
|
|
"id": 3,
|
|
"type": "Note",
|
|
"pos": [460, 390],
|
|
"size": [340, 400],
|
|
"flags": {},
|
|
"order": 2,
|
|
"mode": 0,
|
|
"inputs": [],
|
|
"outputs": [],
|
|
"properties": {
|
|
"text": "Smart Batch Resize — how it works\n\nThe node ALWAYS writes resized images to disk — connecting the outputs is optional.\n\nOutputs:\n📷 images → batch tensor, feed into PreviewImage or any IMAGE input\n🔢 count → number of images actually processed\n\nKey settings:\n📁 Input folder — pick with Browse folder, or paste a path\n📐 Longest side — target size, aspect ratio is always preserved\n🔢 Round to multiple of — snap dimensions (use 8 for SD/Flux)\n🏷️ Filename prefix / Keep original filename / Add counter — build the output filename\n📂 Create resolution subfolder / Custom output subfolder — where resized files land (default: input_folder/resized/)\n⏭️ Skip existing files — don't reprocess files already in the output folder\n\n▶️ Run Batch = same as the regular Run button — it just runs this node. No separate output folder needed: results are saved inside the input folder itself (in the resized/ subfolder).\n\nTip: leave the prefix empty and 'Keep original filename' on to preserve names, or turn it off and use a prefix + counter for a clean renumbered batch."
|
|
},
|
|
"widgets_values": [
|
|
"Smart Batch Resize — how it works\n\nThe node ALWAYS writes resized images to disk — connecting the outputs is optional.\n\nOutputs:\n📷 images → batch tensor, feed into PreviewImage or any IMAGE input\n🔢 count → number of images actually processed\n\nKey settings:\n📁 Input folder — pick with Browse folder, or paste a path\n📐 Longest side — target size, aspect ratio is always preserved\n🔢 Round to multiple of — snap dimensions (use 8 for SD/Flux)\n🏷️ Filename prefix / Keep original filename / Add counter — build the output filename\n📂 Create resolution subfolder / Custom output subfolder — where resized files land (default: input_folder/resized/)\n⏭️ Skip existing files — don't reprocess files already in the output folder\n\n▶️ Run Batch = same as the regular Run button — it just runs this node. No separate output folder needed: results are saved inside the input folder itself (in the resized/ subfolder).\n\nTip: leave the prefix empty and 'Keep original filename' on to preserve names, or turn it off and use a prefix + counter for a clean renumbered batch."
|
|
],
|
|
"color": "#2a3a2a",
|
|
"bgcolor": "#1a2a1a"
|
|
}
|
|
],
|
|
"links": [
|
|
[1, 1, 0, 2, 0, "IMAGE"]
|
|
],
|
|
"groups": [],
|
|
"config": {},
|
|
"extra": {
|
|
"ds": {
|
|
"scale": 1,
|
|
"offset": [0, 0]
|
|
}
|
|
},
|
|
"version": 0.4
|
|
}
|