Refactor: Replace manual memory management with smart pointers
Replaced all malloc/free calls with std::unique_ptr to leverage RAII for memory management. Used custom deleters where needed to handle specific free functions, such as stbi_image_free and free_sd_ctx. Simplified resource cleanup by removing explicit free calls, reducing the risk of memory leaks and improving code readability. Adjusted function calls to align with smart pointer usage, ensuring compatibility and preventing raw pointer access
So true. I keep getting memory leaks bc it allocates memory for images but im getting crash when i trying to free them
This has good intentions, but the PR has many unrelated and inappropriate changes, like this one:
And things that look a lot like something an LLM would mess up (for instance, it's removing the whole img2vid call).
I realize this was submitted a long time ago, but if you can clean it up I'll review it again.