WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.22k stars 177 forks source link

Overwrite mode batch change #19

Closed AbyszOne closed 1 year ago

AbyszOne commented 1 year ago

The overwrite mode is useful, but it does not cover batches, which is the main use for which it was requested. The idea is that you can overwrite files if they already exist instead of adding to the existing sequence. That way you can repeat batches in the same folder. Currently, it overwrites the same file, which limits its use.

WASasquatch commented 1 year ago

It's unfortunately not possible. The only reason it can make increment files is because it checks the files in the dir. So it counts all the files, and then increments + 1 for the new file, so it doesn't overwrite files.

It's not possible for the node to incrementally overwrite files, because it has no idea what it overwrote on each run (every time you run the script, it's accessing the node files fresh, as if launched for the first time). So every run, it would just overwrite ComfyUI_00001_.png every time, because that's the first file it would encounter when it starts a counter to check files. And since it runs fresh every time, will always start at 1.

The only way I can think that this would "sorta" work is if you always did a batch of images in one gen, so when the images got to the node, it had X images, and could overwrite X images. But then only those X images every time. But batch images aren't supported for image processing due it being unintuitive speed wise on certain nodes.

AbyszOne commented 1 year ago

The numeric condition only reads if there is a change, so any other condition should fulfill the same function. For example, store the file's last modification date order and add a +1 if it has changed, or so on. That would allow batches to be read and overwritten freely.

AbyszOne commented 1 year ago

Separate question. How do I reset the batch counter? It doesn't matter what I put in the index textbox, it continues from the image where the last batch ended. Also, now there is no txt so I can't reset the counter manually. Not having txt is good, anyway. It crashed batches in Auto1111 and some scripts. I would just need to be able to decide where my batch starts.

WASasquatch commented 1 year ago

Separate question. How do I reset the batch counter? It doesn't matter what I put in the index textbox, it continues from the image where the last batch ended. Also, now there is no txt so I can't reset the counter manually. Not having txt is good, anyway. It crashed batches in Auto1111 and some scripts. I would just need to be able to decide where my batch starts.

Delete the settings database, or change the label name. It also resets if you change the path under same label.

The numeric condition only reads if there is a change, so any other condition should fulfill the same function. For example, store the file's last modification date order and add a +1 if it has changed, or so on. That would allow batches to be read and overwritten freely.

That would then lead to confusion and possible unrecoverable images because it would have the same flaws as batch loading and relying on a database. As you mention above, they could be using the same label for storage, and not realize they are overwriting the wrong files because it continues from an arbitrary result in the past.

AbyszOne commented 1 year ago

I guessed about changing the label, but it's very impractical in complex workflows with multiple nodes, let alone the other options. A selectable "continue counter" or "reset batch" mode would solve the root problem and thousands of unnecessary clicks and typing in a work day.

I didn't understand why you should care what people overwrite. Whoever chooses an overwrite mode will know that they are replacing files with the same name format. No one is going to choose a folder with files they don't want to overwrite, and if they do, they aren't very smart. I don't think it's a reasonable approach to not implement an override mode, in any case, any mode will have an "what if" that could cause problems by mistake. That is something that rests on the user.

WASasquatch commented 1 year ago

I guessed about changing the label, but it's very impractical in complex workflows with multiple nodes, let alone the other options. A selectable "continue counter" or "reset batch" mode would solve the root problem and thousands of unnecessary clicks and typing in a work day.

That's a request for ComfyUI to support such features.

I didn't understand why you should care what people overwrite. Whoever chooses an overwrite mode will know that they are replacing files with the same name format. No one is going to choose a folder with files they don't want to overwrite, and if they do, they aren't very smart. I don't think it's a reasonable approach to not implement an override mode, in any case, any mode will have an "what if" that could cause problems by mistake. That is something that rests on the user.

It's the same reason everything ever will ask if you want to overwrite a file. Because it's a liability. It could cost someone real time and money. To have that coupled with functionality flaws that make it hard to use, just like you're complaining about with the batch loader, which would carry over to this functionality, would be negligent.

You're basically answering your own questions with your own struggles with the Batch Loader.

AbyszOne commented 1 year ago

Even though they go twice that you hint at it ("be a bit smarter"), I'm not stupid. From zero knowledge of coding I have written a program and combined thousands of lines of functional code the last few weeks just looking at examples and asking Bing. I understand what can and cannot be done, and I understand that your nodes can perform the functions efficiently if modified correctly. You talk about flaws, but the limitations of your nodes are flaws. If you don't want to face them, that's fine. You don't want to add features, that's fine. But don't make cheap excuses or talk like you've already achieved the most flexible and efficient functionality and it would be remiss to change it, because it's not true. Good luck with your suite. 🖐

WASasquatch commented 1 year ago

You don't seem to understand. I know they are flaws. And all you've suggest is I do the same thing I've done with batch loading, which I've immediately explained why that's a terrible idea. Messing with some code with Bing is a far cry from the fundamentals and practices. We don't need to introduce weird functionality like batch loading when it comes to overwriting files. Just make a new directory.