feat: add overwrite/increment to SaveImageTextDataSetToFolderNode#13215
feat: add overwrite/increment to SaveImageTextDataSetToFolderNode#13215zeerd wants to merge 3 commits intoComfy-Org:masterfrom
Conversation
…DataSetToFolderNode
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe changes add an 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@comfy_extras/nodes_dataset.py`:
- Around line 231-245: The nodes SaveImageDataSetToFolderNode and
SaveImageTextDataSetToFolderNode were made to require mode, breaking existing
callers; update their execute(cls, ...) implementations to treat mode as
optional by defaulting missing/empty values to "overwrite" (e.g., if not mode or
not mode[0], set mode = "overwrite" before using it) and also adjust the
io.Combo.Input declaration to allow an omitted value (keep the options but make
the input optional or provide a default of "overwrite") so existing node call
shapes continue to work.
- Around line 199-200: The code is wrongly deriving width/height from
img_tensor[0] and mutating prefix, causing incorrect %width%/%height% resolution
and prefix reuse; update the save path logic in the block that calls
folder_paths.get_save_image_path so it uses the actual PIL image size (use
img.size to get (W,H) or (width,height) appropriately) rather than
img_tensor[0].shape, and do not overwrite the incoming prefix—store the result
of get_save_image_path in a new local (e.g., resolved_prefix or resolved_paths)
and then build filename as f"{resolved_prefix}_{counter:05}_{idx:05d}.png" so
each image in the batch gets the correct dimensions and unique prefix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2f304509-88de-4224-ae4a-6199dd0ae5f2
📒 Files selected for processing (1)
comfy_extras/nodes_dataset.py
and SaveImageDataSetToFolderNode
The nodes
SaveImageTextDataSetToFolderNode/SaveImageDataSetToFolderNodewill overwrite old pictures and keep the latest one.But, usually, we need to create few pictures then choose the better one.
So , we need a
incrementoption.