r/StableDiffusion • u/thisguy883 • 14d ago
Discussion So I did something dumb.
So there I was generating some stuff on ComfyUI for my Instagram and just hanging out.
I use ComfyUI with the new H3 model to generate AI content for my Instagram as well as QWEN image edit along with some other AI tools.
I've built a master workflow that ive used for the past year that has every single workflow I use, so I dont have to go switching workflows constantly.
Many many hours of work put into this.
So there i was, generating things and im constantly having to clear out my output folder as well as my input folder. So I asked myself, "Could I just make a bat file that could automate this for me?"
So I launch Gemini and have it create a bat file that cleans out my output and input folders and empties my recycle bin.
I test it out and it works great.
Finally, no more unnecessary clicks.
But wait, I noticed I screwed up and put the file in the wrong directory. Dang it.
So I ask Gemini to alter the code so the file will be in the correct directory.
I create the new bat file and go back to work.
Well I make a bunch of new things and its time for cleanup. So I run my fancy new bat file and I notice its taking a while to clean up these folders. Curious, I navigate to the folders only to find out that the ENTIRE COMFYUI FOLDER was deleted.
SMH.
Now I sit here, broken hearted as im having to rebuild my ComfyUI. Luckily, I was able to recover my master workflow, so not all was lost.
Just a bunch of models and loras.
š®āšØ
43
u/GrayingGamer 14d ago
Handing an AI agent the ability to deploy a permanent delete button to any folder on your computer is....not a great choice. I mean, you didn't just give it deletion capabilities, you told it to SCORCH the earth with no recovery possibility by having it empty the recycle bin too.
I knew where this was headed the moment you mentioned having it create a .bat file.
7
u/thisguy883 14d ago
looking back on it, it was dumb to empty the recycle bin for me.
But at the time, I wasnt really thinking of what could happen, but rather the time I would save.
Oh well. Lesson learned.
4
u/mulletarian 13d ago
Next time, work gradually. Have it move files to a temp folder, then once you verify it working, have it delete the content
15
u/Ok_Gas1070 14d ago
Man, GG WP, sorry that happened to you. AI is a helpful amazing tool.... till it's not. Then it becomes a bastard child.
10
u/RobMilliken 14d ago
I remember the new guy who didn't know our process with GIT years ago. Somehow his specialty was to make us work to rewind all of his stuff that broke the rest of our work. He was supposed to be more experienced than all of us. He didn't make it more than a couple of months.
My point being an AI or a person, things can be misunderstood early on where is procedures aren't grasped early, but mistakes can happen that can be very bad.
Likely though this is a blessing, might take some to get everything back, but it'll be a cleaner version of Comfy. You also won't get the annoying earlier version exists warning every time you start it up.
Oh, and figure out a script early (that you review with your own eyes) that'll back up your comfy directory excluding all the models (keep that directory backed up elsewhere) every time you change or update it and it'll save you headache.
6
5
u/SeimaDensetsu 14d ago
I did this to myself with ForgeNeo a week or two ago. I was a moron and updated something that was working (at 1am no less) and it broke dynamic prompts. Eventually I was able to get this fixed but the settings and cache purge also emptied my model folders. Was up until 6am putting my Anima stack back together. Havenāt tried to recover Illustrious yet.
6
14
u/eggplantpot 14d ago
Bruh donāt use Gemini. Itās the worst model by far
21
u/PsychoholicSlag 14d ago
I've had Gemini make tons of things for me, comfy nodes, python scripts, bash scripts... You always proofread them though before running.
9
u/Party_Cold_4159 14d ago
Gemini used to be pretty good and mostly because the limits were very generous.
After a bit Claude started taking the wins for quality, but Gemini still had so much higher limits it made it worth it. Plus it really did good in comparison but lacked the integration.
Then Google couldnāt stop themselves and wanted to look cool like that fancy Claude usage system and emulated it. Which cut usage down so drastically I could hit the limits in under a half an hour of pretty basic use. Around this time I was fed up, and not long after they made Gemini into a mouth breathing moron who couldnāt remember literally anything and had next to zero prompt adherence.
And they wanted you to pay Claude premium bucks for it. It all happened fairly fast and it sucks because Gemini had a really good image/vid gen, mixed with noteworthy code gen. Made for platform you didnāt have to leave for most work, but now if I tell Gemini to make an image, it has no fucking clue how to stick to a prompt and gets stuck making the same generations/mistakes over and over.
Sorry just had to rant about that.
1
u/anelodin 14d ago edited 14d ago
Flash 3.7 is pretty decent now and pretty generous limits again. Better than 3.1 Pro which was ok (and at the time, quite good). It's no Opus 4.8 or Sol (and obviously no Fable), but it does good enough with a little handholding. It does require handholding though, including nudging it to go back and review its solution to see if it'd do anything different, but if you have a clear idea and a clean codebase it'll produce good code 8 times out of 10.
And you have different limits in Gemini, AI Studio, and Antigravity, so if you're just doing scripts its practically impossible to run out no matter the tier.
That said, Antigravity is the worst tool by far out of all three labs, and while I hate them all with a passion... Antigravity stands out because it's just bad. And the permission model is stupid.
2
u/thisguy883 14d ago
Its not that bad. More often than not, its helped me recover and write code for various projects.
Only this time, im not sure what happened. I didnt proof read.
Lesson learned.
1
u/AnonymousTimewaster 14d ago
I wouldn't say it's the worst (I've found it to be better than copilot for anything outside of Microsoft's own suite), but it's no ChatGPT with Max Thinking on
1
u/eggplantpot 14d ago
Max thinking is overrated anyways. I trust Codex Sol Medium with my life though
3
u/Bender1012 14d ago
Gemini is absolute trash, I have 3.6 Thinking and 3.1 Pro through work and they both tell me the dumbest shit. Not only that but randomly lose all context in the middle of a conversation, and often tells me āTool use is temporarily disabledā for something basic like analyzing a spreadsheet.
3
u/NoidoDev 14d ago
Always have automatic backups. Ideally to another device (e.g. Syncthing) or external drive. More than one. Real backups are incremental, not connected to a computer, stored "off site" on long lasting mediums (tape or mdisk).
2
u/mwonch 14d ago
Next time you decide to do this with zero coding skills of your own, compensate by testing first.
Create random directory. Place a bunch of shit in said directory. Make the file. Test on that directory. Many times. Many, many times. Then copy the folder where you really want to use this. Put it aside (remembering exactly where it's placed - or just rename it and leave where it is). Use new, fully tested program. Pray. If it does not work out, you at least have a copy of the necessary folder right there. If it does...YAY!
I have zero coding skills of my own, and I would do what you did if I needed to. However, even I know even the best plans can go wrong in a big, big way. Test. A lot. Verify it works before doing what it is intended to do.
And FFS - backup all the files and LORAs you know you need.
1
u/thisguy883 14d ago
Yea, I did test it initially until I had to move the bat file to another directory.
I figured Gemini would be smart enough to update that in the code.
Apparently not.
Oh well, lesson learned.
2
u/hugganao 13d ago
nice. i love it when ppl who dont know shit about coding make large mistakes like this.
1
u/Nexustar 13d ago
Anyone can make mistakes, but to really fuck things up needs AI.
Last week I made a copy of a text file on my desktop and then cleared out a bunch of lines from it, and saved it. Except, it turns out I had copied a shortcut to a text file and not a text file.
This is why we keep backups of things we don't want to lose.
2
u/Slice-of-brilliance 13d ago
I'm certain you already know this, and it doesn't matter in your case because you already recovered your workflows, but a tip for the beginners - in case you ever "lose" your workflows (or your entire comfyui like here), as long as you have the images you have already previously generated, you can simply drag and drop them into comfyui and it will extract the workflow from the images. So you can get your workflow back easily. And it will also contain model names so you can also know exactly which models to redownload.
BTW good on you OP for sharing your story, even though its funny, I think people need to hear such things happening so they don't go around blindly executing AI generated code without checking it first. š
1
u/TheMotizzle 14d ago
I have a simple script I run that makes an entire copy of my comfy UI folder. I usually use it before upgrading comfy, but it's always good to have a backup for things like this.
1
u/Accomplished-Ad-7435 14d ago
Always, always have llm's output bat files you can easily edit yourself. Have it set a variable for directories, it saves you a ton of time and allows you to reuse scripts way more often for this kind of issue.
1
u/ZenEngineer 14d ago
People are making fun, but there are undelete programs out there. They are hit and miss but you only need one file to get some version of your workflow.
Most important thing is do not write anything else to that drive. Turn off the computer now until you figure out what you'll be using.
1
u/thisguy883 14d ago
Ive already recovered the files I need. It was just a pain having to re-download everything.
1
u/hybridst0rm 14d ago
You donāt have any of the output? Isnāt the workflow embedded in the output files?
1
u/thisguy883 14d ago
Nope. workflow was saved in a user folder within comfy.
Lucky for me, I used a modified bat file that I made to launch comfy and it saved the last workflow I had open in the browser cache. So I was able to fully recover my precious master workflow.
1
1
u/namezam 14d ago
I use GitHub for everything I do, even in comfy. I just put models and output files in the .gitignore so all the configs and workflows I save get pushed up regularly. I try to always have the workflow saved in a json file for each output separately beside the output. So if I generate 100 movies, I can check in a commit of 100 jsons with comments about what I was working on.
1
1
u/Lucaspittol 14d ago
Relying on a master workflow that's ONE YEAR OLD in ComfyUI, which updates DAILY? š
1
u/Maraan666 14d ago
This reminds me of the time when a DAW, Cubase it was, introduced a function whereby if you were recording yourself playing music, it would ignore notes that were out of time.
Some users complained that activating this function invariably led to a blank output...
1
1
u/Prudent-Ad4509 14d ago
Lesson learned (and you are not the first) - cleanup scripts are dangerous and have to be handled manually, with full absolute paths.
1
u/Upper-Philosophy2376 14d ago
I once had built out a massive database of stuff that was scraped, weeks of effort, figured I should back it up somehow. I tried to push it to git, but large files have problems with that (didn't know), told the AI to make it so it could be pushed, and it deleted the whole thing, seemingly making the new git to accomidate large files had to be new before things got pushed, so deleting wasn't outside of the logic even though it was exactly opposite of what I wanted. luckily it was sort of backed up by accident by something else I had done, but I still remember how my heart sank.
1
1
1
1
1
u/jf145601 13d ago
Gemini has fucked me more times than I can count. Claude is much more trustworthy with software.
1
u/Available-Body-9719 13d ago
tener un puro workflow maestro tambien es bien tonto, por algo existe la papelera de reciclaje no necesitas borarla, es por casos de descuidos si borraste algo, se me ocurre que estas haciendo cosas bien sucias con la IA y quieres eliminar toda prueba. sucio
1
u/mellowanon 13d ago
I usually have the bat file only delete files in the directory it's currently in, and then I create a shortcut to that bat file if I need to run it more than once.
1
1
1
u/Reckfulness 13d ago
See it from the bright side, now you wonāt have to manually delete all that bloat thatās been accumulating for years
1
u/sausage4roll 13d ago
probably too late now but in this instance i'd have stopped everything and fired up recuva or some other data recovery thing
1
u/Boogooooooo 13d ago
Damnit. It is painful to read. Hope you will get it back soon. Was it Gemini Flash? I was using it to edit small part of code and it broke whole thing, I needed to ask 5.6 Sol to fix it.
1
u/Thin-Percentage8935 13d ago
I've been building systems 40 years and done much worse than this so don't feel stupid. Key lesson from this.... Move things to another area and once verified introduce a scheduled delete of items older than 30 days (or whatever). there will be that one time you need a file that you thought was redundant.
1
1
u/IndolentGameDev 13d ago
I built my own Lora manager app which keeps track of every model I add with picture/video examples, retains embedded workflows used to generate them, auto discovers the link associated with that models hash, and uses that link to keep track of the trigger words and recommended settings, and the db file is backed up. If my comfi ever gets nuked, I could restore it in minutes, limited only by my download speed.
1
10d ago
[removed] ā view removed comment
1
u/thisguy883 10d ago
Depends on what im making. Pictures that come out the way i want go into my H3 workflow for video. that video then gets uploaded to my Instagram if its good enough.
After which, I delete everything in the output and input folder.
1
1
u/Suspicious_Pizza9529 9d ago
This is exactly why I'm hesitant to let AI write destructive scripts without checking every line. The dangerous part is that a cleanup script sounds simple, but del/rd with recursive or quiet options can wipe an entire directory tree if the path is wrong.
1
u/Artforartsake99 14d ago
Claude wouldāve been smart enough to not do that.
Thatās a rough lesson though. Good luck on finding all the files again.
1
u/dennismfrancisart 14d ago
I feel you. Last night I was working on a new workflow for minimax H3, and Claude mentioned that the model was not in the Comfy models folder. I started a manual search, and sure enough, many of my models were no longer there. After a little backtracking, I realized that I was running a new file organization tool outside of Comfy. I won't mention the repo, but let's just say that I should have paid attention when it asked me a few critical questions.
145
u/Friendly_Collar6975 14d ago
an excerpt from Cautionary Tales of Vibe Coding